title: how to know whether upgrading, repairing or uninstalling in installscript
body: <p>I'm trying to write some <strong>InstallScript</strong> code in <strong>Basic MSI</strong> project. I would like to know how to determine whether an install is <em>Upgrading</em> or <em>Repairing</em> or <em>Uninstalling</em>.</p>
  
  <p>None of these works in <strong>InstallScript</strong> -</p>
  
  <pre><code> REMOVE~="ALL"
   NOT Installed
   REINSTALL&lt;&gt;""
   PATCH&lt;&gt;""
   REMOVEALLMODE
  </code></pre>
  
  <p>I found <a href="http://www.installationdeveloper.com/3086/detecting-whether-an-install-is-initial-maintenance-or-uninstall/" rel="nofollow">this blog</a> and that <strong>MAINTENANCE</strong> flag works. But it can only determine whether it's Initial Install or Not. Always "TRUE" in Upgrade, Repair and Uninstall.</p>
  
  <p>Any help is appreciated.</p>