0
votes

I've got a WIX installer that installs some unversioned files from an external CAB file.

My problem is that I'm told I need RemoveExistingProducts before InstallInitialize for unversioned files to upgrade correctly. However, it seems to freak out with external cab files, and keeps giving me an error that the file isn't in the CAB file (even though it is).

If RemoveExistingProducts is after InstallExecute, it installs correct with the CAB file the first time, but will not upgrade the file during an upgrade

Below are some snippets:

<Media Id="2" Cabinet="Videos.cab" EmbedCab="no" CompressionLevel="none" />

...

<Component Id="Video01" Guid="{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}" DiskId="2" >
    <File Id="Video01.wmv"  DiskId="2" Vital="no" Source="BLAH.wmv" Name="Video01.wmv"/>
</Component>

...

<InstallExecuteSequence>
    <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWERPRODUCTFOUND</Custom>
    <!--<RemoveExistingProducts  After="InstallExecute" />-->
    <RemoveExistingProducts  Before="InstallInitialize" />
</InstallExecuteSequence>
1

1 Answers

0
votes

Try setting the DefaultVersion attribute for the file and add RemoveExisingProducts after InstallExecute. As stated in the MSDN:

Versioned Files Win—A versioned file gets installed over a nonversioned file.