Search code examples
wixwindows-installer

WIX MSI installer upgrade for multiple depended products


We have multiple products. All can be installed separate but also installed at the same time. All are send as single MSI file. The issue is now the upgrade. If someone get a new MSI for one product it must fit at least to the major version of all other installed products.

The test with different upgrade code fails because if all are installed and each has the rule to allow the updates only within the same major version you can Deinstall one product and than install any version because there is no crosscheck

Reading the docu :

https://learn.microsoft.com/en-us/windows/win32/msi/upgradecode

The UpgradeCode property is a GUID representing a related set of products. The UpgradeCode is used in the Upgrade Table to search for related versions of the product that are already installed.

This sounds that we can use the same upgrade guid for all products and the installer can manage than the detection of the product versions for both.

Is this the correct way?

Or should we create a registry key „product major version“ and check this as central Storage over all MSI files.

Sample:

More details .. each product is a separate MSI file

  • Product A
  • Product B
  • Product C

Product A and B can be installed separate but if they are on the same computer their major version must fit

Product C is exclusive which means it can’t coexist with A or B

Basic Idea with same update guid was

  • Product A .. Update Code X
  • Product B .. Update Code X
  • Product C .. Update Code Y

On install of A or B make two test

  • if Update Code Y is here abort
  • If Update Code X is there Check major version abort if this does not fit or install or upgrade of A or B

On install C

  • if Update Code X is there abort
  • If Update Code Y is there Upgrade

From the other article a definitive solutions seems to give each product a own key but than the tests are more complicate and i have to know all keys in any product .. Adding entries to MSI UpgradeTable to remove related products

  • Product A .. Update Code X
  • Product B .. Update Code Z
  • Product C .. Update Code Y

On install A

  • if Update Code X is there and major version fit upgrade
  • If Update Code Z is there and major version fit upgrade
  • if Update Code Y is there abort

On install B

  • if Update Code Z is there and major version fit upgrade
  • If Update Code x is there and major version fit upgrade
  • if Update Code Y is there abort

On install C

  • if Update Code X or Z is there abort
  • If Update Code Y is there upgrade

Regards


Solution

  • it seems to work with the same upgrade id .. in the install log we can see all related proudcts sharing the GUID separate by ";"

    Action start 15:07:46: FindRelatedProducts.
    FindRelatedProducts: Found application: {E9C16B5B-DEFC-4257-B378-6BDA6724EAA3}
    MSI (c) (68:D0) [15:07:46:467]: PROPERTY CHANGE: Adding PREVIOUSVERSIONSINSTALLED property. Its value is '{E9C16B5B-DEFC-4257-B378-6BDA6724EAA3}'.
    FindRelatedProducts: Found application: {3C0B5AA4-2C04-4C51-9CDA-199367DD5D5B}
    MSI (c) (68:D0) [15:07:46:467]: PROPERTY CHANGE: Modifying PREVIOUSVERSIONSINSTALLED property. Its current value is '{E9C16B5B-DEFC-4257-B378-6BDA6724EAA3}'. Its new value: '{E9C16B5B-DEFC-4257-B378-6BDA6724EAA3};{3C0B5AA4-2C04-4C51-9CDA-199367DD5D5B}'.
    Action ended 15:07:46: FindRelatedProducts. Return value 1.
    

    anyway i have to add this here to avoid uninstall before the install runs because of the shared GUID

    <InstallExecuteSequence>          
        <RemoveExistingProducts Before='InstallInitialize'>0</RemoveExistingProducts>
    </InstallExecuteSequence>