Conditionally Launching a SQL Script in a Windows Installer-Based Installation

InstallShield 2022

Project:This information applies to the following project types:

Basic MSI
DIM
InstallScript MSI

You may want your installation to launch a SQL script only if certain conditions are met on the target system. For example, your SQL script may require that the end user have administrator rights. If an end user does not have administrator rights, the SQL script is not launched.

To create a SQL script condition:

1. In the View List under Server Configuration, click SQL Scripts.
2. In the SQL Scripts explorer, click the script file for which you are creating the condition.
3. Click the Runtime tab.
4. In the Script Condition area, select the Specify a Conditional Statement check box.
5. Click the ellipsis button (...). The Condition Builder dialog box opens.
6. Create one or more conditions.

The SQL scripts are tied to component states. The condition that is set in the SQL Scripts view is the condition for the SQL script’s component. If the component conditions are met on the target system, the installation installs the SQL script. If the installation installs a SQL script that you did not expect to be installed on a target system, generating a log file for your installation may help you determine why the SQL script was installed.

Tip:For information on conditions and on condition syntax, see Building Conditional Statements and Conditional Statement Syntax.

See Also