Command Line Options for Generated Installers

## Command Line Options for Generated Installers |

Installers generated by install4j recognize the following command line parameters:

Name | Explanation
--- | ---
-manual | This option applies to Microsoft Windows only. 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 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, a console will be allocated on Windows that displays the output of the installer.
-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.
-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) on Windows XP is broken and prevents the use of the installer or any other Java GUI application. Switching to the default XP 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. In addition, install4j prints informative messages to stdout each time an installer variable is set. To dump all installer variables to stdout, you can use `com.install4j.api.Util.dumpVariables(Context context)` independently of this system property.
-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.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.
-D`propertyName`=`value` | You can set further arbitrary system properties with the standard command line parameter.
-V`variableName`=`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.