The MajorUpgrade element was introduced in wix 3.5 to simplify what you usually do with Upgrade . So instead of something like this:
<!– Major upgrade –> <Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" /> <UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" /> </Upgrade> <InstallExecuteSequence> <RemoveExistingProducts After="InstallValidate" /> </InstallExecuteSequence> <Condition Message="Can't downgrade"> NOT NEWERVERSIONDETECTED </Condition>
You can simply do this:
<MajorUpgrade DowngradeErrorMessage="Can't downgrade." />
Not only the old method is more detailed, but also requires repeating the update code and product version that are specified in the Product element. Therefore, the above example should use wix variables to synchronize them. If you make a mistake, the update will not work correctly.
The new MajorUpgrade element MajorUpgrade not have these complications, so I recommend you use it. See also this blog by Bob Arnson introducing MajorUpgrade and the wix documentation topic on this subject.
Wim coenen
source share