Using Command-Line Arguments with Installers and Uninstallers
InstallAnywhere 2026 R1
InstallAnywhere-generated installers and uninstallers can be run with command-line arguments that can dictate, alter, or override the function of the installer and uninstaller.
| • | Setting the Interface Mode |
| • | Setting the Installer Locale |
| • | Generating a Response File |
| • | Using a Response File or installer.properties File |
| • | Setting Custom Variables |
| • | Setting JVM Heap Size |
| • | Showing Installer Help |
| • | Setting the Temp Directory |
| • | Manage the JVM Secure Folder Validation |
To set the interface mode from the command line, perform the following steps:
To set the interface mode from the command line:
At the command line, enter <installer_name/uninstaller_name> -i <mode>
For example, to use a specific interface mode with an installer or an uninstaller, use a command such as one of the following:
|
Interface mode |
Installer |
Uninstaller |
|
gui |
install.exe -i gui |
uninstall.exe -i gui |
|
console |
install.exe -i console |
uninstall.exe -i console |
|
silent |
install.exe -i silent |
uninstall.exe -i silent |
Note:Using -i command-line switch without an argument (interface mode) or with an invalid argument (interface mode) for launching the Installer, results to display a usage message including the appropriate available options on console.
To set the installer locale from the command line, perform the following steps:
To set the installer locale from the command line:
At the command line, enter <installer_name> -l <language_code>[_OPTIONAL_COUNTRY_CODE]
For example, to run the installer with the Simplified Chinese locale:
install.exe -l zh_CN
Note:Uninstaller does not support the command-line argument for setting locale and will always run with locale set for installer.
To generate a response file from the command line, perform the following steps:
To generate a response file from the command line:
At the command line, enter <installer_name/uninstaller_name> -r "path_and_file_name"
For example, to create a response file for the installer and uninstaller, you could enter the following at the command line:
install.exe -r "C:\Users\James\myresponse.properties"
uninstall.exe -r "C:\Users\James\myresponse.properties"
Note:Consider the following to create a response file for the installer and uninstaller using the command-line switch:
| • | For the installer if you do not specify a path and file name for the response file in the command line, the file will be named installer.properties or [installername].properties and it will be created in the same directory as the installer. |
| • | For the uninstaller if you do not specify a path or a file name for the response file at the command line, the response file will not be created. Both a path and a file name should be specified for the response file creation. |
Tip:Be aware that non-standard properties file names require a more complicated call to be used later. This is because any properties file or response file that uses either the default name (installer.properties) or the installer name ([installer_name].properties) can be automatically used by an installer when the installer and the properties file are in the same directory. When you use a non-standard name, you must reference the properties file (using a -f argument), specifically, when you run the installer.
Using a Response File or installer.properties File
To use a response file or installer.properties file from the command line, perform the following steps:
To use a response file or installer.properties file from the command line:
At the command line, enter <installer_name> -f "path_and_file_name"
For example, to use property settings from a file named installer.properties stored in John’s Desktop directory, enter the following:
install.exe -f "C:\Users\John\Desktop\installer.properties"
Note:Uninstaller does not support the command-line argument for using a response file or installer.properties file.
To set custom variables from the command line, perform the following steps:
To set custom variables from the command line:
At the command line, enter <installer_name> -D<myvar=myvalue>
For example, to set a new value for the install directory ($USER_INSTALL_DIR$), use a command such as one of the following ones:
|
Platform |
Command |
|
Linux |
install.bin -DUSER_INSTALL_DIR="/home/jane/InstallationDirectory" |
|
OS or OS X |
install.bin -DUSER_INSTALL_DIR="/Users/jane/InstallationDirectory" |
|
Windows |
install.exe -DUSER_INSTALL_DIR="C:\Users\jane\Desktop\MyDirectory" |
Note:Uninstaller does not support the command-line argument for setting custom variables.
To set JVM heap size from the command line, perform the following steps:
To set JVM heap size from the command line:
| 1. | To set the initial JVM heap size, at the command line, enter: |
<installer_name> -jvmxms <size>
| 2. | To set the maximum JVM heap size, at the command line, enter: |
<installer_name> -jvmxmx <size>
The default size for these values is measured in bytes. Append the letter k or K to the value to indicate kilobytes, m or M to indicate megabytes, and g or G to indicate gigabytes. For example, to set the maximum JVM heap size to 25 megabytes, enter the following:
install.exe -jvmxmx 25m
Note:Uninstaller does not support the command-line argument for setting JVM heap size.
To show installer help from the command line, perform the following steps:
To show installer help from the command line:
At the command line, enter <installer_name> -?
For example
install.exe -?
Note:Uninstaller does not support the command-line argument for showing uninstaller help.
To set the temp directory path from the command line, perform the following steps:
To set the temp directory from the command line:
At the command line, enter <installer_name/uninstaller_name> -tempdir "Path"
You can set the required temp directory path by using the -tempdir argument with the installer or uninstaller name as shown above. For instance, to set the temp directory path to C:\ExampleTemp for the installer, where the InstallAnywhere launchers are required to be extracted, you could enter the following at the command line:
install.exe -tempdir "C:\ExampleTemp"
Note:If the specified directory path is not accessible or is not a valid path, then the default temp directory path will be utilized by the InstallAnywhere installer/uninstaller.
Manage the JVM Secure Folder Validation
To enable or disable the validation of the Java Virtual Machine (JVM) secure folder during installation or uninstallation from the command line, perform the following steps:
To enable or disable JVM secure folder validation from the command line
At the command line, enter <installer/uninstaller_name> -Djvm.securefolder.check=<option>
where <option>:
| • | true—Enables Java Virtual Machine (JVM) secure folder validation, allowing the InstallAnywhere launcher at runtime to verify whether the JVM is located in a secure or administrative folder. By default, this validation is enabled on the Windows platform when running the installer or uninstaller with administrative privileges. |
| • | false—Disables Java Virtual Machine (JVM) secure folder validation, allowing the installer or uninstaller to proceed with installation or uninstallation, respectively, even if the Java Virtual Machine is located in an unsecured folder. |
When this validation is enabled, the launcher allows the installer or uninstaller to run only if the JVM is located in a secure or administrative folder. JVMs found in unsecured folders are blocked, and the launcher terminates execution with a security-related error message before the installer or uninstaller starts.
For example, to disable Java Virtual Machine (JVM) secure folder validation during installation, you can enter the following at the command line:
install.exe -Djvm.securefolder.check=false
See Also