Skip to content

How to create izpack installer with gradle

Asterios Raptis edited this page Jun 12, 2024 · 21 revisions

Overview

Before you create the izpack installer file be sure that you have follow the precondions in the DEPLOYMENT-INFO.

  • As next you have to set the property 'createIzPackInstaller' to true(in the project gradle.properties file) and then execute the clean, 'withAllDependendiesJar' and the jar task process with gradle. This process will generate the jar files in the directory 'mystic-crypt-ui/build/libs' and the signed jar files in the directory 'mystic-crypt-ui/build/signed*.
  • Now we can run the 'izPackCreateInstaller' task that will automatically get the signed jar file and generate the installation jar file in the projects distributions directory 'mystic-crypt-ui/build/distributions'. The generated signed installation jar file can now be deployed for installation to any OS.

There is a new gradle task that reproduce the described behavior from above. The name of the gradle task is 'createIzPackInstallerFromSignedJar' and is in the gradle file 'mystic-crypt-ui/gradle/packaging.gradle'. If you set the flag 'createIzPackInstaller' to true an installer jar will be automatically created in the distributions directory 'mystic-crypt-ui/build/distributions'.

For more detailed information see the izpack task in the build.gradle file or go direct to the gradle izpack plugin page

Notes

Since version 6 the build.gradle file is splitted in several section gradle files. One of them is the 'izpack.gradle' file. This file contains the izpack task. In the 'packaging.gradle' file are the tasks for generate the jar, signed jar and withAllDependenciesJar.

Trouble shooting

If no installation jar file is generated, see if the property 'createIzPackInstaller' is set to true

If the following error comes

Execution failed for task ':jar'.
> Could not get unknown property 'release.mystic-crypt.key.alias' for root project 'mystic-crypt-ui' of type org.gradle.api.Project.

This error means that the property 'release.mystic-crypt.key.alias' for the keystore is not set. In the project gradle.properties they are the following properties for the keystore:

##############################
# keystore properties keys   #
##############################
mysticCryptStoreFile=release.mystic-crypt.store.file
mysticCryptStoreType=release.mystic-crypt.store.type
mysticCryptStorePassword=release.mystic-crypt.store.password
mysticCryptKeyPassword=release.mystic-crypt.key.password
mysticCryptKeyAlias=release.mystic-crypt.key.alias

The follow the same pattern as described in this article

There is also the error

> jarsigner returned: 1

this can happen if the path of the keystore is not properly set in the ~/.gradle/gradle.properties

izpack migration to izpack 5

The project is migrated to to new major version izpack 5.x.

Versions before 6.x uses old version izpack 4.x