Recently I released a package versioned 0.8.3
and I'm ready to release a new package now. I was, however, struggling to implement a Major Upgrade
/ Upgrade
. It seemed like the WIX_UPGRADE_DETECTED
variable was never populated.
Then I ran across WiX3 major upgrade not working where the accepted answer states that:
- All setup versions (again, not file versions) must be 1.0 or greater.
And indeed temporarily bumping the major version of both packages to 1 seemed to fix the issue. However I can't retroactively change the version of the old package as it is already installed on thousands of computers.
What is the best way to cleanly uninstall the old package while installing the new one? Is there a better way than setting up a CustomAction
that runs msiexec.exe /x {PRODUCT-CODE}
?
As long as your upgrade code is stable between releases, you just need the upgrade table properly authored to be inclusive of the version you want to upgrade.
What construct do you use to implement your major upgrade? Do you use the MajorUpgrade element
? It should pretty much work straight out of the box:
<MajorUpgrade Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."
AllowDowngrades="no" AllowSameVersionUpgrades="no" />
Perhaps you are using old-style major upgrade elements: How to implement WiX installer upgrade?.
You should provide us with your WiX snippet that you use to implement major upgrades.
I would make sure that the max version specified in your Upgrade table is the same as the setup version you are currently installing.
Some Links:
Answers:
- Bob Arnson, WiX Developer's blog on major upgrades: https://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/
- Larger sample with old-style major upgrade elements:
Doing Major Upgrade in Wix creates 2 entries in Add/Remove Programs
- How to implement WiX installer upgrade?
Documentation:
- http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html
- https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/