title: How to get msiexec to install and/or reinstall as necessary
body: <p>I have an internal MSI placed on a network drive, and I'd like to write a login script so that anyone on our network can get the MSI installed onto their machines, or to get it auto-reinstalled whenever the MSI is updated (which happens often).</p>
  
  <p>If I use <code>msiexec.exe /i REINSTALL=ALL</code> it will do nothing if the MSI has not yet been installed on that machine. If I leave out the <code>REINSTALL=ALL</code>, then it will do fresh installations, but will not do update/reinstall. </p>
  
  <p>What parameters should I choose to make it do a fresh installation if the package was not yet installed, and to do a full reinstall if the package was already installed?</p>
  
  <p>Running <code>msiexec /i</code> first followed by a reinstall might work, but I'd like to avoid that if possible.</p>
  
  <p>EDIT: The reason <code>/famus</code> is needed is that these are developer machines, and someone might manually update the registry or register a different set of dlls. The intention of the script is that even if there has not been any changes to the MSI, the developer can also run the script to easily revert back to "official" environment.</p>