fairyberry
fairyberry

Reputation: 1175

Upgrading one product but not the other when both products have the same upgrade code

I have two products installed. They have the same version number and upgrade code, but different product code. I would like to do a major upgrade on one of these products, but the upgrade exe that I created ends up removing both products, and installing new one.

That being said, how can I keep one product installed when the product has the same upgrade code with the another product that I would like to upgrade?

Upvotes: 2

Views: 143

Answers (1)

Christopher Painter
Christopher Painter

Reputation: 55620

The Upgrade table first drives FindRelatedProducts. FindRelatedProducts uses the information to perform MSI product searches. If places the ProductCode of a found in the property specified by the ActionProperty column

Later, RemoveExistingProducts performs an uninstall of any ProductCodes found in any ActionProperty properties ( provided that msidbUpgradeAttributesOnlyDetect is not set ).

So the trick out of a sticky situation like this is to author an Upgrade row that will cause FindRelatedProducts to not find either product. Then use a custom action to do your own searches and set the properties as needed ( one but not the other ). Now RemoveExistingProducts will be able to perform the major upgrade.

As a side note: this is a work around and not a best practice. Carefully consider your choice of UpgradeCodes, ProductCodes and ProductVersion properties to avoid this situation in the future.

Upvotes: 1

Related Questions