install4j HelpDownload

Install4j Command Line Compiler


install4j's command line compiler install4jc[.exe] can be found in the bin directory of your install4j installation. It operates on project files with extension .install4j that have been produced with the install4j IDE. (install4j[.exe]). The install4j command line compiler is invoked as follows:

install4jc [OPTIONS] [config file]

A quick help for all options is printed to the terminal when invoking

install4jc --help

In order to facilitate usage of install4jc with automated build processes, the destination directory for the media files and the application version can be overridden with command-line options. Furthermore, you can achieve internationalization and powerful customizations with compiler variables. As a last resort, since the file format of install4j's config files is xml-based, you can achieve arbitrary customizations by replacing tokens or by applying XSLT stylesheets to the config file.

Options for the install4j command line compiler

The command line compiler has the following options:

  • -h or --help

    Displays a quick help for all available options.
  • -V or --version

    Displays the version of install4j in the following format:
    install4j version X.Y, built on YYYY-MM-DD
  • -v or --verbose

    Enables verbose mode. In verbose mode, install4j prints out information about internal processes. If you experience problems with install4j, make sure to include the verbose terminal output with your bug report.
  • -q or --quiet

    Enables quiet mode. In quiet mode, no terminal output short of a fatal error will be printed.
  • -t or --test

    Enables test mode. In test mode, no media files will be generated in the media file directory.
  • -i or --incremental

    Enables incremental test execution. A test installer for the current platform is updated with the latest screens, actions and form components and executed immediately. Because the files are taken from a previously built media file, the compilation is very fast.
  • -g or --debug

    Create additional debug installers for each media file. For each built media file, a directory named like the media file will be created in the media file output directory.
  • -p or --preserve

    Do not delete the temporary directory that the compiler uses for staging all files and launchers.
  • -w or --fail-on-warning

    If a warning is printed and this option is specified, the build will fail at the end. It does not fail immediately, so you can see all warnings and fix them all at once. The exit code in this case is 2 instead of 1 for an actual error and 0 for a successful execution.
  • -n or --faster

    Disable LZMA and Pack200 compression. If you have enabled LZMA or Pack200 compression on the "General Settings->Media File Options" step, this allows you to create development builds much faster, since LZMA and Pack200 are expensive compression algorithms.
  • -u or --disable-signing

    Disable code signing. If you have configured code signing, this allows you to skip code signing for a build. In that case you do not have to enter the passwords for the key stores.
  • -j or --disable-bundling

    Disable JRE bundling. If you have configured JRE bundles for any media files, those bundles will not be used and the installer will be built without a contained JRE. This speeds up the build and the installation.
  • --win-keystore-password=<password>

    Set the Windows keystore password for the private key that is configured for code signing. If code signing is enabled for Windows media files and this option is not set, the command line compiler will prompt you for the password.
  • --mac-keystore-password=<password>

    Set the macOS keystore password for the private key that is configured for code signing. If code signing is enabled for macOS media files and this option is not set, the command line compiler will prompt you for the password.
  • --disable-notarization

    Disable notarization of macOS media files. If you have enabled notarization for code signing , this option allows you to skip notarization.
  • -L or --license=<key>

    Update the license key on the command line and exit. This is useful if you have installed install4j on a headless system and cannot start the GUI. <key> must be replaced with your license key. If you use floating licenses, replace <key> with FLOAT:server where "server" is the host name or IP address where the floating license server is installed. For floating licenses, you can choose the requested edition by passing --windows-edition or --multi-platform-edition.

    The config file that contains the license key has a platform-specific location:

    • Windows: %LOCALAPPDATA%\install4j\v<version>\config.xml
    • macOS: ~/Library/Application Support/install4j/v<version>/config.xml
    • Linux/Unix: .config/install4j/v<version>/config.xml, the root directory may be modified by the environment variable XDG_CONFIG_HOME

    Note that you can also set the environment variable INSTALL4J_LICENSE_KEY to set the license key just for the current invocation.

  • -r <string> or --release=<string>

    Override the application version defined in the "General Settings->Application Info" step. <string> must be replaced with the actual version number. Version number components can be alphanumeric and should be separated by dots, dashes or underscores.
  • -d <string> or --destination=<string>

    Override the output directory for the generated media files. <string> must be replaced with the actual directory. If the directory contains spaces, you must enclose <string> in quotation marks.
  • -s or --build-selected

    Only build the media files which have been selected in the install4j IDE. By default, all media files are built regardless of the selection in the "Build" step.
  • -b <list> or --build-ids=<list>

    Only build the media files with the specified IDs. <list> must be replaced with a comma separated list of numeric IDs. The IDs for media files can be shown in the install4j IDE by choosing Project→Show IDs from the main menu. Examples would be:
    -b 2,5,9
    --build-ids=2,5,9
  • -m or --media-types=<type>[,<type>]...

    Only build media files of the specified type. <type> must be replaced with a media file type recognized by install4j. To see the list of supported media types, execute
    install4jc --list-media-types
    . Examples would be:
    -m win32,macos,macosFolder
    --media-types=win32,macos,macosFolder
  • -D <name>=<value>[,<name>=<value>]...

    Override a compiler variable with a different value. You can override multiple variables by specifying a comma separated list of name value pairs. <name> must be the name of a variable that has been defined on the "General Settings->Compiler Variables" step. The value can be empty.

    To override the platform-specific value for a variable add the prefix windows:, macos: or unix: before the variable name. To override a variable for a specific media file definition, you can add the prefix ID: to specify the ID of the media file. The IDs for media files can be shown in the install4j IDE by choosing Project→Show IDs from the main menu.

    Examples would be:
    -D MYVARIABLE=15,OTHERVARIABLE=
    -D windows:MYVARIABLE=winValue,macos:MYVARIABLE=macValue
    "-D MYVARIABLE=15,OTHERVARIABLE=test,8:MEDIASETTITLE=my title"

    A special system variable that you can override from the command line is sys.languageId. sys.languageId must be set to the ISO code of the language displayed in the language selection dialog and determines the principal installer language for the project or the media file.

  • -f <file> or --var-file=<file>

    Load variable definitions from a file. This option can be used together with the -D option, which takes precedence if a variable occurs twice. The file can contain
    • variable definitions

      One variable definition per line of the form NAME=VALUE.
    • blank lines

      blank lines will be ignored.
    • comments

      lines that start with # will be ignored.

    The file is assumed to be encoded in the UTF-8 format. Should you require a different encoding you can prefix the filename with CHARSET:, where CHARSET is replaced with the name of the encoding.

    Instead of a single variable file you can also specify a list of files separated by semicolons. The optional charset prefix must be specified for each file separately.

    Examples would be:
    -f varfile.txt
    --var-file=ISO-8859-3:varfile.txt
    --var-file=one.txt;two.txt
    --var-file=ISO-8859-3:one.txt;ISO-8859-1:two.txt
  • -M or --list-media-types

    Prints out a lists of supported media types for the --media-types option and quits.