title: How do I make a WIX MSI always remove a previous version?
body: <p>I have CI build system builds an MSI whenever a developer checks in a change. We run automated acceptance tests on the installed MSI.</p>
  
  <p>Basically every MSI is a complete install of the product, so we don't have any versioning (ala Windows installer) per se..</p>
  
  <p>Each MSI has the same product GUID and upgrade GUID, and the same version number. but has a different package GUID (use '*' in wix).</p>
  
  <p>What I want to achieve is that when the installer runs, it will 'uninstall' any previously installed version of the product, and install the new one.. all from a single MSI (We have a convoluted install process that is out of our control.. citrix and sccm, so we want to give them a simple install path) </p>
  
  <p>I have tried:</p>
  
  <pre><code>&lt;Property Id='PREVIOUSVERSIONSINSTALLED' Secure='yes' /&gt;
  &lt;Upgrade Id='$UPGRADE_GUID'&gt;  
    &lt;UpgradeVersion Minimum='1.0.0.0'
                    Maximum='99.0.0.0'
                    Property='PREVIOUSVERSIONSINSTALLED'
                    IncludeMinimum='yes'
                    IncludeMaximum='no' /&gt;
  &lt;/Upgrade&gt;
  </code></pre>
  
  <p>and have:</p>
  
  <pre><code>&lt;InstallExecuteSequence&gt;
    &lt;RemoveExistingProducts After='InstallFinalize' /&gt;
  &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p>and have tried:</p>
  
  <pre><code>&lt;InstallExecuteSequence&gt;
    &lt;RemoveExistingProducts After='InstallInitialize' /&gt;
  &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p>But when I try to install an msi from a subsequent build I get:</p>
  
  <pre><code>Another version of this product is already installed. Installation of this version cannot continue. 
  To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. 
  </code></pre>
  
  <p>Which is not really what I was going for..</p>
  
  <p>I understand that I can just update the Version attribute in the product tag, but that becomes difficult to manage. Firstly I can produce 20+ msi builds a day as I have a number of build pipelines that produce MSIs and am not sure how to handle the version numbering in a way that makes sense.</p>
  
  <p>Maybe Windows Installer just does not allow this type of 'always overwrite installed version' install?</p>