wixwix3wix3.11wix4

WiX: Implementing Major Upgrade in WiX 4 for an installer build with WiX 3


I have had Major Upgrades working in a WiX v3.11 installer, following this tutorial and learning quite a bit (German only).

But now WiX 4 is here which I want to try out for an update from 2.0.0 (build with WiX 3.11) to 2.1.0 (build with WiX 4.0.3). And I see that the mentioned tutorial is somewhat outdated:

I would have thought that – besides the naming – everything works as before. So I bumped my version value from 2.0.0 to 2.1.0 and generated a new Package.ProductCode GUID (instead of Product.Id), just as said in step 2 of the tutorial. But my 2.1 product is installed additionally to 2.0:

v2.1.0 and v2.0.0 in parallel

I was not able to find an Upgrade tutorial especially for WiX 4, so my question is: What do I have to know to make this work?

UPDATE: I was able to verify with a second installer that our set-up is working. This is NOT an issue of WiX, nor WiX 3 vs. 4! But nevertheless this is a problem, so I tried to get some debug information by upgrade both products by running msiexec.exe /i each.msi /L*VX debug.log. Now in the working installer's log I see

MSI (c) (0C:2C) [01:08:30:365]: Doing action: FindRelatedProducts
Action 1:08:30: FindRelatedProducts. Searching for related applications
Action start 1:08:30: FindRelatedProducts.
FindRelatedProducts: Found application: {02494A83-9693-3A7E-B7F0-BC314326DD43}
MSI (c) (0C:2C) [01:08:30:370]: PROPERTY CHANGE: Adding WIX_UPGRADE_DETECTED property. Its value is '{02494A83-9693-3A7E-B7F0-BC314326DD43}'.
MSI (c) (0C:2C) [01:08:30:370]: PROPERTY CHANGE: Adding MIGRATE property. Its value is '{02494A83-9693-3A7E-B7F0-BC314326DD43}'.
Action ended 1:08:30: FindRelatedProducts. Return value 1.

while in the not working installer's log this reads:

MSI (c) (EC:58) [00:59:33:824]: Doing action: FindRelatedProducts
Action 0:59:33: FindRelatedProducts. Searching for related applications
Action start 0:59:33: FindRelatedProducts.
Action ended 0:59:33: FindRelatedProducts. Return value 1.

I read here that FindRelatedProducts considers UpgradeCode, version, language. All of these are unchanged between 2.0 and 2.1 in both projects. So it remains unclear, when and why WiX 4 does not find "related" aka previous WiX 3 installations.


Solution

  • The documentation says

    The FindRelatedProducts action uses the UpgradeCode property and the version and language information authored into the Upgrade table to detect installed products affected by the pending upgrade.

    But that's not sufficient. It may find a "related" product, but skips that anyways – e.g. if that product installed per-user (=registered under Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Installer\Products\), while the upgrade is installed per-machine (=registered under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\). This is the "Scope" in WiX.

    You can see if this happens by enabling debugging (<Property Id="MsiLogging" Value="voicewarmupx"/>, logs are stored in C:\Users\<username>\AppData\Local\temp) and searching for

    FindRelatedProducts: current install is per-machine. Related install for product '{FA3BF64B-3497-3605-AAC4-9210007BF8D6}' is per-user. Skipping...

    So the answer here is: Make sure to install both the product and its update in the same scope! You can do so by using the Scope attribute of the Package element, see here.