I have a WIX installer which uses standard MajourUpgrade logic:
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="no" DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" AllowSameVersionUpgrades="yes" />
The installer harvests some files and also has some custom actions. I want to know if its possible to automate rollbacks. For example:
If I install version 1.0.0.0 and then install version 1.0.1.0. How can I rollback the install of 1.0.1.0 to 1.0.0.0 without introducing patches. I don't want to have to uninstall and then reinstall an older version.
Thank you in advanced.
First, add a reference to the WiXFailWhenDeferred Custom Action. This allows you to easily cause rollbacks to occur to enable your testing.
Second, read the Major Upgrade documentation. Take a look at the description for afterInstallExecute and read the linked blog article.
IMO it is safer to design an install that almost never fails and just use the default behavior and accept that someone may have to reinstall the original version. If you still want your desired behavior then make sure you are following the component rules. Use the MSIENFORCEUPGRADECOMPONENTRULES property in your testing to help beaware of component rule violations. Be sure to test net new install and upgrade installs and compare the file sets to make sure everything worked the way you expected.