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

ALLUSERS property

· 52CE 我爱测

The ALLUSERS property configures the installation context of the package.

The ALLUSERS property configures the installation context of the package. The Windows Installer performs a per-user installation or per-machine installation depending on the access privileges of the user, whether elevated privileges are required to install the application, the value of the ALLUSERS property, the value of the MSIINSTALLPERUSER property and the version of the operating system.

The value of the ALLUSERS property, at installation time, determines the installation context.

  • If the ALLUSERS property value is not set, the system uses the per-user installation context.

  • An ALLUSERS property value of 1 specifies the per-machine installation context.

  • The value ALLUSERS=2 enables the system to reset the value of ALLUSERS, and the installation context, dependent upon the user's privileges and the version of Windows. If the value of the ALLUSERS property is set to 2, the Windows Installer always resets the value of the ALLUSERS property to 1 and performs a per-machine installation or it resets the value of the ALLUSERS property to an empty string ("") and performs a per-user installation.

    Windows 7: Set the ALLUSERS property to 2 to use the MSIINSTALLPERUSER property to specify the installation context. Set the MSIINSTALLPERUSER property to an empty string ("") for a per-machine installation. Set the MSIINSTALLPERUSER property to 1 for a per-user installation. If the package has been written following the development guidelines described in Single Package Authoring, users having user access can install into the per-user context without having to provide UAC credentials. If the user has user access privileges, the installer performs a per-machine installation only if Admin credentials are provided to the UAC dialog box.

    Windows Vista: Set the ALLUSERS property to 2 and Windows Installer complies with User Account Control (UAC). If the user has user access privileges, and ALLUSERS=2, the installer performs a per-machine installation only if Admin credentials are provided to the UAC dialog box. If UAC is enabled and the correct Admin credentials are not provided, the installation fails with an error stating that administrator privileges are required. If UAC is disabled by the registry key, group policy, or the control panel, the UAC dialog box is not displayed and the installation fails with an error stating that administrator privileges are required.

    Windows XP: Set the ALLUSERS property to 2 and Windows Installer performs a per-user installation if the user has user access privileges.

  • If the value of the ALLUSERS property does not equal 2, the Windows Installer ignores the value of the MSIINSTALLPERUSER property.

Example

  <!-- Disallow user from installing for all users -->
    <Property Id="ALLUSERS" Secure="yes"/>
    <Condition Message="Setting the ALLUSERS property is not allowed because [ProductName] is a per-user application. Setup will now exit.">
      NOT ALLUSERS
    </Condition>

Example from Windows Classic Samples on GitHub.

Default Value

The recommended default installation context is per-user. If ALLUSERS is not set, the installer does a per-user installation. You can ensure the ALLUSERS property has not been set by setting its value to an empty string (""), ALLUSERS="".

Remarks

The installation context determines the values of the DesktopFolder, ProgramMenuFolder, StartMenuFolder, StartupFolder, TemplateFolder, AdminToolsFolder, ProgramFilesFolder, CommonFilesFolder, ProgramFiles64Folder, and CommonFiles64Folder properties. The installation context determines the parts of the registry where entries in the Registry table and RemoveRegistry table, with -1 in the Root column, are written or removed.

Requirements

Requirement Value
Version Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

See also

Properties

MSIINSTALLPERUSER

Installation Context

Single Package Authoring

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 07/27/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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