title: Wix/MSI - How to avoid installing same MSI twice
body: <p>I have my installer coded in WiX language. It supports major upgrade mechanism. A particular requirement is that the <strong>same MSI file will not be possible to install twice.</strong></p>
  
  <p>Now comes the tricky part: if user install and then try to install it again (UI mode) the installer enters in maintenance mode and everything works OK (Change/Repair will appear disabled.)</p>
  
  <p>However when installing as our use case states in silent mode </p>
  
  <p><em>msiexec.exe /i installer.msi /qn</em> </p>
  
  <p>The second install will proceed to install as normal (we don't want this!)</p>
  
  <p><strong>Some things to noticed about are:</strong> </p>
  
  <p>In the log file of the second installation the sequence "<strong>FindRelatedProducts</strong>" will be skipped (as state in microsoft documentation <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa368600(v=vs.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/aa368600(v=vs.85).aspx</a>)</p>
  
  <p>Also I research a bit an here <a href="http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/UpgradeVersion-is-not-detecting-the-same-version-preventing-downgrades-td5875840.html" rel="noreferrer">http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/UpgradeVersion-is-not-detecting-the-same-version-preventing-downgrades-td5875840.html</a> there is good information, claiming that for this scenarios we can used <em>Installed</em> property to detect if Product is already installed...</p>
  
  <p><strong>However, I get stuck here: because I have to avoid installing previous or same versions than current one and allowing upgrades greater, How could I achieve this in WiX?</strong></p>
  
  <p>Thanks for your help!</p>