install4j Help

Command Line Options For Generated Installers

Installers generated by install4j recognize the following command line parameters:

-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.

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 or download one if a JRE has been bundled dynamically. 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 -q is set. Sets a different installation directory for the unattended installation mode. The next parameter must be the desired installation directory.

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 trouble-shooting problems caused by anti-virus 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.

install4j creates a log file prefixed with i4j_log in the temporary directory when an installer application is executed. This log file can be helpful for debugging purposes. If your installer contains an "Install files" action and terminates successfully, the log file is copied to <installation dir>/.install4j/installation.log, otherwise it will be deleted after the installer application terminates.

With the -Dinstall4j.log=<path> the log file will be written to the file specified with <path> instead and will not be deleted in any case. If a relative path is specified, it will be resolved relative to the installer media file for installers and relative to the working directory for uninstallers and custom installer applications.


As an alternative to -Dinstall4j.log=<path>, you can ask the installer or the installer application to not delete the temporary log file under any circumstances.

For situations where you cannot modify the command line arguments, you can set the environment variable INSTALL4J_KEEP_LOG=true.

-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

  • UTF-8
  • UTF-16
  • ISO-8859-1

The class java.nio.charset.StandardCharsets lists the encodings that are guaranteed to be available in any JRE.

-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.

Debugging the installer application can be done by passing -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=<port> on the command line, on Windows this argument has to be prefixed with -J.

However, this will not debug the elevated helper process that is started by the "Request privileges" action. By setting the install4j.helperDebugPort VM parameter, the same -agentlib parameter is passed to the JVM of the helper process and you can then attach to it with a debugger. If you debug both the unelevated and the elevated JVM at the same time, you have to assign different ports and start two separate debugging sessions.

-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.