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 🙂

Advertisements

6 thoughts on “creating a installer using IzPack..Great Tool

  1. I am not getting how to create shortcut panel and process panel please help me.
    1. I have created Win_shortcutSpec.xml file , provided its path in install.xml file under resources tag. In am getting my tomcat on install path location but server is not getting start.
    2. content of Win_shortcutSpec.xml file is as follows,

    3. also i am not getting how to create process panel .
    4. i have created ProcessPanel.Spec.xml file it s content is

    5. Please helip me how to solve thses two issues

  2. Hello Pawan,

    I do not know if there is a well known solution to my question. But can you please help me?

    I am required to create an installer . Which should do 3 types of installations. 1) full installation 2) custom 3) config.
    I cannot find any class that can do this.
    I saw installationtypepanel.java which either installs it as new or modifies the current installation.

    my requirement is for full installation, it should be able to execute all the jobs in processpanel spec. Dor custom installation, it should execute some of them and for config, it should be able to do jobs related to configuration..

    Can you please help me acheiving this?

    Thanks,
    harshita

  3. I am using Izpack 5. I have added myapplication.jar in the install.xml as follows:

    Core Installation Files

    After compiling the xml, it shows in the logs that the file has been extracted and added at the target location. But it does not appear physically at that location. Hence the actual application is not installed. Am I missing any configuration?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s