Silent Installs

All installers can be run silently from the command line. You can also create installers so they only run silently through the Advanced interface of JExpress on the Install panel.

Users will not get any visual feedback during or after the installation when they run an installer silently, except under one circumstance. If any errors occur during the installation, then an errors.log will be created in the directory where the user launched the installer. Important:If the target system is Unix, the customer must still have an X Windows environment present to use the installer.

If your customers want to silently install one of your installers that usually displays a wizard, then they can add a -q switch followed by the installation directory if you don't have any custom classes which require user input. If your installer does need additional user input, then the user must create a properties file which contains all the appropriate fields, including the applicationDirectory.

For example, if your customer wants to use the Windows native installer and they want to install your app in the directory c:\newapp, then the command line would look like:

jinstall.exe -q c:\newapp

Remember you must include double quotes around the directory name if there are spaces in the name.

Passing Properties for a Silent Installation

If your installer prompts the user for answers other than the directory name, then a property file that contains all the answers for your installer needs to be created. This file must contain the AV pair for the installation directory using the property name applicationDirectory.

If the target system is Windows, then the property file must use 2 back slashes to separate the directory names (e.g., applicationDirectory=C:\\Program files\\MyApp). Regardless of the target system, the applicationDirectory property should not include double quotes ("") around the directory name, even if it contains spaces.

The user just adds the -s switch and the full pathname to the property filename to the command line. They do not need to add a -q nor the installation directory name. If the target system is Unix, the customer must still have an X Windows environment present to use the installer.

The command line might look like this if there is a property file for a Windows installation:

[product.name-platform-version].exe -s "c:\program files\temp\myapp.properties"

The command line must contain double quotes around the filename if there are spaces, regardless of the target system. If the target system is a Windows system, then the command line must contain only 1 back slash to separate directory names. In contrast, a Windows property file must contain 2 back slashes to separate directory names for the applicationDirectory property and must not contain spaces. This potential confusion is caused by Java's insistence on escaping back slashes while Windows uses back slashes as the standard path separator.

If you create a multi-type installer and the user doesn't use a property file on the command line, then the silent install uses the first install type that you specified. For example, if you created Typical and Compact install types, then a silent install would always install a Typical installation (assuming Typical was first in the list of install types). If your customers want to vary the install type, then they must create a property file as described in this section.

Custom Classes

If your installer includes any custom classes, then you must make sure that each class does not require user input when the installer runs silently. Additionally, insure that all isOk() methods in your custom classes return true when run silently.

Use the SilentInstall property to determine if the installer is being run silently.