Majorupgrade or Upgrade ID, which is preferred for a major upgrade?

We are trying to complete a major upgrade. While I was researching, I found 2 approaches.

One uses the Update Identifier, and the other is the Majorupgrade tag.

Majorupgrade seems to be easy to do. But the schedule does not contain any actions before setting the initialization.

I'm not sure what to use.

Which one is preferable [and recommended] mainly?

+7
source share
1 answer

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.

+17
source

All Articles