Crossfire JXClient, Trunk
How to make a Windows installer for JXClient

This file explains how to create a Windows-based installer for JXClient.

The installer will bundle a JRE to simplify installation for the end-user.

Provided instructions should work on Windows or Linux as long as requirements are met.

The installer can be created using gradle or manually.

Requirements

Before you can create an installer, you must configure a few things.

Have NSIS installed

The Windows-based installer is created using [https://nsis.sourceforge.io/Main_Page](NSIS).

Therefore you must have NSIS installed for your system.

Any recent version should be all right (tested with Debian version v2.51-1+b1).

For Windows, download NSIS and install it. For Linux, use your package manager or any other means.

Creation through gradle

The easiest way to create the installer is to run gradle from the JXClient sources root:

./gradlew createWindowsInstaller

You must have an Internet connection.

Gradle will automatically download and unzip the JRE, create the installer and copy it in the project's root.

Manual creation

Have JXClient compiled

Obviously, you must have a compiled version of JXClient.

Use Gradle to generate it (check README in the JXClient root for more information).

The jxclient.jar must be in the root directory of the JXClient tree (it should be copied by Gradle by default).

Download a JRE

In order to simplify the end-user's experience, a JRE is bundled into the installer.

For NSIS to find it, you must put the JRE into the jre subfolder of this folder.

Java 1.8 or above is required.

Quick guide to install:

To summarize, the jre subfolder must contain directories bin and lib and various readmes of the JRE.

Creating the installer

To create the installer, merely change to this directory, and run makensis windows_installer.nsi.

For Windows users, you can use the NSIS GUI to select the .nsi and compile it. Working directory must be this directory.

By default the version will be set to the compile date, in format ' year-month-day'. You can specify a version by running makensis -DJXVERSION=(your version) windows_installer.nsi.

The generated executable is named JXClientInstaller-{version}.exe.

Installer customization

In the .nsi, you can adjust:

  • JXCLIENT, defined on line 3, if you ever want to change the name in the whole setup. This also changes the default install location, registry keys and such, allowing multiple JXClient to be installed if they have different names

You can provide the following defines on the nsis command line:

  • JXVERSION: JXClient version, defaults to current date in format YYYY-MM-DD
  • OUTPUTFILE: path, full or relative, of the .exe to generate. Defaults to JXClientInstaller-${JXVERSION}.exe
  • JAVA: path, full or relative, of the Java to bundle. This must be the root, with a jre subdirectory. Defaults to .

Installer functionalities and limitations

Ths installer will:

  • automatically uninstall silently any already installed version
  • not check for upgrade or downgrade. It is the user's responsability to know what version she's installing
  • have an 'Unknown' publisher in Windows's UAC dialog. This is because the installer is not digitally signed