Specifying Whether a Product Should Be Advertised If Its InstallShield Prerequisites Are Run with Elevated Privileges

InstallShield 2012 Spring

Project: This information applies to the following project types:

Basic MSI
InstallScript MSI

Depending on how it is configured, an installation that includes InstallShield prerequisites may display a User Account Control (UAC) prompt for elevated privileges on Windows Vista and later systems at several different points during the installation:

1. When the end user launches the Setup.exe file
2. When the Setup.exe file launches a setup prerequisite that requires elevated privileges
3. When the Setup.exe file launches a feature prerequisite that requires elevated privileges
4. When the Windows Installer begins the Execute sequence of the .msi package

If you select Administrator for your installation's Required Execution Level setting in the Releases view, Windows Vista and later typically display only one UAC prompt; it is displayed when the end user launches the Setup.exe file. However, if you select Invoker for this setting, Windows Vista and later may display more than one UAC prompt during the installation. For example, Windows Vista and later may display a UAC prompt for a setup prerequisite that requires elevated privileges and another UAC prompt for the Execute sequence of the .msi package. If this scenario applies to your installation, you may want to specify that your installation should advertise and then run your .msi package to help end users avoid the UAC prompt for the .msi package. If this scenario does not apply to you, it is recommended that you avoid advertising the .msi package because it would not avoid a UAC prompt.

Tip: The Require Administrative Privileges setting in the General Information view is where you specify whether the .msi package requires administrative privileges. The Behavior tab in the InstallShield Prerequisite Editor is where you specify whether a prerequisite requires administrative privileges. For more information about other InstallShield settings that may affect whether Windows Vista and later displays UAC prompts, see Minimizing the Number of User Account Control Prompts During Installation.

To specify whether your .msi package should be advertised:

1. In the View List under Media, click Releases.
2. In the Releases explorer, click the release that you would like to configure.
3. Click the Setup.exe tab.
4. For the Advertise If Prerequisites Are Elevated setting, select the appropriate option.

The available options are:

Advertise: Silent—Indicates that if setup prerequisites in the installation are successfully installed with elevated privileges, the .msi package should be advertised and run silently (without a user interface). Then the Execute sequence of the main installation does not require an additional UAC prompt for consent or credentials.
Advertise: Full UI—Indicates that if setup prerequisites in the installation are successfully installed with elevated privileges, the .msi package should be advertised and run with a full user interface. Then the Execute sequence of the main installation does not require an additional UAC prompt.
No—Indicates that the .msi package should not be advertised. When end users run the installation, one or more UAC prompts may be displayed to install the setup prerequisites. If the Execute sequence of the .msi package also requires elevation, an additional UAC prompt may be displayed before the Windows Installer begins the Execute sequence.

Important: The package must support advertisement in order for either of the advertise options to work. Advertisement is not instantaneous, and it adds extra delays to the installation. In addition, unexpected behavior may occur if the end user clicks Cancel after advertisement but before the main part of the installation has finished. For example, advertised shortcuts for your product may appear on the desktop before the main installation begins, and a confused user canceling the main installation may leave your package advertised but not fully installed. Therefore, in some cases, it may be better to leave this setting as No to allow the extra UAC prompt and avoid product advertisement.

A common goal is for an installation to display only one UAC prompt. The advertise options for the Advertise If Prerequisites Are Elevated setting facilitate this but do not guarantee it in all situations. For example, any time that an installation causes a restart, the installation process returns to limited privileges after the restart. The subsequent privilege elevation may display an additional UAC prompt, whether the elevation is required for a setup prerequisite, for a feature prerequisite, or for the .msi package. When the restart comes between the last prerequisite and the .msi package, the .msi package is not advertised. Following are some examples of different outcomes that may occur when you select one of the advertise options for this setting:

The prerequisites require elevation and install successfully on the target machine. The product is advertised and installed. The product installation does not display a UAC prompt.
One of the prerequisites in the installation may require a restart. After the restart for the prerequisite occurs, either no additional prerequisites are installed or none of the other prerequisites that are installed require elevation. Since the last prerequisite that is installed in this scenario is not a simple success of an elevated prerequisite, advertisement of the .msi package does not occur.
None of the prerequisites in the installation need to be installed because they are already present on the target machine; therefore, advertisement of the .msi package does not occur.
None of the prerequisites in the installation require elevation; therefore, advertisement of the .msi package does not occur.
Elevated prerequisites are successfully installed. However, for this situation, the package is a minor upgrade for a product that is already installed. That is, the product code in the package matches the product code of the product that is already present on the target machine. Advertisement of the .msi package does not occur. UAC prompts may or may not be displayed; it depends on whether a suitable digital certificate is included in the earlier installation and in the patch.

See Also