Registry Flags

InstallShield 2015

Project: Support for registry flags differs, depending on what project type you are using.

Registry flags enable you to control the installation of your registry entries.

Registry Flags in Windows Installer–Based Projects

Project: This information applies to the following project types:

Basic MSI
DIM
InstallScript MSI
Merge Module
MSI Database
MSM Database
Transform

By default, your registry entries are created on the target system if the component to which they belong is installed. They are then removed from the target system when that component is removed. If you would like your registry entries to remain on the target system even after the product has been uninstalled, or if you want to create registry entries only if they do not already exist, you need to set the installation flag for that key.

In InstallShield, installation behavior is set at the subkey level. All values beneath the key must have the same installation and uninstallation behavior.

To change the registry flag of a key, right-click one of your project’s keys in the Registry view, and then click any of the commands that are listed in the following table.

Types of Registry Flags in Windows Installer–Based Projects

Icon

Command

Description

Automatic

This is the default option for all registry keys. If the key is not already present, the installation creates it. During an uninstallation, if the key is empty, it is removed.

Install only (+)

If the key does not already exist, it is created. The key is left on the target system when the component to which this key belongs is uninstalled.

This option is available only for keys that do not contain subkeys or values.

Uninstall entire key (–)

If this flag applies to an empty key, the key is not created at installation. If this flag applies to a key that contains values and the key does not exist on the target system, the key and values are created at installation. In both cases, the key, all subkeys, and values are removed at uninstallation—even if the subkeys and values were added after the installation.

Install if absent, Uninstall if present (*)

This option is similar to the default behavior (the Automatic registry flag), with one exception. For the Automatic registry flag, if the key is not empty during uninstallation, it is not removed. For the Install if absent, Uninstall if present (*) flag, if the registry key is present during uninstallation, the key is removed, regardless of whether its subkeys or values remain.

Registry Flags in InstallScript-Based Projects

Project: This information applies to the following project types:

InstallScript
InstallScript Object

After your installation has created registry keys on the target system by installing a registry set, subkeys or values may be created under those keys by other installations or applications (or directly by the end user). You can prevent a registry key that your installation installed from being uninstalled if it has any subkeys or values that were not created by the installation. To accomplish this, you can change the registry flag of the key. To do so, right-click one of your project’s keys in the Registry view and then click the following command.

Registry Flag in InstallScript-Based Projects

Icon

Command

Description

Shared among several applications

When the component to which this key belongs is uninstalled, the key is not removed from the target system if the key has any subkeys or values. (Note that a value that was created by your installation will have already been uninstalled unless you unset its Remove during Uninstall flag.) If the key does not have any subkeys or values, the key is removed from the target system regardless of whether it was created by the installation—that is, whether it already existed at the time of installation.

You may want your uninstallation to leave some of your product’s registry values on the end user’s system—for example, registry values that are used by the operating system and are modified by your installation. To do this, right-click the key that contains the registry value that you do not want to be uninstalled. Select the Shared among several applications flag for that key. Then right-click the value of the key and ensure that the Remove during Uninstall command is not selected.

See Also