We have some product, that uses WIX as installer technology. Upgrade handling in the installer is handled by he MajorUpgrade element
<Wix>
<Product Id="..." Name="..." Language="..."
Version="..." Manufacturer="..."
UpgradeCode="...">
...
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="yes" />
</Product>
</Wix>
As you can see, we supported upgrades from all older version until now, however we have to change this a bit, so that only versions newer than a certain version can be upgraded, while older versions receive an error message and upgrade fails.
From what I've researched, this should be doable with the Upgrade element (as described in https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/checking-for-oldies/)
My question now:
- is it possible/recommended to mix MajorUpgrade and Upgrade elements?
- is there a better way for achieving this?
Update
Thanks for the replies and answers, my used solution is the following:
<Wix>
<Product Id="..." Name="..." Language="..."
Version="..." Manufacturer="..."
UpgradeCode="My_upgrade_code">
...
<InstallExecuteSequence>
...
<Custom Action='UpdateFromVersionNotSupported' After='FindRelatedProducts'>UNSUPPORTEDUPDATEVERSIONFOUND</Custom>
...
</InstallExecuteSequence>
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="yes" />
<Upgrade Id='My_upgrade_code'>
<UpgradeVersion OnlyDetect='yes' Property='UNSUPPORTEDUPDATEVERSIONFOUND' Maximum='Oldes_version_where_update_is_allowed' IncludeMaximum='no' />
</Upgrade>
<CustomAction Id='UpdateFromVersionNotSupported' Error='Updates are only supported from version ?? or later' />
</Product>
</Wix>