title: Adding Merge Module to Wix Project Causes Upgrade to Fail
body: <p>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.</p>
  
  <p>The merge module is included quite simply under a Directory node:</p>
  
  <pre><code>&lt;Directory Id="ProgramFilesFolder"&gt;
    &lt;Merge Id="VC10_CRT_MergeId1" Language="0" SourceFile="c:\\Program Files (x86)\\Common Files\\Merge Modules\\Microsoft_VC100_CRT_x86.msm" DiskId="1" /&gt;
  ... other stuff
  &lt;/Directory&gt;
  </code></pre>
  
  <p>and then referenced in the features:</p>
  
  <pre><code>&lt;Feature Id="MainFeature" Title="Core Files" Level="1"&gt;
    &lt;MergeRef Id="VC10_CRT_MergeId1" /&gt;
    ... other stuff
  &lt;/Feature&gt;
  </code></pre>
  
  <p>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'.</p>
  
  <p>The old product should be removed as follows:</p>
  
  <pre><code>&lt;InstallExecuteSequence&gt;
    &lt;RemoveExistingProducts After='InstallValidate'/&gt;
  &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p>I have also tried various other positions for RemoveExistingProducts as per <a href="http://jpassing.com/2007/06/16/where-to-place-removeexistingproducts-in-a-major-msi-upgrade/" rel="nofollow noreferrer">http://jpassing.com/2007/06/16/where-to-place-removeexistingproducts-in-a-major-msi-upgrade/</a>, with the same results.</p>
  
  <p>In the verbose log for the installer the following is seen:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>In the WiX build log I get the following (but from memory this is normal with the VC runtime msms?):</p>
  
  <pre><code>1&gt;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&gt;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&gt;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&gt;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&gt;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
  </code></pre>
  
  <p>The InstallExecuteSequence in the msi looks like the following:</p>
  
  <p><img src="https://i.stack.imgur.com/WulkH.png" alt="enter image description here"></p>
  
  <p>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?</p>