SFX options: Setup


This dialog is a part of the "Advanced SFX options" dialog and includes the following settings:

Setup program/Run after extraction

SFX will try to execute the specified program after successful extraction. The folder containing extracted files is set as the current before executing the program. If a program name contains spaces, it must be enclosed in quotes.

It is allowed to specify several setup programs here, one program per line. If you do not want to start all setup programs simultaneously, set "Wait and return exit code" option.

Read notes to Setup topic for some additional details.

Corresponding SFX script command - Setup

Setup program/Run before extraction

SFX will try to execute the specified program before starting extraction, so this program must already exist on disk. The destination folder is set as the current before executing the program. If a program name contains spaces, it must be enclosed in quotes. You may use this command, for example, to remove a previous version of program, when installing a new version over the old one.

It is allowed to specify several programs here, one program per line. SFX waits for termination of every such program before starting next program or continuing with extraction.

Corresponding SFX script command - Presetup

Setup program/Wait and return exit code

If this option is on, SFX waits for termination of every setup program specified to start after extraction and returns the exit code of such program as the exit code of SFX executable. If SFX failed to run a setup program because of some error, it returns its own error codes, which are the same as WinRAR exit codes. Returned values are adjusted according to "Exit code adjustment" parameter.

Setup program/Exit code adjustment

Since a setup program and SFX module can use same exit code values to define various events, "Exit code adjustment" parameter allows to map codes to different areas. If it contains a positive integer, it is added to setup program codes while returning SFX own codes as is. For negative integer its absolute value is added to SFX own codes while returning setup program codes as is. Use 0 to return both setup and SFX codes as is.

You can read SetupCode topic for additional details.

Corresponding SFX script command - SetupCode