Using String Entries in InstallShield

InstallShield 2019

Project • This information applies to the following project types:

Advanced UI
Basic MSI
InstallScript
InstallScript MSI
InstallScript Object
Merge Module
Suite/Advanced UI

Note • Localization of Windows App packages requires the Windows 10 SDK be installed on the same machine as InstallShield. If it is not present, InstallShield will build a Windows App package (.appx) containing only the default language.

Instead of hard-coding strings throughout your project, you can use string entries in areas of InstallShield that accept localizable text. The manner in which you select a string entry differs depending on where you need to use it.

Settings in Various Views

When you are entering the value of a setting in one of the views in InstallShield and that value is a text string that can be presented to end users, InstallShield automatically uses a string identifier for that setting. InstallShield places the string identifier in curly brackets before the string value. Following is an example of the value for the Display Name setting of a feature:

{ID_STRING24}My New Feature

In this example, ID_STRING24 is the string identifier that is used for the Display Name setting. My New Feature is the string value for the project’s default language.

To work with a setting that accepts a localizable text string entry, do one of the following:

To enter a new text string that is not present anywhere else in the project, type the text string that you want to use. InstallShield automatically assigns a new string identifier to the value that you enter.

If your project includes support for multiple languages, InstallShield adds the new string identifier to all of your project’s languages, and uses the string value that you entered as the value for all languages.

To look at a list of existing string entries that are used in the project, click the ellipsis button (...) that is displayed on the right when you click the setting’s value. InstallShield opens the Select String dialog box, which lets you select an existing string entry or create a new string entry.

Caution • Do not confuse editing an existing string value with entering a new string identifier by entering text in an InstallShield setting. Once you have selected a string identifier for a setting, deleting the localizable text in the setting merely deletes the current string value; it does not replace the current string identifier with a new one.

Dialog Editor

Many of the controls in the Dialog Editor accept strings that are displayed to the end user. For example, the Text and Tooltip properties always require localizable text.

Using a string entry in the Dialog Editor is similar to selecting string identifiers in other areas of InstallShield.

To work with the Dialog Editor and a control’s property that uses localizable text, do one of the following:

Click the control’s property sheet and edit the string. Doing so changes the value of the string entry for the current language. When you enter a text value without first selecting a string, InstallShield creates a new string identifier for your project.

If your project includes support for multiple languages, InstallShield adds the new string identifier to all of your project’s languages, and uses the string value that you entered as the value for all languages.

When you click a localizable property’s value to edit it, an ellipsis button (...) appears inside the property sheet. Click the ellipsis button to view the string entries for the current language.

The major difference between the dialog control properties and the settings in other views in InstallShield is that the other views always display the string value for the default language. When you edit a dialog’s layout, however, you must first select the language of the dialog. Then, all strings displayed in the dialog and in the property sheet are from the current language of the dialog that you are editing.

InstallScript Script Editor Pane

If you are working in the InstallScript script editor pane in the InstallScript view, you can select and edit string entries through the Select String dialog box.

To use a string identifier in your InstallScript:

1. Place the cursor at the point in your script where you want the string identifier to be inserted.
2. On the Edit menu, point to Insert and click String Entry. The Select String dialog box opens.
3. Do one of the following:
To use an existing string entry, click the row that contains the string entry that you want to use in your script.
To create a new string entry, click the New button. The String Entry dialog box opens, enabling you to create a new string identifier and value.
4. Click OK.

InstallShield places the string identifier in your script preceded by the at (@) symbol.

For more information, see String Constant Operator (@).

Tip • Although you can include hard-coded user-interface strings directly in InstallScript code, it is recommended that you avoid doing this. Strings that are hard coded in InstallScript code are not stored as Unicode; thus, they are displayed correctly only when the installation is run on systems that have the correct code page. Adding strings to a project through the String Editor view and referencing the associated string identifiers from InstallScript code eliminates this issue.

What Happens with String Entries at Build Time and Run Time

InstallShield stores string entries in the ISString table of your InstallShield project file (.ism). At build time, InstallShield uses the string values instead of the string identifiers when it is creating your release in most cases. That is, the string identifiers are not built into the release, and the string identifiers are not available at run time.

The one exception of when InstallShield does use string identifiers in a build is if your project includes InstallScript code. In this scenario, the release that InstallShield builds includes string tables that contain all of the string entries. These string tables make it possible for you to use string identifiers in your InstallScript code instead of hard-coded text strings. At run time, the installation replaces string identifiers with string values as needed.

See Also