The Run Script action runs one of the following script types:
This allows you to execute a series of external programs as a single action.
The Run Script action writes the script that you specify to a temporary file, then uses the appropriate program on the target system to execute the script. For Windows 95, 98, and Me, the default command processor for batch commands is COMMAND.COM; for Windows NT4, 2000, XP, and later it is CMD.EXE. However, if the user has an alternate command processor installed, for example 4DOS or 4NT from JP Software, it will be used instead. For VBScript and JScript scripts, WSCRIPT.EXE will be used.
Note: Because of the script processor requirements, the script file contents are always encoded as ANSI text, using the current ANSI code page of the target system. You should bear this in mind when you specify the commands and their arguments. Don't use characters that might not be available in the current ANSI character set on the target system.
This pane contains the following attributes and options.
| Attribute | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Action name | Enter the name of the action. This name is only used in Tarma Installer and is not visible to the user. | ||||||||||
| Description | Enter the localizable description of the action. This description is displayed in progress messages in the installer while the action is executing. | ||||||||||
| Commands | Enter the commands that you want to execute in the script file. The command syntax depends on the script type; see Script below. For MS-DOS batch files, you can use internal command processor commands such as COPY and DEL, or any external commands. Please be aware that the internal command options may differ somewhat between COMMAND.COM and CMD.EXE, so either use options that are available on all platforms, or create separate Run Script actions with Platforms settings (below) for Windows 95/98/Me in one, and Windows NT4/2000/XP/2003/Vista/2008 and later in the other. Tip: If you want to use input or output redirection (<, >, or >>), be sure to place spaces on both sides of the redirection character to prevent Tarma Installer from interpreting them as symbolic variable references. Alternatively, surround them by `backticks`; this is also useful in VBScript and JScript expressions that use the <> character sequence: encoding this as `<>` prevents the installer from interpreting the brackets as an empty symbol reference. The backticks are removed before the script is passed to the script processor. |
||||||||||
| Start in | Enter folder path from which the script must be run, or click ... (browse) to open the Select Installation Folder dialog box that allows you to select a folder. |
||||||||||
| Prompt | Check this box and enter the localizable prompt text to have Tarma Installer prompt the user before the action is run; clear it to run the action without prompting. If you use this option, then the prompt is displayed in a dialog box with (localized versions of) Yes and No buttons. The action is executed if the user clicks Yes and skipped if No is clicked. You should phrase your prompt accordingly. |
||||||||||
| Condition | Enter the conditional expression that determines if the action will be executed, or leave empty for unconditional execution. |
||||||||||
| Platforms... | Click this button to open the Select Installation Platforms dialog box that allows you to select the Windows versions on which the action must be executed. This platform selection acts as an additional condition for the action. |
||||||||||
| Disabled | Check this box to disable the action. A disabled action is not included in the installer and not checked during the build. You can use this option to remove actions temporarily from your installer without permanently deleting them. Disabled actions are shown with a grayed-out icon. | ||||||||||
| Script | Select the desired script type from the drop-down list. The following choices are available:
|
||||||||||
| Execute | Select the action's execution mode from the drop-down list. The following choices are available:
|
||||||||||
| Show | Select the desired visibility of the script process from the drop-down list. The following choices are available:
Note: This option only has effect on the script processor's own windows; it does not affect any secondary programs that are started by the script. |
||||||||||
| Process 2 | Enter the name of a secondary process to wait for, or leave empty to wait only for the script processor. This option only has effect if Time out is checked. It is useful if the script starts a secondary program and the script processor itself does not wait for those programs to terminate (this is the case with batch commands, for example; they only wait for the GUI program to start its message loop and process the initial messages, unless you use the start /wait command). |
||||||||||
| Time out | Check this box and enter the time-out period in seconds to execute the action synchronously; clear it to execute the action asynchronously. If the action is executed synchronously, the installer will wait for it to complete; for an asynchronous action, the installer starts the action and then immediately continues. Note: If the time-out period expires before the script processor terminates, the installer continues with its next action. However, the script processor itself is not terminated; it will remain active in the background until it terminates of itself or is forcefully terminated by the user or the system. |
||||||||||
| Not silent | Check this box to skip the action if the installer is running in silent mode (/q command line option; TsuQuiet > 0); clear it to run the action in all modes. |
For synchronous actions (see Time out above), the installer stores the script processor's exit code in the LastExitCode variable; you can use this variable in the conditions of subsequent actions. The exit code is one of the following:
For asynchronous actions, LastExitCode is set to 0 if the script processor was started successfully, or to a nonzero Windows error code if an error occurred while starting the process.
Note: LastExitCode is overwritten by the next action that runs an external program (including Run Script, Run DLL, Run Program, and Uninstall Product).