IzPack: Thoughts on Using Environmental Variables in Silent Installation
IzPack is pretty powerful installation tool. However, silent installation (or the call it Automated Installers) lacks some flexibility. One of the things, which I lack, is a possibility to provide environmental variables in silent installation configuration files (auto-install.xml). Here I will provide some tricks which would help making your installer "eat" silent installation configuration files with environmental variables.
To start with,
Silent Installation of Modularized Installers with IzPack
link to modularized installers 2 times
As one can see from my previous post it is easy to create a modularized installer with IzPack. However, one may wonder, what about a silent installation of "master" installer? Is there a way to apply auto installation for such "master" installer and make it totally silent? Yes, it is possible.
So as one probably knows,
Compressing IzPack Installers
Sometimes one need to carry a lot of different files in the installer. There is a possibility to compress them using pack200.
In your install.xml in info section simply specify:
<pack200 />
But be aware, that when your installer is getting bigger and you are using pack200 to compress it, it can take quite a long time!
For instance, if you are carrying other jar files or other installers (I hope to write about modularized installers some time later), building the installer with pack200 can take up to several minutes!
Filtering IzPack Installation Files with Maven
As you have seen from my previous posts it is easy to build an installer using Maven. You also can use Maven to make your installer more powerful. For example, using resource filtering. You can do it by using a Maven Resource plugin as I did in my previous post. And all you need to do to make it work is
Installation with IzPack — Launching BAT Files
Intuitively we know -- if we can run a bat file.. we can probably to everything. And yes, you can run bat files from IzPack too!
I will assume, that you read my previous post about simple IzPack + Maven applications. In order to run a bat file, we will have to use a IzPack ProcessPanel.
In your install.xml you need to
IzPack — Changing Location of Installation
Sometimes one is interested to let the user choose where to install the application. It is possible to do using TargetPanel. But sometimes you want to force using specific directory. In this case you must be using DefaultTargetPanel.
In order to use a forced specific directory, you would need to add a DefaultTargetPanel to your IzPack panels:
IzPack and Maven — Deploying to Repository
In previous post we saw a simple example on how to build IzPack with Maven. Since the installer can be built with Maven, then it can also be deployed to a Maven Repository (Nexus, for example)! To do that, you have to set up Maven Repository as usual and make necessary modifications to pom.xml. And when you will run mvn deploy, you installer will appear in the repository!
The important thing to notice here is that
IzPack with Maven
What does Maven? Maven builds a project. What does IzPack? IzPack builds an installer. Naturally, one would like to use Maven to control IzPack. Here is an example of a simple application which uses Maven and IzPack to create an installer for an application.
We start by creating a pom.xml:
Why IzPack?
At some point instead of shipping a product to a customer and doing some postconfigurations afterwards one decides to create an installer, which would handle all the process. Of course, having an installer is not an easy task -- installer needs to be changed along with your product. Testing the installer and supporting uninstallation are not trivial tasks as well..