3

So, I have a product installer authored using WiX which is failing to upgrade correctly once the 'Microsoft_VC100_CRT_x86.msm' merge module is incorporated. The old product is not removed during the installation. If the merge modules are removed from the project the removal of the old version takes place as it should.

The merge module is included quite simply under a Directory node:

<Directory Id="ProgramFilesFolder">
  <Merge Id="VC10_CRT_MergeId1" Language="0" SourceFile="c:\\Program Files (x86)\\Common Files\\Merge Modules\\Microsoft_VC100_CRT_x86.msm" DiskId="1" />
... other stuff
</Directory>

and then referenced in the features:

<Feature Id="MainFeature" Title="Core Files" Level="1">
  <MergeRef Id="VC10_CRT_MergeId1" />
  ... other stuff
</Feature>

I am incrementing the version number of the product but the upgrade fails to happen and the new version is installed over the old version but without performing a correct upgrade - both versions are listed in 'Add or Remove Programs'.

The old product should be removed as follows:

<InstallExecuteSequence>
  <RemoveExistingProducts After='InstallValidate'/>
</InstallExecuteSequence>

I have also tried various other positions for RemoveExistingProducts as per http://jpassing.com/2007/06/16/where-to-place-removeexistingproducts-in-a-major-msi-upgrade/, with the same results.

In the verbose log for the installer the following is seen:

MSI (s) (AC:44) [19:48:22:300]: Doing action: RemoveExistingProducts
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2205 2:  3: ActionText 
Action start 19:48:22: RemoveExistingProducts.
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 22 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 23 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 16 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 21 
Action ended 19:48:22: RemoveExistingProducts. Return value 1.

In the WiX build log I get the following (but from memory this is normal with the VC runtime msms?):

1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 1 in the table InstallExecuteSequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 1 in the table InstallUISequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdminExecuteSequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdminUISequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdvtExecuteSequence

The InstallExecuteSequence in the msi looks like the following:

enter image description here

If the merge module is removed (it needs to be included due to updated files in the installer) then the upgrade works as expected. Is this a bug in the merge module stuff/WiX/Windows Installer, or am I doing something wrong?

0E322070
  • 762
  • 1
  • 5
  • 15
  • Can you provide details from the verbose log file that shows what exactly is going wrong. – Rob Mensching Apr 03 '13 at 17:42
  • I've updated my question to include the only thing of relevance I can see in the log. Note that the installer is not actually failing to complete, but is not removing the old version. – 0E322070 Apr 03 '13 at 17:51
  • Can you clarify in the opening paragraph what does not "upgrade as they should"? I'm very confused what problem you are actually experiencing. – Rob Mensching Apr 03 '13 at 18:24
  • OK, apologies for any lack of clarity, I've updated the opening paragraph. The problem is simply that the old version is not being uninstalled when the merge modules are added to the project. – 0E322070 Apr 03 '13 at 18:28
  • A great reason to use Burn to install the redist packages instead of using the merge modules. – Christopher Painter Apr 03 '13 at 20:19
  • In the end I have gone with a non-msi solution to deliver the redist. – 0E322070 Apr 13 '13 at 21:25

2 Answers2

0

You're not getting any error messages on the upgrade? It goes through but you're left with two Add/Remove entries and a messed up file system? It sounds like your two versions don't share the same upgrade code.

If you're trying to do a minor upgrade, RemoveExistingProducts won't be triggered. Files should be updated but you'll keep one Add/Remove entry.

If you're trying to do a major upgrade that will trigger RemoveExistingProducts, but you need to set up the Upgrade element correctly.

Also, as a tip, don't use the merge modules. Due to how Windows Installer component rules work, on a minor upgrade you cannot remove the components the merge module adds. You would need to introduce a major upgrade. (Or add all the component codes from the old merge module to your project by hand. Not fun.) Depending on how all your stuff is set up, forcing a major upgrade could be a big hassle.

You'll run into this if you add the merge module and later need to remove it. Or if you want to replace say the VS 2010 module with the VS 2012 one. MS even broke component rules between service packs once. It's much easier to install them by running the vcredist*.exes during or before your product's install.

  • The upgrade codes are correct, and without the addition of the merge module RemoveExistingProducts works correctly and the upgrade succeeds. The _only_ thing that has changed is the addition of the merge module. – 0E322070 Apr 10 '13 at 14:23
  • So you're doing major upgrades? What does the verbose logging look like for FindRelatedProducts for the upgrades both with the merge module and without? There may be a FindRelatedProducts in both UI and Execute sequence. Are you not changing the product code for one of the v2 packages? Review the [major upgrade docs](http://msdn.microsoft.com/en-us/library/windows/desktop/aa369786(v=vs.85).aspx) and see if anything pops out at you. Those are some ideas. – Walter Wilfinger Apr 10 '13 at 17:42
0

Have you found the problem yet? Check if the version of merge modules you are adding is older than that already existing on the system you are installing. In that case, the MSI would remove the VC++ files but not put the new ones down because they were older.

Edit: I found the solution to your problem!! you should be using: RemoveExistingProducts After="InstallFinalize

Refer: http://blogs.msdn.com/b/astebner/archive/2007/02/08/assemblies-may-be-missing-from-the-gac-or-winsxs-cache-after-an-msi-major-upgrade.aspx

I had the same issue and changing this fixed it.

sgowd
  • 946
  • 3
  • 10
  • 27