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

MSIINSTALLPERUSER property

· 52CE 我爱测

The MSIINSTALLPERUSER and the ALLUSERS properties can be set by the user at installation time, through the user interface or on a command line, to request that the Windows Installer install a dual-purpose package for the current user or all users of the computer.

The MSIINSTALLPERUSER and the ALLUSERS properties can be set by the user at installation time, through the user interface or on a command line, to request that the Windows Installer install a dual-purpose package for the current user or all users of the computer. To use the MSIINSTALLPERUSER property, the value of the ALLUSERS property must be 2 and the package has to have been authored to be capable of installation into either the per-user or a per-machine context. For information about authoring a dual-purpose package, see Single Package Authoring. If the value of the ALLUSERS property does not equal 2, the value of the MSIINSTALLPERUSER property is ignored and has no effect on the installation. The value of MSIINSTALLPERUSER property is ignored when installing the package using Windows Installer 4.5 or earlier.

To request that the Windows Installer install the dual-purpose package in the per-machine installation context, the user can set the value of the MSIINSTALLPERUSER property to an empty string ("") and the value of the ALLUSERS property to 2 using an authored user interface or a command line.

To request that the Windows Installer install the dual-purpose package in the per-user installation context, the user can set the value of the MSIINSTALLPERUSER property to 1 and the value of the ALLUSERS property to 2 using an authored user interface or a command line.

If the value of the ALLUSERS property does not equal 2, the Windows Installer ignores the value of the MSIINSTALLPERUSER property. If Windows Installer installs the application in the per-machine context, it resets the value of the ALLUSERS property to 1. If Windows Installer installs the application in the per-user context, it resets the value of the ALLUSERS property to an empty string (""). Applications that have been installed per-user therefore receive all updates or repairs on a per-user basis and applications installed per-machine receive updates or repairs on a per-machine basis.

Windows Installer 4.5 or earlier: The MSIINSTALLPERUSER property is ignored by versions earlier than Windows Installer 5.0.

Default Value

The recommended default installation context is per-user for a dual-purpose package. Author MSIINSTALLPERUSER=1 and ALLUSERS=2 in the Property table of the dual-purpose package to specify per-user as the default installation context.

Remarks

You can ensure the MSIINSTALLPERUSER property has not been set by setting its value to an empty string (""), MSIINSTALLPERUSER="".

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. For information about the installation context, see Installation Context.

Requirements

Requirement Value
Version Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. 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

ALLUSERS

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

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

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