IzPack uses XML files to describe installations. So there are no UI interface and your must write the XML installation file ”by hand” and compiling it with the command line compiler or invoking the compiler as the Ant task.
A specially I use Ant script to build my application. You need write only one time Ant script and call it.
build.xml
<project name="My Application Installer" default="installer" basedir=".">
<property name="dist.dir" value="."/>
<!-- Allows us to use the IzPack Ant task ( i use stand alone compilation )-->
<taskdef name="izpack" classpath="../izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask"/>
<target name="installer">
<echo message="Makes the Installer using IzPack"/>
<izpack input="${dist.dir}/installer.xml" output="${dist.dir}/installer.jar" installertype="standard" basedir="${dist.dir}" izpackdir="${dist.dir}/">
</target>
</project>
Now is the time to think about writing XML. As written in Ant script our XML is called as installer.xml. All IzPack XML start with a tag <installation> where is the following tags:
- info - information about application;
- variables - to specify variables of installation;
- guiprefs - GUI preferences (here you can set layout style, installation windows size ...);
- locale - to specify the language packs that you want to use for your installer;
- resources - most panels have resources, here you can specify you resources for panels;
- panels - IzPake have predefined panels that help as create installation easy and fast;
- packs - here you can specify package, most common you have one or two packages;
installer.xml
<!-- Application installation file. To compile it : - go in call with ant build.xml file. -->
<installation version="1.0">
<!-- The info section. -->
<info>
<appname>My application</appname>
<appversion>1.0</appversion>
<authors>
<author name="developer" email="info@developer.com">
</authors>
<url>http://www.home.page</url>
<javaverison>1.6</javaverison>
</info>
<guiprefs width="800" height="600" resizable="no">
<laf name="looks">
<os family="windows"/>
</laf>
</guiprefs>
<locale>
<langpack iso3="eng"/>
</locale>
<resources>
<res id="LicencePanel.licence" src="Licence.txt"/>
<res id="InfoPanel.info" src="Readme.txt"/>
</resources>
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="FinishPanel"/>
</panels>
<packs>
<pack name="Core" required="yes">
<description>Core package</description>
<fileset dir="../dist/Application/" targetdir="$INSTALL_PATH">
<include name="**/*"/>
</fileset>
</pack>
</packs>
</installation>
Installation have wizard with a six panels. First show the application info, second show detail info
which is taken from Readme.txt, third is showing license from License.txt, fourth suggest select application directory, fifth install application, and at finish installation succeed.
Now you can show you application to the world. Remember 28% of application have crash on installation process.