activescott/lessmsi

Fails to extract single file from WiX MSI

TheLever opened this issue · 2 comments

Hi,

I was trying to extract a single file from a simple MSI I built using WiX (3.11). Upon trying to extract, I get "An attempt was made to reference a token which does not exist." It seems the code wants to copy the cab, which fails. I see also that it tries to reference a cab in a place where it does exist - maybe it can't handle embedded cabs?

The installer is built using this xml:

  <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
  <Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />

  <Feature Id="ProductFeature" Title="SimpleInstaller" Level="1">
     <ComponentGroupRef Id="ProductComponents" />
  </Feature>

The source xml got truncated, attaching a sample here.
SimpleInstaller.zip

@TheLever This is actually an invalid msi. If simply double-click it on windows and attempt to install it you'll see the following message:
screen shot 2018-11-22 at 10 20 42 pm

The problem with it is that -as written- you must include the cab along with the msi. If you want to embed the cab into the msi you must prefix the cab file name with with a number sign. This is explained in the Cabinet MSI docs which is linked to from the Media table docs.

So net net, change your Media line to the following and I believe it will work in lessmsi and windows:

<Media Id="1" Cabinet="#cab1.cab" EmbedCab="yes" />