Preventing the Substitution of Unknown Variables

InstallAnywhere 2018

If you use any of the following actions to set variables in your installation project, a Do not substitute unknown variables check box is available:

Set InstallAnywhere Variable - Multiple Variables
Set InstallAnywhere Variable - Single Variable
Execute Command
Execute Script/Batch File
Execute Target File

If your installation project includes a nested variable that could possibly contain multiple $ characters, this could result in the creation of an unknown variable. Therefore, select the Do not substitute unknown variables check box to instruct InstallAnywhere to resolve only InstallAnywhere variables that are listed in the Variables view on the Project page of the project (the known variables).

The following table provides a scenario where it would be beneficial to select this check box.

Variable Scenario

Variable

Defined As

Set To

$USER$

Defined by end user.

te$t

$PWD$

Defined by end user.

pa$sword

$COMMAND_LINE$

-u $USER$ -p $PWD$

If the Do not substitute unknown variables check box is selected, the $COMMAND_LINE$ variable is set correctly to:

-u te$t -p pa$sword

However, if the Do not substitute unknown variables check box is cleared, the text between the two $ characters is read as a variable—which does not exist—and is therefore replaced with an empty value, resulting in an invalid value:

-u tesword

See Also