The ALLUSERS property signals to the Windows Installer whether it should attempt a per-machine or per-user installation. Let’s take a more detailed look at the property.
Here are the different values of the ALLUSERS property:
- If the value of ALLUSERS is 1, the Windows Installer performs a per-machine installation, and the configuration information is stored in the All Users profile.
- If the value of ALLUSERS is not set or it is an empty string (“”), the Windows Installer performs a per-user installation, and the configuration information is stored in the user’s personal profile.
- If the value of ALLUSERS is 2, the Windows Installer attemps to perform a per-machine installation on Windows Vista and later systems. On earlier systems, if the user has admin privileges, the Windows Installer attempts a per-machine installation. Otherwise, it attempts a per-user installation.
Now, the fun part. The ALLUSERS property can be set by a variety of methods. Here they are:
- The ALLUSERS property is set to 1 by default in Basic MSI and InstallScript MSI projects. So, you don’t ever have to set it to anything.
- It can be set by many types of Custom Actions, such as Set a Property and InstallScript types.
- It can be set by the Customer Information dialog.
Let’s take a look at the Customer Information dialog in a Basic MSI project. Here is what it looks like:
The dialog is already set up to set the ALLUSERS property according to the user’s selection. All you have to do is click on the Behavior node for the CustomerInformation dialog, click the RadioGroup control, click the Conditions tab, and delete the first action. The first action hides the RadioGroup control.
When you delete the action, it will become visible in the dialog, and user can make his selection, and that choice will be reflected in the value of the ALLUSERS property.