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

Using Services Configuration

· 52CE 我爱测

Services configuration enables the Windows Installer to customize the services on a computer.

Services configuration enables the Windows Installer to customize the services on a computer. Developers can author a Windows Installer package to install, stop, start and delete services during an installation by using the ServiceControl and ServiceInstall tables and the InstallServices, StopServices and DeleteServices actions.

Beginning with packages written for Windows Installer 5.0, developers can also use the MsiConfigureServices standard action and the MsiServiceConfig table to configure the extended service customization options available with Windows 7 and Windows Server 2008 R2 and Windows Vista and Windows Server 2008. Existing installation packages written for versions of the Windows Installer that did not include the MsiServiceConfig table can be still be installed using Windows Installer 5.0. The services configuration feature of the Windows Installer cannot configure network service accounts, install shared service host (svchost) processes, or restart services stopped as part of the installation.

Windows XP and Windows Server 2003 or earlier: Not supported. The service configuration tables and standard actions are available beginning with Windows Installer 5.0 running on Windows 7 and Windows Server 2008 R2 and Windows Installer 4.5 running on Windows Vista and Windows Server 2008.

You must include the MsiConfigureServices action in the InstallExecuteSequence table to request the service configurations that you specify in the MsiServiceConfig table. The Windows Installer uses the information in the MsiServiceConfig table only when the MsiConfigureServices standard action is included in a sequence table. The MsiConfigureServices standard action also uses information in the ServiceControl and ServiceInstall tables.

To request that the system give only required privileges to a particular service, specify the service and the SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO configuration option in the MsiServiceConfig table. Remove the unneeded privileges from the service's process token. This option can be used to configure services run in the security context of the LocalSystem, LocalService, or NetworkService service user accounts.

To request that the system delay the automatic start of a service for a time after the start of all other auto-start services, specify the service and the SERVICE_CONFIG_DELAYED_AUTO_START option in the MsiServiceConfig table. The service being delayed must be installed by the current package with SERVICE_AUTO_START specified in the ServiceInstall table or the service must already be installed as an auto-start service.

To request that the system reserve a resource for the exclusive use of a particular service, specify the service, the service SID type, and the SERVICE_CONFIG_SERVICE_SID_INFO configuration option in the MsiServiceConfig table. Add the service's SID to the resource's Access Control List (ACL) for the resource.

To request that the Service Control Manager (SCM) wait after sending the SERVICE_CONTROL_PRESHUTDOWN notification to a service, do the following. Specify the service, the length of time the SCM should wait, and the SERVICE_CONFIG_PRESHUTDOWN_INFO configuration option in the MsiServiceConfig table.

To configure when the system should run actions after the failure of a service, specify the service and the SERVICE_CONFIG_FAILURE_ACTIONS_FLAG option in the MsiServiceConfig table. Add the actions to be run to the MsiServiceConfigFailureActions table.

For more about the extended service customization capabilities introduced with the Windows Vista and Windows Server 2008 operating systems, see Service Changes for Windows Vista.

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)

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

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