Reputation: 826
I've just taken over a complicated Visual Studio/WiX project (I've never used WiX) and all of a sudden upgrades no longer include all of the files.
We don't version every .dll so we need to do every upgrade as a Major Upgrade. (I know this isn't usually a good idea, but this is for an appliance that only gets upgraded by a script on a USB drive). I've read this article and made the following changes:
<MajorUpgrade Schedule="afterInstallFinalize" DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
to the Product.wxs file (I've also tried Schedule=afterInstallExecute) with no luck.I added the following block of code to the Product.wxs file:
<Upgrade Id='291EF866-D9B7-4103-B006-F11E50EEDC7B'> <UpgradeVersion
OnlyDetect='no' Property='PREVIOUSFOUND' Minimum='1.0.0'
IncludeMinimum='yes' Maximum='99.0.0' IncludeMaximum='no' />
</Upgrade>
So when I started this process some of the .dlls were updating and others weren't. Now most update, but not all. Here's a sample line from the log for one of the files that's not updating:
MSI (s) (34:AC) [16:56:06:306]: Component: cmp9EE90E3731EB7F54B1D4B6D421BF1286; Installed: Absent; Request: Local; Action: Local
And here's the second line that refers to that file:
MSI (s) (34:98) [16:56:08:583]: Component: cmp9EE90E3731EB7F54B1D4B6D421BF1286; Installed: Local; Request: Absent; Action: Null
Upvotes: 0
Views: 414
Reputation: 826
I finally got it to work with an obscure property called REINSTALLMODE and setting it's Value to amus. Thanks Hannes for this post!!
Here's the solution:
<Property Id="REINSTALLMODE" Value="amus" />
<Upgrade Id='291EF866-D9B7-4103-B006-F11E50EEDC7B'>
<UpgradeVersion OnlyDetect='no' Property='PREVIOUSFOUND'
Minimum='1.0.0' IncludeMinimum='yes'
Maximum='99.0.0' IncludeMaximum='no' />
</Upgrade>
Upvotes: 0
Reputation: 1886
You need to change Schedule to afterInstallInitialize in the MajorUpgrade element.
Schedule="afterInstallInitialize"
And remove the Upgrade element.
You can check the specifics in this tutorial.
And I suggest you to read about the Schedule attribute from Here.
Upvotes: 1