1

I am using msiexec.exe to install an MSI with the /passive option, to discourage cancellation.

The problem is that if Windows Installer detects a system reboot is necessary, the reboot happens immediately after the installation finishes, and this interrupts the user's work.

I could use /norestart to avoid the interruption.

But, is there a way to enforce such a restart with a delay first? Something like /forcerestarteventually?

In an NSIS installer I just invoke the Windows shutdown.exe utility. I suppose using /norestart and SystemRebootPending in a custom action, is one possibility.

Are there any gotchas with that approach, or is there something much easier?

Developing the MSI with WIX, for XP / Win7 - fairly easy on Windows Installer version requirements.

1 Answer 1

1

There is no 'force-restart-eventually' option. However, the Restart Manager API can eliminate or reduce the number of system restarts that are required to complete an installation or update. Custom Windows installers can be designed to call the Restart Manager API to shut down and restart applications and services directly to avoid requiring a system restart. In cases where a system restart is unavoidable, installers can use the InitiateShutdown or ExitWindowsEx function to schedule it in such a way that it minimizes the disruption to the user. See the main Restart Manager documentation but also see the Using Windows Installer with Restart Manager section in the Windows installer documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.