How do I schedule an install to happen on the next

2019-05-10 23:50发布

问题:

We have an MSI installer (created using Wix) which is setup to be able to perform upgrades. Our clients are using it to upgrade our application on multiple machines at once using an SMS package running msiexec in silent mode.

The problem with this is that some of their users will still be running our application at the time the installer is run. We don't want to kick these users off, and running the install while they are using the app invariably breaks things.

Our ideal solution would be for the install to be scheduled to happen the next time the machine boots up.

This is a fairly hefty list of requirements, but does anyone know how I could achieve this or where I might look next?

回答1:

You could add a value to the registry under HKLM\software\microsoft\windows\currentversion\RunOnce and it will run the next time a user logs on.



回答2:

Windows Installer automatically detects files in use. Also, during a silent installation it handles them automatically:

  • files which are not in use are overwritten
  • files in use are scheduled for update after a reboot

As you can see, this is somewhat problematic because some files are updated and some file are not.

A good solution is to set REBOOTPROMPT property to "S". This way the target machine is automatically rebooted after install.

Unfortunately MSI packages cannot detect running processes, stop the install and schedule it at the next reboot. This could be done only with a custom EXE bootstrapper.