大网数据广告活动
安装更新与部署

Using Windows Installer with Restart Manager

· 52CE 我爱测

Applications that use Windows Installer 4.0 for installation and servicing on Windows Vista automatically use the Restart Manager to reduce system restarts.

Applications that use Windows Installer 4.0 for installation and servicing on Windows Vista automatically use the Restart Manager to reduce system restarts. The default behavior on Windows Vista is to shut down applications rather than shut down and restart the operating system whenever possible. In cases where a system restart is unavoidable, installers can use the Restart Manager API to schedule restarts in such a way that it minimizes the disruption of the user's work flow.

Windows Installer developers can perform the following actions to prepare their package to work with the Restart Manager.

  • Add the MsiRMFilesInUse dialog box to your package. If the MsiRMFilesInUse dialog box is present in the package, the Windows Vista user running an installation at the Full UI user interface level is given the option to automatically close and restart applications. An installation package can contain information for both the MsiRMFilesInUse dialog box and the FilesInUse dialog box . The MsiRMFilesInUse dialog box is only displayed if the package is installed with at least Windows Installer 4.0 on Windows Vista, and is otherwise ignored. Existing packages that do not have the MsiRMFilesInUse dialog box continue to function using the FilesInUse dialog box. A customization transform can be used to add an MsiRMFilesInUse dialog box to existing packages.

    End-users typically run installations at the Full UI user interface level. Basic UI or Reduced UI level installations give the user the option of using the Restart Manager to reduce system restarts even if the MsiRMFilesInUse dialog box is not present. Silent UI level installations always shut down applications and services, and on Windows Vista, always use Restart Manager.

  • Register applications for a restart using the RegisterApplicationRestart function. Restart Manager can only restart applications that have been registered for restart. Restart Manager restarts registered applications after the installation. If the installation requires a system restart, Restart Manager restarts the registered application after the system restart.

  • Specify INSTALLLOGMODE_RMFILESINUSE when enabling an external user-interface handler with the MsiSetExternalUI and MsiSetExternalUIRecord functions. Windows Installer will send a INSTALLMESSAGE_RMFILESINUSE message for external user-interface handlers that support the Restart Manager. If no registered or internal user-interface handles the INSTALLMESSAGE_RMFILESINUSE message, the installer sends a INSTALLMESSAGE_FILESINUSE message for user-interface handlers that support the FilesInUse dialog box. For more information, see Using Restart Manager with an External UI.

  • Custom actions can add resources belonging to a Restart Manager session. The custom action should be sequenced before the InstallValidate action. Custom actions can use the MsiRestartManagerSessionKey property to obtain the session key, and should call the RmJoinSession and RmEndSession functions of the Restart Manager API. Custom actions cannot remove resources belonging to a Restart Manager session. Custom actions should not attempt to shutdown or restart applications using the RmShutdown, RmGetList and RmRestart functions.

  • Package authors can base a condition in the LaunchCondition table on the MsiSystemRebootPending property to prevent the installation of their package when a system restart is pending.

  • Package authors and administrators can control the interaction of the Windows Installer and Restart Manager by using the MSIRESTARTMANAGERCONTROL, MSIDISABLERMRESTART, MSIRMSHUTDOWN properties and the DisableAutomaticApplicationShutdown policy.

  • Applications and services should follow the guidelines described in the Using Restart Manager section of the Restart Manager documentation.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。