Environment Variable Settings

InstallShield 2018 » Environment Variables View

Project • The Environment Variables view is available in the following project types:

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

The InstallScript language includes the GetEnvVar function for retrieving the current value of an environment variable, and it enables you to create an environment variable.

By specifying environment variable settings, you indicate how you want to affect existing variables on the target system and create new variables. Each environment variable property is described below:

Environment Variable Settings

Setting

Description

Component

Select the component with which you want to associate this environment variable by using one of the following methods:

To select from a list of components that are already in your project, click the arrow.
To browse to the component that you want to use or to create a new component for the environment variable, click the ellipsis button (...).

The environment variable creation, modification, or removal takes place on the target system when the component that is associated with the environment variable is installed.

Value

Enter the path or value for this environment variable. You can use a predefined folder as part of this value—such as [INSTALLDIR]Bin.

To enter multiple paths, separate the paths with a semicolon (;).

Note • If you select Remove for the On Install setting, InstallShield clears any value entered in the Value setting, and the Value setting becomes read-only.

On Install

Indicate the action that you want to take place when the associated component is installed to the target system. Available options are:

Create—The installation creates the specified environment variable on the target system—if it does not already exist—and sets its value.
Set—In conjunction with the Placement setting, this option sets the value of an existing environment variable. If you select this option and the environment variable does not already exist on the target system, the installation creates it and then sets its value. If the environment variable exists on the target system, the installation sets its value.
Remove—The installation removes the specified environment variable from the target system.

Note • If you select Remove for the On Install setting, any value entered in the Value setting is cleared, and the Value setting becomes read-only.

Placement

Select the action that you would like to perform. Available options are:

Append—The installation appends the new value that is entered in the Value setting to the end of the existing value.
Prefix—The installation adds the new value that is entered in the Value setting to the beginning of the existing value.
Replace—The installation replaces the value of the specified environment variable with the new value that is entered in the Value setting.

Note • If you select Create for the On Install setting and the specified environment variable already exists on the target system, the Placement setting indicates how the new value should be added to the existing environment variable’s value or if it should replace the existing environment variable’s value. However, if—in this scenario—the specified environment variable does not exist on the target system, it is created and the Placement setting is ignored.

On Uninstall

Indicate whether the environment variable should be updated when the associated component is uninstalled. Available options are:

Remove—If you select Append or Prefix for the Placement setting and the environment variable value on the target system contains the specified value at uninstallation time, only that value is removed from the existing variable’s value.

If you select Replace for the Placement setting, and if either of the following conditions are true at uninstallation time, the entire environment variable is removed: the value on the target system matches the specified value, or the value on the target system is empty.

In all other cases, the environment variable and its value are left as is on the target system.

Leave—The environment variable and, if it is available, its value are left as is on the target system.

Type

Indicate whether the environment variable name refers to a system or user environment variable. Available options are:

System—The installation creates, modifies, or removes the specified system environment variable.
User—The installation creates, modifies, or removes the environment variable from the end user’s environment. The specified environment variable is available only to the end user who is logged on at the time of installation.

See Also