Per-User vs. Per-Machine Installations

InstallShield 2016 Express Edition

Two Windows Installer properties, along with the current user’s privileges, affect where the configuration information such as your product’s shortcuts and registry entries are stored on a target machine—to the All Users profile or the current user’s profile:

ALLUSERS determines where the configuration information is stored.
MSIINSTALLPERUSER indicates that the Windows Installer should install the package for only the current user.

The MSIINSTALLPERUSER property is available with Windows Installer 5 and on Windows 7 or Windows Server 2008 R2. Earlier versions of Windows Installer and Windows ignore this property.

ALLUSERS, MSIINSTALLPERUSER, and Windows 7 or Windows Server 2008 R2

If the ALLUSERS property is set to 2 and MSIINSTALLPERUSER is set to 1, the Windows Installer performs a per-user installation.

During a per-machine installation, the Windows Installer requires elevated privileges, and it directs files and registry entries to per-machine locations. If User Account Control (UAC) is available on the target system, a per-machine installation typically prompts for consent or credentials, depending on the access level of the user. During a per-user installation, the Windows Installer does not prompt for credentials, and it redirects files and registry entries to per-user locations.

For more information, see Single Package Authoring on the MSDN Web site.

Effects of ALLUSERS on Windows Vista and Later

Custom actions that have an in-script execution setting of deferred in system context are used to perform an action with the rights granted to the LocalSystem account on Windows, since the Windows Installer service runs in the system context. Actions not marked as deferred in system context run with user impersonation and have the rights that the user who launches the installation has.

When a per-user installation (that is, one where ALLUSERS is not set) is run, deferred-in-system-context actions run in the same context in which normal deferred or immediate custom actions run, which is with user impersonation. This can potentially cause a run-time issue with the custom action in the following circumstances:

The user who launches the Windows Installer installation is not an administrator; or the user is running the installation on Windows Vista or later, the user is part of the Administrators group, and the user does not have administrator privileges by default.
The custom action attempts to modify a resource in a per-machine location on the machine, such as a file in the Program Files folder, or a registry key or value in HKEY_LOCAL_MACHINE.

While this may not be an issue with Windows XP or earlier versions of Windows, Windows Vista and later do not give users full administrator privileges by default. Therefore, since a deferred-in-system-context action runs with user impersonation when ALLUSERS is not set, the custom action could fail.

The recommended method for preventing this behavior is to ensure that a per-machine installation is always performed by setting ALLUSERS. Per-machine installations are generally easier to manage than per-user installations.

Default Value of ALLUSERS

The ALLUSERS property is set to 1 by default. If you configure your installation so that it can be installed per user without administrative privileges, you may want to consider changing the value of the ALLUSERS property.

To configure the value of ALLUSERS:

1. In the View List under Organize Your Setup, click General Information.
2. For the ALLUSERS setting, select the appropriate value.

For information about the available options, see General Information Settings.

Default Controls on the Ready to Install and Customer Information Dialogs

Use the Show All Users Option setting to specify whether you want to give end users the option of installing your product for all users or for only the current user. This setting is displayed when you click the Dialogs explorer in the Dialogs view. Available options for the Show Per-User Option setting are:

NoInstallShield does not include the option that enables end users to specify how they want to install the product.
Yes (Only Windows 7 and Later)—If the target system has Windows 7 or Windows Server 2008 R2, InstallShield adds buttons to the Ready to Install dialog. The buttons let end users specify how they want to install the product. If elevated privileges are required, the shield icon is included on the all-users button. If an end user selects the all-users button, the ALLUSERS property is set to 2, and the MSIINSTALLPERUSER property is set to 1. If an end user selects the per-user button, the ALLUSERS property is set to 1, and the MSIINSTALLPERUSER property is not set.
Yes (All Systems)—If the target system has Windows 7 or Windows Server 2008 R2, InstallShield adds buttons to the Ready to Install dialog. The buttons let end users specify how they want to install the product. If elevated privileges are required, the shield icon is included on the all-users button. If an end user selects the all-users button, the ALLUSERS property is set to 2, and the MSIINSTALLPERUSER property is set to 1. If an end user selects the per-user button, the ALLUSERS property is set to 1, and the MSIINSTALLPERUSER property is not set.

If the target system has Windows Vista or earlier, or Windows Server 2008 or earlier, InstallShield adds radio buttons to the Customer Information dialog. The radio buttons let end users specify how they want to install the product. If an end user selects the all-users radio button and the end user has elevated privileges, the ALLUSERS property is set to 1. If an end user selects the per-user button and the end user has elevated privileges, the ALLUSERS property is set to an empty string ("").

The default value is No.

See Also