Created
January 13, 2014 21:20
-
-
Save dander/8408382 to your computer and use it in GitHub Desktop.
Upgrade detection properties for WiX (not tested but looks like a handy thing to have). I'm actually thinking this might make more sense in a Fragment instead of Include. based on: http://code.dblock.org/msi-property-patterns-upgrading-firstinstall-and-maintenance#comment-695361597
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize"/> | |
<SetProperty Id="FirstInstall" After="FindRelatedProducts" Value="true"> | |
NOT Installed AND NOT WIX_UPGRADE_DETECTED AND NOT WIX_DOWNGRADE_DETECTED | |
</SetProperty> | |
<SetProperty Id="Upgrading" After="SetFirstInstall" Value="true"> | |
WIX_UPGRADE_DETECTED AND NOT (REMOVE="ALL") | |
</SetProperty> | |
<SetProperty Id="RemovingForUpgrade" After="RemoveExistingProducts" Sequence="execute" Value="true"> | |
(REMOVE="ALL") AND UPGRADINGPRODUCTCODE | |
</SetProperty> | |
<SetProperty Id="Uninstalling" After="SetUpgrading" Value="true"> | |
Installed AND (REMOVE="ALL") AND NOT (WIX_UPGRADE_DETECTED OR UPGRADINGPRODUCTCODE) | |
</SetProperty> | |
<SetProperty Id="Maintenance" After="SetUninstalling" Value="true"> | |
Installed AND NOT Upgrading AND NOT Uninstalling AND NOT UPGRADINGPRODUCTCODE | |
</SetProperty> | |
</Include> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment