Search code examples
wixwindows-installerwix4

WIX MSI version 3 > version 4 - Duplicated item in the list of Program installed


I used HeatWave to migrate the WIX template from version 3 to version 4. If I want to install the MSI on top of an old installation that used version 3 of the WIX MSI template, The file did get updated correctly however, I get a duplicated entrance in the list of "Programs and Features" in the Control Panel in Windows 11.

The UpgradeCode is the same as for the old MSI installation. I added :

<Upgrade Id="same-id-as-UpgradeCode">
  <UpgradeVersion Minimum="1.0.0" Maximum="reference-to-actual-version" Property="PREVIOUSFOUND" IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>

That change did not change the outcome. The program version is higher and some of the file being updated have higher version and get replaced, no problem on this side. I already had the entrance :

<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="message as text" />

I look through the log file while running the new MSI and, obviously the part were file get removed is missing, compared to a simple installation.

I went through the schema of the documentation from WIX and I looked through the example of a new project from the HeatWave basic bundle and documentation.

I am out of ideas on how to find, why the version 4, does not pick up on the UpgradeCode and remove the MSI package. I have try to repeat the test with the older version of MSI WIX version 3 of the software, the new one with version 4 and the new one with version 3. It is always the same result (old.msi v3 > new.msi v3 (success), v3 > v4 (duplicate)).

The migration of the template removed the Product key and instead added Package in its place, the Id= in Product is not present anymore but as pointed in the log of the migration this is ok*

There are some errors in the logs file, they look related to an "SQL" request. The most verbose one is as follow :

MSI (s) (34:08) [17:41:05:031]: Note: 1: 2205 2: 3: Error MSI (s) (34:08) [17:41:05:031]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 2911 DEBUG: Error 2911: Could not remove the folder C:\Config.Msi. The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2911. The arguments are: C:\Config.Msi, ,

The main difference in the log between the successful upgrade and the failure is as follow; Upgrade :

Action 17:56:26: FindRelatedProducts. Searching for related applications Found application: [1] Action start 17:56:26: FindRelatedProducts. FindRelatedProducts: MSI (c) (6C:90) [17:56:26:090]: PROPERTY CHANGE: Adding WIX_UPGRADE_DETECTED property. Its value is '{887DFE8D-6464-4D97-BED3-70E80F38FF67}'. MSI (c) (6C:90) [17:56:26:090]: PROPERTY CHANGE: Adding MIGRATE property. Its value is '{887DFE8D-6464-4D97-BED3-70E80F38FF67}'.

The failure :

Action 17:39:40: FindRelatedProducts. Searching for related applications Found application: [1] Action start 17:39:40: FindRelatedProducts. MSI (c) (50:A4) [17:39:40:465]: FindRelatedProducts: current install is per-machine. Related install for product '{887DFE8D-6464-4D97-BED3-70E80F38FF67}' is per-user. Skipping... MSI (c) (50:A4) [17:39:40:465]: FindRelatedProducts: current install is per-machine. Related install for product '{887DFE8D-6464-4D97-BED3-70E80F38FF67}' is per-user. Skipping...


Solution

  • You actually found the problem:

    FindRelatedProducts: current install is per-machine. Related install for product '{887DFE8D-6464-4D97-BED3-70E80F38FF67}' is per-user. Skipping...
    

    Your new package is per-machine, but your old MSI is per-user. The Windows Installer will not upgrade across install scopes.