Command Line Options For Generated Installers
Installers generated by install4j recognize the following command line parameters:
Name | Explanation |
---|---|
-h or -help or /? | Show help for common command line parameters. This will be shown in a message box, regardless of the default execution mode. If the GUI display fails, it will be printed on the console. |
-manual |
This option only applies to Windows. In GUI mode, the default JRE search sequence will not be performed and bundled JREs will not be used either. The installer will act as if no JRE has been found at all and display the dialog that lets you choose a JRE. If you locate a JRE, it will be used for the installed application. On Unix, you can define the environment variable INSTALL4J_JAVA_HOME_OVERRIDE instead to override the default JRE search sequence. |
-c | Executes the installer in console mode. |
-q | Executes the installer in unattended mode. |
-g | Forces the installer to be executed in GUI mode. This is only useful if the default execution mode of the installer has been configured as console mode or unattended mode. |
-console |
If the installer is executed in unattended mode and -console is passed as a second parameter,
status messages will be printed on the console from which the installer was invoked.
|
-overwrite |
Only valid if -q is set. In the unattended installation mode, the installer will not
overwrite files where the overwrite policy would require it to
ask the user. If -overwrite is set, all such files will be overwritten.
The default value for this option can be changed with the system property
-Dinstall4j.quietOverwrite=true
|
-nofilefailures |
Only valid if -q is set. In the unattended installation mode, the installer will not
fail if an error occurs during a file installation. The default value for this option can be changed with
the system property -Dinstall4j.noFileFailures=true
|
-wait <timeout in seconds> |
Only valid if -q is set. In unattended installation mode, the installer will perform the
installation immediately. On Windows, this can lead to locking errors if the installer is called by an
updater or by a launcher. If -wait is specified, the installer application will wait until all installed
launchers and installer applications (including the updater) have shut down. If this does not happen within
the specified timeout, the installer application exits with an error message.
|
-dir <directory> |
Only valid if The directory can be absolute or relative. If it is relative, it will be resolved relative to the media file. |
-splash <title> |
Only valid if -q is set. Instead of being completely quiet in unattended installation mode,
a small window with a progress bar and the specified title will be shown to inform the user about
the progress of the installer application. This is useful if you start the installer application
programmatically and do not require user input.
|
-alerts |
Only valid if -q and -splash are set. By default, in unattended mode,
no alerts are shown. This includes messages boxes, error alerts and questions. By setting this
command line parameter, alerts are enabled for unattended executions with a progress dialog.
|
-temp <directory> | Change the temporary directory for the installer application on Windows. An installer may extract a lot of files, and it also extracts executables to its temporary directory. If the default temporary directory of the system is not suitable for this purpose, you can change the directory with this parameter. The specified directory must exist and must be writable. This is useful for troubleshooting problems caused by antivirus software. |
-Dinstall4j.nolaf=true | Do not set the native look and feel but use the default. In some rare cases, the native look and feel is broken and prevents the use of the installer or any other Java GUI application. |
-Dinstall4j.debug=true | By default, install4j catches all exceptions, creates a "crash log" and informs the user about the location of that log file. This might be inconvenient when debugging an installer, so this system property switches off the default mechanism and lets exceptions be printed to stderr. |
-Dinstall4j.log=<path> |
install4j creates a log file prefixed with
With the |
-Dinstall4j.keepLog=true |
As an alternative to
For situations where you cannot modify the command line arguments, you can set the environment variable
|
-Dinstall4j.logTimestamps=true | If set, each message in the log file is prepended with a time stamp. |
-Dinstall4j.logToStderr=true | In addition to the log file created by the installer application, you can duplicate all log messages to stderr with this argument. |
-Dinstall4j.logEncoding=<character set name> |
By default, the installer will write the log file in the default encoding of the system where the installer is running. If you wish to choose a different encoding, you can pass this VM parameter to the installer. Some common character set names are
The class |
-Dinstall4j.suppressStdout=true | In unattended mode, status messages of actions that are displayed in the installer are printed on stdout. To suppress these messages, you can set this VM parameter. |
-Dinstall4j.detailStdout=true | In unattended mode, detailed messages regarding file installations are not printed on stdout. To enable these messages, you can set this VM parameter. |
-Dinstall4j.suppressUnattendedReboot=true | In unattended mode, a reboot may be undesirable. To prevent reboots, you can set this VM parameter. |
-Dinstall4j.language=<ISO code> | Overrides the language selection for a multi-language installer. The language selection dialog will not be displayed in this case, unless the specified language is not included in the installer. |
-Dinstall4j.helperDebugPort=<port> |
Debugging the installer application can be done by passing
However, this will not debug the elevated helper process started by the "Request privileges" action.
By setting the |
-Dsun.locale.formatasdefault=true | Forces the installer locale to be detected from the "Format" language setting and not from the "Display language" setting in the Windows "Region and Language" control panel. |
-J<VM parameter> |
Specifies a VM parameter, for example -J-Xmx512m . Can be specified more than once.
|
-DpropertyName =value |
You can set further arbitrary system properties with standard command line parameters. There is no need to
prefix them with -J on Windows.
|
-VvariableName =value |
You can set arbitrary installer variables with the -V parameter. If you pass
-VvariableName=value , you can use the variable value by inserting
${installer:variableName} in text fields in the install4j IDE.
The variable value will be a java.lang.String object.
|
-varfile <fileName> |
Instead of repeatedly using the >-V command-line option, you can specify a property
file containing the variables you want to set. This option shares the same mechanism with
response files.
|
On macOS, you can use the INSTALL4J_ARGUMENTS environment variable to pass arguments to the installer.
On Unix, the environment variable INSTALL4J_TEMP determines the base directory for self-extraction. If the environment variable is not set, the parent directory of the installer media file is used.