creating a installer using IzPack..Great Tool

please find the below files to use them directly.

shortcutSpec_xml install_xml

Hi, I am here to describe about Izpack, in past to create installers for my java apps i went with a licensed version of Advanced installer, still that is a complex tool to create installers.IzPack is a open source tool which is smooth than Advanced installer below are the Features of the tool.

Features and Drawbacks of Using IzPack
Because of the following reasons I chose IzPack to create the installer for my application, from all other free and open source installer software. The reasons which helped me to make my decision are as follows,

IzPack is Open Source
It has attractive GUI
Great Customizability
It is a Cross-Platform Installer
Automatic Uninstaller Creation

The drawback of using IzPack is, it doesn’t contain enough documentation or working examples for a beginner to use it and get the job done easily. Science it has less documentation and Samples i am here to share my experience to guide you all.

How IzPack Installer Operates
All what we have to do to make the installer is write an xml file stating all the necessary configuration information and compile it using the compiler provided by the IzPack. Then according to our xml, an installer file named install.jar will be created by the IzPack. It will wrap all the files and folder structure from the end user.

creating your install.xml file:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<!--
Install.xml of Project [AppName] using IzPack Installer
-->
<installation version="1.0">

<info>
<appname>[AppName]</appname>
<appversion>1.0</appversion>
<authors>
<author name="Mr. M K Pavan Kumar" email=""/>
</authors>
<javaversion>1.6</javaversion>
<requiresjdk>no</requiresjdk>
<url>http://www.[AppName].com</url>
<uninstaller name="uninstall.jar" path="${INSTALL_PATH}/uninstaller" write="yes"/>
<summarylogfilepath>$INSTALL_PATH/InstallationSummary.htm</summarylogfilepath>
<writeinstallationinformation>yes</writeinstallationinformation>
</info>

<guiprefs width="600" height="480" resizable="no">
<modifier key="layoutAnchor" value="CENTER"/>
<modifier key="useHeadingPanel" value="yes"/>
<modifier key="useHeadingForSummary" value="yes"/>
<modifier key="headingImageOnLeft" value="yes"/>
<modifier key="headingLineCount" value="2"/>
<modifier key="headingFontSize" value="1.5"/>
<modifier key="headingBackgroundColor" value="0x00ffffff"/>
<modifier key="headingPanelCounter" value="text"/>
<modifier key="headingPanelCounterPos" value="inHeading"/>
</guiprefs>

<variables>
<variable name="DesktopShortcutCheckboxEnabled" value="true"/>
<variable name="ApplicationShortcutPath" value="ApplicationShortcuts"/>
</variables>

<locale>
<langpack iso3="eng"/>
</locale>

<resources>
<res src="shortcutSpec.xml" id="shortcutSpec.xml"/>
<res id="HTMLInfoPanel.readme" src="Readme.html"/>
<res id="HTMLLicencePanel.licence" src="Licence.html"/>
<res id="Heading.image" src="images/heading-image.jpg"/>
<res id="Installer.image" src="images/side-image.jpg" />
</resources>

<panels>
<panel classname="HelloPanel"/>
<panel classname="HTMLInfoPanel" id="readme"/>
<panel classname="HTMLLicencePanel" id="licence"/>
<panel classname="TargetPanel"/>
<panel classname="TreePacksPanel"/>
<panel classname="SummaryPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="FinishPanel"/>
</panels>

<packs>
<pack name="core" required="yes">
<description>This will include the necessary processing of SwiftUI framework and other core files used in the SwiftUI.</description>
<file src="Readme.html" targetdir="$INSTALL_PATH"/>
<file src="Licence.html" targetdir="$INSTALL_PATH"/>
<fileset dir="images" targetdir="$INSTALL_PATH\images">
<include name="**"/>
</fileset>
<file src="apache-tomcat-7.0.16.zip" targetdir="$INSTALL_PATH\core" unpack="true"/>
<executable targetfile="$INSTALL_PATH/core/apache-tomcat-7.0.16/bin/startup.bat" stage="never" />
<executable targetfile="$INSTALL_PATH/core/apache-tomcat-7.0.16/bin/shutdown.bat" stage="never" />
</pack>

<pack name="Documentation" required="no">
<description>This is official [AppName] documentation.</description>
<fileset dir="doc" targetdir="$INSTALL_PATH\doc">
<include name="**"/>
</fileset>
</pack>

</packs>

<listeners>
<listener installer="SummaryLoggerInstallerListener">
<os family="windows"/>
</listener>
</listeners>

<native type="izpack" name="ShellLink.dll"/>
<native type="izpack" name="ShellLink_x64.dll"/>
<native type="3rdparty" name="COIOSHelper.dll" stage="both">
<os family="windows"/>
</native>

</installation>

creating shortcutsSpec.xml file:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>

<!--
shortcutSpec.xml of Project Jefe using IzPack Installer to create windows shortcuts
-->

<shortcuts>

<skipIfNotSupported/>

<programGroup defaultName="[AppName]" location="applications"/>

<shortcut
name="[AppName] - Startup"
programGroup="yes"
desktop="yes"
applications="no"
startMenu="yes"
startup="no"
target="$INSTALL_PATH\core\apache-tomcat-7.0.16\bin\startup.bat"
commandLine=""
description="[AppName] tomcat Server Startup"
iconFile="$INSTALL_PATH\images\startup.jpeg"
iconIndex="0"
initialState="noShow">

<createForPack name="core"/>

</shortcut>

<shortcut
name="[AppName] - Shutdown"
programGroup="yes"
desktop="no"
applications="no"
startMenu="no"
startup="no"
target="$INSTALL_PATH\core\apache-tomcat-7.0.16\bin\shutdown.bat"
commandLine=""
iconFile="$INSTALL_PATH\images\shutdown.jpeg"
iconIndex="0"
description="Shutdown [AppName] tomcat Server">

<createForPack name="core"/>
</shortcut>

<shortcut
name="[AppName] - Uninstaller"
programGroup="yes"
desktop="no"
applications="no"
startMenu="no"
startup="no"
target="$INSTALL_PATH\uninstaller\uninstall.jar"
commandLine=""
iconFile="$INSTALL_PATH\images\uninstall.jpeg"
iconIndex="31"
description="[AppName] Uninstaller">

<createForPack name="core"/>
</shortcut>

</shortcuts>

Finally,
Go to the IzPack installation folder and then to IzPack bin using command prompt with Administration privileges and type the following command
D:\IzPack\bin>compile D:\appInst\install.xml -b D:\appInst
This will create install.jar file now to run the jar file run java -jar install.jar that open up the installer.
Happy Coding 🙂