Find and Replace Dialog Box

InstallShield 2024

Project: This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI

The Find and Replace dialog box lets you search for strings in your SQL script file and replace them with different strings at run time. The Find and Replace dialog box opens when you click the Add button on the Text Replacement tab for a SQL script that is selected in the SQL Scripts view.

In Basic MSI, DIM, and InstallScript MSI projects, you can replace a string with a Windows Installer property; at run time, Windows Installer writes the value of the property in your SQL script file.

In InstallScript projects, you can use text substitution to replace a string variable with the appropriate value.

Caution:You should only replace text that is unique and will not cause script syntax errors.

The following settings are available on the Find and Replace dialog box.

Find and Replace Dialog Box Settings

Setting

Description

Find What

Enter the string that you want to replace in your SQL script at run time.

Project:In Basic MSI, DIM, and InstallScript MSI projects—You can use Windows Installer public properties to specify the replacement strings. To learn more, see Using Windows Installer Properties to Dynamically Replace Strings in SQL Scripts.

In InstallScript projects—You can use InstallScript text substitution to specify the replacement strings. To learn more, see Using InstallScript Text Substitution to Dynamically Replace Strings in SQL Scripts.

Specifying Windows Installer properties or InstallScript text substitution enables you to use data that end users enter in dialogs, or other configuration information that is determined at run time, when your product’s SQL script is modified.

Replace With

Enter the new string that should replace the existing string that is found in your SQL script at run time.

Project:In Basic MSI, DIM, and InstallScript MSI projects—You can use Windows Installer public properties to specify the replacement strings. To learn more, see Using Windows Installer Properties to Dynamically Replace Strings in SQL Scripts.

In InstallScript projects—You can use InstallScript text substitution to specify the replacement strings. To learn more, see Using InstallScript Text Substitution to Dynamically Replace Strings in SQL Scripts.

Specifying Windows Installer properties or InstallScript text substitution enables you to use data that end users enter in dialogs, or other configuration information that is determined at run time, when your product’s SQL script is modified.

Match case

This check box lets you indicate whether you want to restrict your search to strings with the same capitalization that you use in the Find What setting.

For example, if you select this check box and enter install for the Find What setting, the installation searches only for all-lowercase instances of that string. If you clear this check box, the installation searches for install, as well as INSTALL, Install, and other mixed-case instances.

Match whole word only

This check box lets you indicate whether you want to find only whole-word instances of the value that you have entered for the Find What setting.

For example, if you select this check box and enter install for the Find What setting, the installation searches only for instances of install; it does not search for other forms of the word, such as installs, installation, or uninstall.

For another example, you may have something like the following line in your SQL script:

PASSWORD = N'%PASSWORD%'

If you select this check box, enter %PASSWORD% in the Find What setting, and enter 1234 in the Replace With setting, the installation replaces the string. The resulting SQL script shows the following:

PASSWORD = N'1234'

Preserve case

This check box lets you indicate whether you want the replacement string to use the same capitalization that is used in the Find What string.

For example, if you select this check box and enter databasedir for the Find What setting and mydatabasedir for the Replace With setting, the installation replaces Databasedir with Mydatabasedir. It also replaces databasedir with mydatabasedir.

Replace once only

This check box lets you indicate whether you want the installation to replace only the first occurrence of the search string.

If you clear this check box, the installation replaces all instances of the search string.

See Also