ISWiPathVariable Object

InstallShield 2016 » Automation Interface

Project • This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
InstallScript Object
Merge Module

ISWiPathVariable represents a path variable that is included in the current project. The path variable can be an existing one that was created from the Path Variables view in InstallShield, or one that was added by calling the AddPathVariable method.

Important • Predefined path variables cannot be modified or deleted. If you attempt to do so, exception error 3142 occurs. For more information, see Predefined Path Variables.

Members

ISWiPathVariable Object Members

Name

Type

Description

Name

Read-Write Property

Retrieves or sets the name of the path variable.

PathVarType

Read-Write Property

This enumerated integer property specifies the type of the path variable. Available values are:

epvtPreDefined (1)—Predefined path variables are variables that are set to certain standard Windows directories. These variables cannot be renamed or modified, but they can be used in your installation project to point to predefined directories.
epvtCustom (2)—Custom path variables are sometimes referred to as standard path variables or user-defined variables. These variable types are defined through InstallShield. These variables do not rely on any outside sources, such as the registry or system paths.
epvtEnvironment (4)—Environment path variables are based on the values of your system’s environment variables. You can set an environment path variable in your project to an existing environment variable on your machine.
epvtRegistry (8)—Registry path variables enable you to define your own variables based on the default value of a specified registry key. The registry key must already be present when you set a path variable to the value of the key.

TestValue

Read-Write Property

Retrieves or sets the test value of the path variable.

Value

Read-Write Property

Retrieves or sets the value of the path variable.

For Standard Path Variables

For standard variables, enter the directory to which you would like your variable to point.

Note • You can also refer to other path variables in the defined value by enclosing the referenced path variable name in angled brackets. For example, if you have a path variable called MyRoot with a value of C:\, you can refer to it in a path variable definition for another variable, such as Games. The actual path for the Games variable might be C:\Programs\GameFiles, but you can define Games as <MyRoot>\Programs\GameFiles. However, if you attempt to self-reference a path variable, the literal string is used instead. For example, defining Games as <MyRoot>\Programs\<Games> actually results in Games defined as C:\Programs\<Games>.

Value (cont.)

 

For Registry Path Variables

Enter the complete registry key, with the final “subkey” being the name of the value whose data contains the folder. For example, define MyRegVar as follows:

HKEY_LOCAL_MACHINE\SOFTWARE\TestKey\TestValue

Assume that TestKey has the following subkey and values:

[HKEY_LOCAL_MACHINE\SOFTWARE\TestKey]

@="C:\\MyPath1"

"TestValue"="C:\\MyPath2"

[HKEY_LOCAL_MACHINE\Software\TestKey\TestValue]

@="C:\\MyPath3"

Even though HKEY_LOCAL_MACHINE\SOFTWARE\TestKey has a subkey called TestValue, MyRegVar points to the value TestValue, and the current value will be C:\MyPath2. (Note, however, that if a value named TestValue does not exist, InstallShield reads the default value (C:\MyPath3) of the subkey HKEY_LOCAL_MACHINE\SOFTWARE\TestKey\TestValue.)

For Environment Path Variables

For environment path variables, enter the name of the variable as it appears on the Environment dialog box.

Applies To

ISWiProject