Using Restart Manager

The following sections describe using the Restart Manager API. Your applications and services should also follow the Guidelines for Applications and Services.

Using the Microsoft Windows Installer

The Microsoft Windows Installer Version 4.0 is the application installation service of Windows Vista or Windows Server 2008. Applications that use the Windows Installer version 4.0 for installation and servicing automatically use the Restart Manager to reduce system restarts. Custom installers can also 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. Interactive Windows Installer packages should implement a user interface that includes a MsiRMFilesInUse dialog box. For more information, see Using Windows Installer with Restart Manager in the Windows Installer SDK documentation.

Using the Restart Manager API with Custom Installers

Custom installers, or a Windows Installer package that contains custom actions that cause a system restart, can use the Restart Manager API to shut down and restart applications and services.

  • All operations that are performed using the Restart Manager API must be associated with a session. A maximum of 64 Restart Manager sessions per user session can be open on the system at the same time. The primary installer starts and ends the Restart Manager session. For more information about using Restart Manager with a single installer, see Using Restart Manager with a Primary Installer.
  • If necessary for the installation, one or more secondary installers can be joined to the Restart Manager session and can run either in-process or out-of-process of the primary installer. Secondary installers require that the session key be provided by the primary installer to join a session. For more information and an example of using secondary installers, see Using Restart Manager with a Secondary Installer.
  • Interactive installers should implement a user interface that includes an MsiRMFilesInUse dialog box that can ask users to close applications and services. For more information, see Using Windows Installer with Restart Manager in the Windows Installer SDK documentation.
  • Installers can call the Restart Manager API to change, cancel, and get the status of the current Restart Manager operation. For more information, see the following topics: Getting the Status of a Restart Manager Operation and Canceling the Current Restart Manager Operation.
  • Installers should not disable file system redirection before calling the Restart Manager API. Some 32-bit installers run on 64-bit Windows may be unable to register a file in the %windir%\system32 directory.