MSI Installation Context

Windows Installer can install a package on a computer within two installation contexts: per-machine and per-user. A per-machine package installation is required if all users of the computer need to access and use the application. Based on the context, Windows Installer automatically redirects the values of the folder properties and registrations to the locations for a per-user or per-machine installation. The installation context is specified when configuring the MSI Package Builder project Pic 1.

Choosing the installation context

Pic 1. Choosing the installation context

When a package is installed for a current user, it is not visible in the Programs and Features section of the control panel for other users. In most cases, the deployed content is also accessible only for the user that deployed the package, though it is not always true. To install a package per-user, you should choose the Install MSI to Current User radio button during the project configuration.

The generated MSI packages can be installed by Windows users with administrative rights. If an MSI package is installed manually, the Windows User Account Control (UAC) prompt is displayed requiring permissions elevation to complete the MSI installation. Non-administrator users have to provide administrative credentials to install MSI packages. You can avoid seeing the UAC prompt and elevating permissions for installing an MSI package if this package was generated as Install MSI to Current User with the Non-Elevated Installation option enabled.

Non-elevated installations have some restrictions. If the Non-Elevated Installation option is enabled for an installation project that violates such restrictions, this option is skipped and a regular MSI that requires permissions elevation is generated. In this case, the restriction violations are reported in the Log view.

Note that it isn't allowed to generate a non-elevated installation if the installation project contains any of the resources listed below:

Resource Type

Resource Value

File System

CommonFiles64Folder,
CommonFilesFolder,
ProgramFiles64Folder,
ProgramFilesFolder,
System16Folder,
System64Folder,
SystemFolder,
WindowsFolder,
CommonAdminToolsFolder,
CommonDesktopFolder,
CommonProgramMenuFolder,
CommonStartMenuFolder,
CommonStartupFolder,
FontsFolder,
UserProfilesFolder

Registry

HKEY_LOCAL_MACHINE,
HKEY_USERS

Environment Variables

System Environment Variables

Services

All

Assemblies

All

Printers

All

Drivers

All

Windows Firewall

All

Custom Actions

SAM Licenses

To create a package targeting a per-machine installation, you should choose the Install MSI to All Users radio button. As for the per-machine installation, there is some specifics in handing the user-specific folders and registry keys defined in the package. By default, when a per-machine installation is deployed and the package contains user-specific files and registry entries, such files and entries are created only for the user running the deployment. For other users, only the common files and registry entries are deployed. MSI Package Builder allows you to configure the package in such a way that user-specific entries will also be installed for other users on their first log-on after the package deployment. This feature is enabled by means of the Smart All Users Mode box.

For the smart per-machine installation to work correctly, the MSI package should be accessible to users logged in future via the same path as used during the initial deployment. In case the package is not available, the user-specific files and registry entries won't be created for other users.

To obtain proper deployment results, it is recommended that the default installation context be chosen carefully taking into account the specifics of each and every package.