Run Script attributes (MSI)

Reference information
Project page Action Sequences, Dialogs and Billboards
Related topics Working with attribute panes
External links External link Windows Installer documentation

Introduction

A Run Script action executes a JavaScript or VBScript script. It may execute an entire script or call a specific function within a script; see Entry point below. In the latter case, the function must return one of the following values:

Return value Meaning
0 Action was not executed.
IDOK (1) Action completed successfully.
IDCANCEL (2) Action was cancelled by the user.
IDABORT (3) Action failed.
IDRETRY (4) Action suspended, resume later.
IDIGNORE (5) Action succeeded, but skip remaining actions.

Note: This action combines the functionality of MSI custom actions #5, #6, #21, #22, #37, #38, #53, and #54.

Tarma note Tarma Installer does not have a direct equivalent for this action, but you can execute scripts with a Run Program action that has the script file as its Target path and its ShellExecute option checked.

Attributes

This pane contains the following attributes and options.

Attribute Description
Name

Enter the name of the action. This name must be unique among all actions in the same action sequence and must not be the name of a standard action or dialog box.

Description Enter the localizable description of the action. This description is displayed in progress messages in the installer while the action is executing.
Stored file

Select this option and enter the path to the script file that must be stored in the current package for subsequent execution, or click ... (browse) to open a standard Open dialog box that allows you to browse for the desired script file. (This option corresponds to MSI custom actions #5 and #6.)

Install file

Select this option and enter the (symbolic) path to the installation file that must be executed, or click ... (browse) to open the Select Installation File or Folder dialog box that allows you to browse for the desired file. (This option corresponds to MSI custom actions #21 and #22.)

Property

Select this option and enter the name of the property that contains the script to run, or click ... (browse) to open the Select Product Variable dialog box that allows you to select the desired property. (This option corresponds to MSI custom actions #53 and #54.)

Literal script
Entry point

Select this option and enter the script text to execute. (This option corresponds to MSI custom actions #37 and #38.)

If this option is not selected, it specifies the name of the script function to call. This name is optional; you may leave this field empty if you want to execute an entire script.

Condition

Enter the conditional expression that determines if the action will be executed, or leave empty for unconditional execution.

Note: Windows Installer does not accept the Tarma-specific extended syntax in conditional expressions. In particular, you can not use the symbolic execution context <...> to refer to variables, registry values, INI file values, or to perform runtime functions.

Run

Select the action's scheduling option from the drop-down list:

  • Always - Action is executed in each action sequence in which it appears.
  • Once - Action is executed only in the first action sequence in which it appears.
  • Once per process - Action is executed only in the first action sequence in which it appears, if the action sequences run in the same process.
  • If UI has run - Action is executed only if a user interface action sequence has already been run.
Execution

Select the action's in-script scheduling option from the drop-down list:

  • Immediate - Execute immediately
  • Deferred - Queue for execution in the installation script
  • Rollback - Queue for execution during a rollback of the installation script
  • Commit - Queue for execution during a committal of the installation script
  • Deferred, System - As Deferred, but runs in system context
  • Rollback, System - As Rollback, but runs in system context
  • Commit, System - As Commit, but runs in system context
  • Deferred, TS-aware - As Deferred, but runs with user impersonation on Terminal Server systems
  • Rollback, TS-aware - As Rollback, but runs with user impersonation on Terminal Server systems
  • Commit, TS-aware - As Commit, but runs with user impersonation on Terminal Server systems
Language

Select the scripting language from the drop-down list:

  • JScript - Execute the script as JScript
  • VBScript - Execute the script as VBScript
Asynchronous Check this box to run the script asynchronously; clear it for synchronous execution. With synchronous execution, the installer waits for the script to complete before continuing with the next action; with asynchronous execution the installer immediately continues with the next action.
Ignore return value

Check this box to ignore the script's return value; clear it to respond to its return value. In particular, if the script returns an error return value (see above) and this option is cleared, the action will fail. This only applies when you specify an function name in the Entry point attribute.