Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix MajorUpgrade problems

Here're the scenarios.

1.) Install 1.0.1.1 then upgrade to 1.0.2.2 ===> This works well (as expected)

2.) Install 1.0.2.2 then downgrade to 1.0.1.1 ===> This doesn't work (as expected)

3.) Install 1.0.1.1 then install 1.0.1.1 ===> This goes into Repair/Remove mode (as expected)

4.) Install 1.0.1.1 then install 1.0.1.2 ===> It is installed like a new one and show the program twice in Add/Remove program in control panel (I suppose it should work like 3.) because, from my understanding, MSI doesn't care the 4th part of product version)

Am I doing anything wrong ?

<Product Id="*" Name="My product" Version="$(var.Version)" Language="1033"  Manufacturer="My Company" UpgradeCode="MY-UPGRADE-CODE">

<Package Description="My product" Comments="Comments" InstallerVersion="200" Compressed="yes" />

<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
like image 849
Quizer Avatar asked Oct 18 '13 02:10

Quizer


1 Answers

This is behaving as mentioned in the WIX documentation. You need to set the below property to "Yes" in the MajorUpgrade element to handle this scenario. Read the highlighted text for more details.

AllowSameVersionUpgrades (YesNoType)

When set to no (the default), installing a product with the same version and upgrade code (but different product code) is allowed and treated by MSI as two products. When set to yes, WiX sets the msidbUpgradeAttributesVersionMaxInclusive attribute, which tells MSI to treat a product with the same version as a major upgrade.

This is useful when two product versions differ only in the fourth version field. MSI specifically ignores that field when comparing product versions, so two products that differ only in the fourth version field are the same product and need this attribute set to yes to be detected.

Note that because MSI ignores the fourth product version field, setting this attribute to yes also allows downgrades when the first three product version fields are identical. For example, product version 1.0.0.1 will "upgrade" 1.0.0.2998 because they're seen as the same version (1.0.0). That could reintroduce serious bugs so the safest choice is to change the first three version fields and omit this attribute to get the default of no.

This attribute cannot be "yes" when AllowDowngrades is also "yes" -- AllowDowngrades already allows two products with the same version number to upgrade each other.

Source: WIX Documentation

like image 179
Isaiah4110 Avatar answered Oct 18 '22 18:10

Isaiah4110