1

Two different products have different UpgradeCodes and exist in two different setups (ProductA.msi and ProductB.msi). Both have version N.

Now ProductB is merged into ProductA version N+1. That is, ProductB's files will be provided by the installer of ProductA, and to the install location of ProductA.

A user that installs ProductA version N+1 would not like ProductB to be installed any more (it could even cause problems). So when ProductA is installed/upgraded to version N+1, ProductB (any version) should be removed. How can I accomplish this in the setup of ProductA?

It's similar to this question, but that is for removing a different product at uninstall rather than at install/upgrade. Wix - uninstall different product

Anders Forsgren
  • 10,408
  • 4
  • 37
  • 74

2 Answers2

1

Add ProductB's upgrade code to a new Upgrade element in ProductA. Then when installing ProductA N+1, the upgrade will remove both ProductA N and ProductB.

Bob Arnson
  • 20,055
  • 2
  • 38
  • 46
1

WiX Sample: Here is a technical sample of doing as Bob Arnson describes: Adding entries to MSI UpgradeTable to remove related products. Make sure you leave this entry in your setup for future releases. It needs to persist there as people can skip a few version when upgrading?

Inline Sample: Please see link above for full sample.

<!-- Older Product Line 1: Upgrade Code -->
<Upgrade Id="{11111111-1111-1111-1111-000000000000}">
   <UpgradeVersion Property="PRODUCTLINE1" IncludeMinimum="yes" Minimum="0.0.0" />
</Upgrade>

Debugging Major Upgrades: WIX does not uninstall older version - an ad-hoc list of causes for major upgrade failure.


Component Referencing: Merging setups can cause some component reference errors. I assume you are aware. This could manifest as missing files after installation or "some malfunction" during upgrade scenarios. Faulty registration, stranded files, you name it - just mentioning.

  • Component GUIDs: Here is some background information on component referencing and component GUIDs: Change my component GUID in wix?

  • As a rule of thumb: If you install the old files to a new location with new component GUIDs you should be fine. Things to check: shared files, COM servers, anything unsual in terms of machine-scope registration, services, COM Interop, COM+, etc... Many setups are simple, others are not.

  • Custom Actions: Migrating any custom actions can cause serious problems - especially during upgrade scenarios with complex sequencing and conditioning for when the actions actually run and not.

Stein Åsmul
  • 37,754
  • 24
  • 87
  • 158