Text Substitutions

InstallShield 2020 » InstallScript Language Reference

Project:This information applies to InstallScript projects.

Text substitution consists of associating a string with another string—for example, associating "<MYTEXTSUB>" with "My Text Sub Value"—and of replacing the former string with the latter in other strings—for example, changing "This string demonstrates text substitution <MYTEXTSUB>" to "This string demonstrates text substitution My Text Sub Value". A text-substitution association can be either global—that is, applying to the scripts of the main installation and any included objects—or local—that is, applying only to the script file in which it occurs, any script files that are included in that script by using the #include preprocessor directive, and any script files in which that script is included. A local text-substitution association that is defined in an object script applies only to that object, not to the main installation or any other objects that are included in the installation; a local text-substitution association that is defined in the main installation script applies only to the main installation, not to any objects that are included in the installation.

A text-substitution association can be embedded in another text-substitution association; for example, "<MYTEXTSUB1>" can be associated with "My Text Sub 1 Value" and "<MYTEXTSUB2>" with "Text Sub <MYTEXTSUB1> Embedded".

InstallScript includes the following functions for using text substitutions:

Text Substitutions Functions

Function

Description

TextSubGetValue

Retrieves the text-substitution string that is associated with the specified string.

TextSubParseTextSub

Locates the first text substitution in the specified string.

TextSubSetValue

Creates a text-substitution association between the specified strings.

TextSubSubstitute

Performs text substitution on the specified string variable.