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

Guidelines for Packages

· 52CE 我爱测

Because User Account Control (UAC) in Windows Vista restricts privileges during an installation, developers of Windows Installer packages should not assume that their installation always has access to all parts of the system.

Because User Account Control (UAC) in Windows Vista restricts privileges during an installation, developers of Windows Installer packages should not assume that their installation always has access to all parts of the system.

An installer package that can be successfully deployed to standard users via Group Policy should in most cases also work with UAC in Windows Vista. Exceptions to this can occur if the InstallUISequence table contains the LaunchConditions action or the LaunchCondition table contains a condition based on the Privileged property. Windows Installer package developers should therefore adhere to the following guidelines to ensure their package works with UAC and Windows Vista.

  • When including an installation context condition with an action in the InstallUISequence table, use a conditional statement based on the Privileged property. Do not use a condition based on the AdminUser property.
  • When including the installation context with the installation launch conditions, use a Custom Action Type 19 in the InstallExecuteSequence table and make the custom action conditional upon the Privileged property. Do not use an action in the LaunchCondition table with a condition based on the AdminUser property or Privileged property.
  • To read or modify the system configuration, use a deferred execution custom action in the InstallExecuteSequence table. Do not use immediate execution custom actions in the InstallUISequence table to modify the system configuration.
  • To modify parts of the system that are not user specific, use a deferred custom action in the InstallExecuteSequence table. You should include the msidbCustomActionTypeNoImpersonate bit in the custom action type.
  • Omit Bit 3 from the value of the Word Count Summary Property to indicate that the package can be required to be elevated. Do not include this bit unless elevated privileges are not required to install this package.
  • Include a manifest with the application's Requested Execution Level.
  • Include a certificate in the MsiPatchCertificate table of original package and sign all patches with the same certificate.
  • If elevated privileges are required to install a Windows Installer package, the author of the package should include the ElevationShield attribute for the PushButton control used to start the installation. This will alert the user that clicking on the button will display the UAC dialog box requesting administrator authorization to continue the installation.
  • Set the MSIDEPLOYMENTCOMPLIANT property to 1 to indicate to the Windows Installer that the package has been authored and tested to comply with UAC in Windows Vista. If this property is not set, the installer determines whether the package complies with UAC.

Outside of Group Policy, the following check for UAC compliance can be used on Windows XP.

To check for UAC compliance outside of Group Policy

  1. Log on to the computer as an administrator.

  2. Advertise the package for a per-machine installation:

    msiexec /jm package.msi

  3. Log off the computer.

  4. Log on to the computer as a standard user.

  5. Attempt to install the advertised package:

    msiexec /i package.msi

  6. In most cases, if the installation is successful, the package is UAC compliant.

  7. Set the MSIDEPLOYMENTCOMPLIANT property in the package to 1.

  8. Test for correct installation of the package using 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)

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

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