next up previous contents
Next: Desktop Shortcuts Up: izpack-doc Previous: Writing Installation XML Files   Contents

Subsections

Advanced Features

Ant Integration

IZPACK can be easily integrated inside an Ant build process. To do so you first need to tell Ant that you would like to use IZPACK :

<!-- Allows us to use the IzPack Ant task -->
<taskdef name="izpack" classpath="${basedir}/lib/compiler.jar"
         classname="com.izforge.izpack.ant.IzPackTask"/>

Don't forget to add compiler.jar to the classpath of the Ant process.

Then you can invoke IZPACK with the izpack task which takes the following parameters :

Here is a sample of the task invocation :

<!-- We call IzPack -->
<echo message="Makes the installer using IzPack"/>
<izpack input="${dist.dir}/IzPack-install.xml"
        output="${dist.dir}/IzPack-install.jar"
        installerType="standard-kunststoff"
        basedir="${dist.dir}"
        izPackDir="${dist.dir}/"/>

Automated Installers

When you conclude your installation with a FinishPanel, the user can save the data for an automatic installation. With this data, he will be able to run the same installation on another similar machine. In an environment where many computers need to be supported this can save a lot of time.

So run once the installation on a machine and save your automatic installation data in auto-install.xml (that's just a sample). Then put this file in the same directory as the installer on another machine. Run it with :
java -jar installer.jar auto-install.xml

It has reproduced the same installation :-)

Picture on the Language Selection Dialog

You can add a picture on the language selection dialog by adding the following resource : installer.langsel.img. GIF, JPEG and PNG pictures are supported starting from J2SE 1.3.

Picture in the installer

It is possible to specify an optional picture to display on the left side of the installer. To do this, you just have to define a resource whose id is Installer.image. For instance,

<res id="Installer.image" src="nice-image.png" />
will do that. If the resource isn't specified, no picture will be displayed at all. GIF, JPEG and PNG pictures are supported starting from J2SE 1.3.

Native-looking installers

When using standard installers, it is possible to make them use the native look and feel as provided by the JRE (UIManager.getNativeLookAndFeelClassName()). To do that, just create a 0-bytes file and add it as a resource with useNativeLAF as its ID. That's all you have to do. If the JRE can't provide a native look and feel, then the standard Metal look and feel will be used.

This feature should make happy a lot of users with the JDK 1.4.2 which introduces native look and feel bindings for Windows XP and GTK+. I know it will work like that for Windows XP but I'm not sure as far as GTK+ is concerned.

Web Installers

The web installers allow your users to download a small installer that does not contain the files to install. These files will be downloaded from a HTTP server such as Apache HTTPD. If you have many optional packs, this can save people's resources. It's really easy : people download a small Jar file containing the installer, they launch it and choose their packages. Then the installer will get the files from another Jar file located on a server. It's that simple.

Now suppose that you want to make an installer for your application that you want to be named install.jar.

  1. open your favorite text editor and make a plain text file containing on the first line the URL to where you want to put the Jar file containing your packs, let's say for instance http://www.mywebsite/myapp/install_web.jar
  2. add this text file as a resource named WebInstallers.url
  3. compile your installer : you get install.jar and install_web.jar
  4. copy install_web.jar to http://www.mywebsite/myapp/install_web.jar and give your users install.jar for download.

That's all you need to make web installers. Please note that the installation can look like frozen while the installer grabs the server part.

More Internationalization

IzPack is available in several languages. However you might want to internationalize some additional parts of your installer. In particular you might want this for the *InfoPanel and *LicencePanel. This is actually pretty easy to do. You just have to add one resource per localization, suffixed with the ISO3 language code. At runtime these panels will try to load a localized version.

For instance let's suppose that we use a HTMLInfoPanel. Suppose that we have it in English, French and German. We want to have a French text for french users. Here we add a resource pointing to the French text whose name is HTMLInfoPanel.info_fra. And that's it ! English and German users (or anywhere other than in France) will get the default text (denoted by HTMLInfoPanel.info) and the French users will get the French version. Same thing for the other Licence and Info panels.

To sum up : add _<iso3 code> to the resource name for InfoPanel, HTMLInfoPanel, LicencePanel and HTMLLicencePanel.


next up previous contents
Next: Desktop Shortcuts Up: izpack-doc Previous: Writing Installation XML Files   Contents
2003-12-06