title: wix: How to prevent user from restarting machine during the installation or upgrading of application
body: <p>There is the possibility that machine is shutdown/reboot/logoff when an update\installation is happening which might corrupt the install. </p>
  
  <p>If we have the rollback option in place by scheduling RemoveExistingProducts afterInstallInitialize, will it resume the installation\update after machine restarts?</p>
  
  <p>If there is a way in wix such that we can prevent user from restarting and logging off during the installation\upgrade?</p>
  
  <p>How can we make the wix installer resumes its remaining work after the restart or even after abrupt shutdown (via hardware)?</p>
  
  <p><strong>Update</strong></p>
  
  <p>We have a desktop application deployed to our clients. There is a provision for our client to auto upgrade to the latest version. Our application will download the latest version of the msi and run the msiexex.exe command in the silent at background so that user would not have to do anything. All things will be done silent at the background. It was working perfectly. Now, some of our client complains that they had v2.1 earlier but it has gone now. We are thinking following possible cases:</p>
  
  <ol>
  <li><p>During the upgrade, the latest version of the MSI is downloaded and it will be invoked using the command MSIEXEC.exe at the background by the application itself. The uninstallation of the installed (existing) version is completed but installation of new version gets failed leaving both versions uninstalled from the machine.</p>
  
  <p>As per reading different forums, it appears that the rollback in wix occurs  only if there is failure in the uninstallation of the existing version.
  So, my question is:
  If there is any error during the installation of the new version, will it roll back to the existing version?</p></li>
  <li><p>Since user will never know that update of the application is going on as it will be done in silent mode, the user may restart or shutdown their machine in the meantime of upgrade. So, my initial question was: will the installation be corrupted if the machine is restarted or shut down in the middle of installation. Like you said, if all things are in transactional and are designed to recover from reboots at any time, then it is good for us. So, do you mean that we do not have to handle such case ourselves? It will be handled automatically by wix?</p></li>
  </ol>
  
  <p>So, could it be the case#1 that cause the application to be uninstalled during the upgrade? Or Could there be any other possibilities?</p>