Execute Script/Batch File Action
InstallAnywhere 2026 R2
Execute Script/Batch File allows developers to enter the text of a script or batch file which the installer executes on the target system. When this action runs, it first resolves any InstallAnywhere variables in the script. It then saves the script to the InstallAnywhere temp directory and executes the script. The Execute Script/Batch File action finishes by cleaning up and deleting the script from the temp directory.
The Execute Script/Batch File customizer includes the following options:
|
Option |
Description |
|
Comment |
Enter a comment to describe the function of the script or batch file. |
|
Script |
Type the script you want the installer to run. Start your script with a cd <directory> command to establish the directory from which the script will run. By default, scripts and batch files are run in a temp directory. |
|
Do not substitute unknown variables |
Select this option to avoid the substitution of unknown variables for this action by instructing InstallAnywhere to only resolve InstallAnywhere variables which are listed in the project under Project > Variables (the known variables). Note:For more information, see Preventing the Substitution of Unknown Variables. |
|
Suspend installation until process completes |
Select this checkbox if you want the installer to halt until the script or batch file processes complete. |
|
Treat non-zero exit code as error |
Select this check box if you want the installer to evaluate the exit code returned by the script or batch file upon completion of its execution. If an executed script or batch file returns a non-zero exit code, the installer treats it as an action error and records it in the installation log as a non-fatal error. The installation continues, but the installation status is reported as NONFATAL_ERROR. The Treat non-zero exit code as error check box is available only when the Suspend installation until process completes check box is selected. Note:If a script or batch file execution is designed to return non-zero exit codes to indicate expected conditions rather than failures, the Treat non-zero exit code as error check box must be cleared. |
|
Show indeterminate dialog |
If you have chosen the Suspend installation until process completes option, select this option if you want the installer to display a dialog along with the message you enter in the associated text box during the execution of the script or batch file . The default message is Executing Installation Script... |
|
Store process's stdout in |
Enter the variable to store the stdout from your command. The default value is $EXECUTE_STDOUT$. |
|
Store process's stderr in |
Enter the variable to store the stderr from your command. The default value is $EXECUTE_STDERR$. |
|
Store process's exit code in |
Enter the variable to store exit codes. The default value is $EXECUTE_EXITCODE$. |