ISWiPathVariables Collection

InstallShield 2016 » Automation Interface

Project • This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
InstallScript Object
Merge Module

The ISWiPathVariables collection contains all of the path variables that are associated with the current project. You can add a path variable with the AddPathVariable method and delete a path variable with the DeletePathVariable method.

The following VBScript code retrieves a list of every path variable in the project and displays the path variables in a message box:

Option Explicit

  Dim pProject

  Set pProject = CreateObject ("ISWiAutoAutomation Interface Version.ISWiProject")

 

  pProject.OpenProject "C:\MySetups\ISWiPathVariables.ism", True

 

  Dim sPathVars

  Dim pPathVar

 

  For Each pPathVar In pProject.ISWiPathVariables

      sPathVars = sPathVars & pPathVar.Name & ": " & pPathVar.Value & vbNewLine

  Next

 

  WScript.Echo sPathVars

  pProject.CloseProject

The following line illustrates how to access a particular path variable:

Set pPathVar = pProject.ISWiPathVariables.Item("MyPathVar")

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

ISWiPathVariables Collection Members

Name

Type

Description

Count

Read-Only Property

Use this property to return the total number of path variables in the ISWiPathVariables collection.

Item

Read-Only Property

Provide the index number or name of the path variable to retrieve the ISWiPathVariable object.

Applies To

ISWiProject