Command Line Options For Generated Installers


Installers generated by install4j recognize the following command line parameters:

 
NameExplanation
-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 applies to Microsoft Windows only. 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 the console mode.
-q Executes the installer in the 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 installation 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.
-wait <timeout in seconds> Only valid if -q is set. In the 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 until 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.
-Dinstall4j.nolaf=true Do not set the native look and feel but use the default. In some very rare cases, the Windows look and feel with the classic theme (Windows 2000-like appearance) is broken and prevents the use of the installer or any other Java GUI application. Switching to the default Windows theme solves this problem. Alternatively, passing this parameter to the installer will prevent the native look from being set.
-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 exceptions are printed to stderr.
-Dinstall4j.keepLog=true or -Dinstall4j.alternativeLogfile=<path> install4j creates a log file prefixed i4j_log for all installations and uninstallation in your temp directory. 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 or uninstaller terminates by default. With the -Dinstall4j.keepLog=true option, the log file won't be deleted in this case. With the -Dinstall4j.alternativeLogfile=<path> the log file will be copied to the file specified with <path>. This should be an absolute path name.

Note that both options have no effect if the log file has already been copied to the installation directory.

-Dinstall4j.logToStderr=true In addition to the log file created by the installer or uninstaller, 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. Should you wish to choose a different encoding you can pass this VM parameter to the installer. Some common character set names are
  • UTF-8
  • ISO-8859-1
  • US-ASCII
  • UTF-16LE
  • UTF-16

Most JREs support a large number of char sets. You can execute java.nio.charset.Charset.availableCharsets() to check the names of supported character sets for your JRE.

-Dinstall4j.suppressStdout=true In unattended mode, status messages of actions that are displayed in the installer are printed on stdout. To suppress those 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 those 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.showProxyConfig=true If an action that downloads a file is present in the installer, show the proxy configuration dialog for the first such action before the connection is attempted. This can be useful to edit cached proxy information that is working but should be changed for testing purposes. If the connection fails, the proxy dialog will be displayed in any case regardless of this option.
-Dinstall4j.clearProxyCache=true Clear the proxy information cached by install4j. This can be useful for testing purposes. On Windows, the proxy information by the default browser may be loaded again automatically after the cache is cleared.
-Dinstall4j.noProxyAutoDetect=true Do not try to automatically detect proxy information from browser configurations.
-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 -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=false Forces the installer locale to be detected from the Display language setting set in Windows Region and Language Control Panel. If this option isn't specified, the locale will be detected from the Format setting.
-DpropertyName=value You can set further arbitrary system properties with the standard command line parameter.
-J<VM parameter> Specifies a VM parameter (e.g. -J-Xmx512m). Can be cited more than once.
-VvariableName=value You can set arbitrary installer variables with the -V parameter. The variable name should be used without prefix, so if you have a variable called ${installer:variableName} in the GUI the parameter would be -VvariableName=value. The variable will be a String object.
-varfile <fileName> Alternatively, you can specify a property file containing the variables you want to set. The variable names should be used without prefix, too, so if you have a variable called ${installer:variableName} in the GUI the entry would be variableName=value. The variables will be String objects. 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.