Using InstallScript

InstallShield 2015

You can leverage the power and ease of InstallScript to extend the functionality of your installation package. The InstallScript view includes a script editor pane for you to author your InstallScript code.

Project: You must have a file named Setup.rul in your project if you are using InstallScript. InstallScript and InstallScript MSI projects contain a Setup.rul file by default. You must add a Setup.rul file in Basic MSI, DIM, and Merge Module projects if you want to use InstallScript custom actions in these types of projects.

Using Event-Driven InstallScript in InstallScript and InstallScript MSI Projects

InstallScript and InstallScript MSI projects contain an event-driven script. When you use InstallScript in these project types, many of the functions are logged for uninstallation.

Using InstallScript in Custom Actions

Basic MSI, DIM, and Merge Module Projects

In a Basic MSI, DIM, or Merge Module project, you can use custom actions to run InstallScript at run time. These project types do not support event-driven script.

InstallScript MSI Projects

In an InstallScript MSI project, you can use an InstallScript custom action to extend functionality in an execute sequence where the default event handlers are not scheduled appropriately for your installation’s needs.

Creating and Using Custom Actions

To author an InstallScript custom action and execute it in your installation:

1. Add a blank Setup.rul to your project in the InstallScript view if it does not already exist.
2. Write an entry-point function. Note that you cannot call an entry-point function in the User Interface sequence for an InstallScript MSI installation project.
3. Compile the script.
4. Create a custom action that calls your InstallScript function.
5. Invoke the InstallScript custom action by either including it in a sequence (InstallScript MSI, Basic MSI, and merge module projects) or executing it as a control event (Basic MSI and merge module projects).
6. Debug if necessary.

Note: As with other custom actions, changes made to the system through InstallScript custom actions are not automatically restored when the package is uninstalled. Because InstallScript custom actions are not logged and removed by the uninstaller, you must write a corresponding custom action to uninstall any changes that your custom action makes.

See Also