Build Installer Listener Izpack
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. Then a separate application should be used to convert this jar file to a windows executable or a Mac application. For this example I’m using a software named Launch4j for this purpose. Information in the appname, appversion, authors and url tags will be used to display on the HelloPanel.
Javaversion will be used to specify the minimum java version required for your application to work. Requirejdk has the values yes and no which will enforce the user to install a java jdk of minimum java version specified or above. Uninstaller tag will allow you to specify the location where the uninstaller should be created and its name. Summarylogfilepath will be used to store a html file of installation summary after successful installation. Writeinstallainformation has values yes or no. If yes is given it gives the user the ability to generate an installation script for further installations. The next section in my install.xml is “guiprefs”.
$Id: IzPack-install.xml 2912 2009-12-14 08:49:30Z jponge $ IzPack installer XML file By Julien PONGE In order to build an installer for IzPack, let's create a directory. The listeners section for CustomActions --> listeners> listener installer='SummaryLoggerInstallerListener'/> listener installer='RegistryInstallerListener'. Build Tools; Bytecode Libraries. IzPack Installer Module 8 usages. Izpack-listener izpack-native izpack-dist. If you are not afraid of not being able to build an installer (not yet working) or currently not working tests. Now let’s take a look on how to create a shortcut to execute the uninstall.jar created by the IzPack installer.
It will allow me to change the appearance of the ultimate installer of my application. We can also specify many languages for the installer to operates. For my installer I only specified English. Because there aren’t any choice the initial panel for language selection is not appearing in my installer. All the language codes needed for configuring this option is given in the IzPack manual clearly Next comes an important section in the install.xml. Resources tag will contain information and location of all the additional files in the installation other than the install.xml itself.
In here, shortcutSpec.xml file, Readme.html file and Licence.html file are located on the root of the installation folder. But header image and side image are located inside a folder named images which is located on the root. Likewise you can specify any resource used for the installation process, located anywhere with respect to the installation folder.
For all the resources you also need to give a unique id which can be used later for identifying the resource. And remember to include all the files you have mentioned under resources with exact names and locations unless you need half a dozen compilation errors. Panel section will be used to specify the different panels you need to show in your installation and their order of appearance. All different panels are given in the manual.
These are what I’m using for my installation in the order they required to appear. For your information I’ll include GUIs of the above panels in the above order. Then next most important section of our install.xml is the packs section, which define what need to be installed, to where and how. This implements the core of the installation process. Since the code of the packs section of my installer is so lengthy I will include the code of one pack only. This will include the necessary processing of Liferay framework and other core files used in the jefe solution.
Installation process is divided into many parts according to packs. As you can see in the 5th image since pack give in the above code is set as “required=yes” user does not get the opportunity to select or deselect it according to his requirements.
Hence this is a good option to include all the required and essential features of the application under this pack. So I have used this pack named core to copy the Readme file, Licence file and images folder to the root of the installation location and i have also unzipped the zip file named “liferay-portal-tomcat-6.0-5.2.3.zip” to the folder “core” in the root. After unzipping I’m specifying 2 runnable bat file locations in it which I need to run later.
Izpack Silent Install
But here I’m asking the installer not to run these files by specifying the stage as never. The other alternatives to the stage are postinstall and uninstall which will be called soon after installation and at the time of uninstalling respectively. Description will appear when you click on a pack. I have also used an listener for windows users, to catch the summary log of the installer. The code for the following segment represent the inclusion of the above listener. Native packs are also required to include in your installation xml file to implement the installer functionality. The code for the above native pack is included below.
The code of the completed install.xml file is attached here: The code of the completed shortcutSpec.xml file is attached here: Creating an install.jar out of install.xml. After creating the install.jar file, you can once again navigate to the location where you saved it in the command prompt and execute the following command to launch your installer as how you launch any other.jar file. E: jefeInstjava -jar install.jar Creating install.exe out of install.jar Start the Launch4j and create an new project in it. In the Basic tab input the output file name and location where you need your executable file to be saved in “.Output file”. In the Basic tab again under “.Jar” browse and give the install.jar file you just created using IzPack.
In the Basic tab you can also give a custom icon for the executable installer you are going to create. In the JRE tab under “Min JRE Version” include the minimum JRE version needed for your application to work. Now save the file and build the wrapper from the menu.
You are now having a complete single file windows executable for your application! Hi,Thanks for the write-up. I am having tough time to call a executable from IzPack Installer. The compilation is successful and installer is hanging before finish.
Build Installer Listener Izpackage
The Install.xml has below entries:- The base files If I remove the executable tag from install.xml everything looks Ok, but it is not serving my purpose. The files dbscript.bat and cr.sql resides in the $INSTALLPATH directory and I could run dbscript manually. Do you see any thing suspicious over here which is preventing the installer to call the dbscript.bat?
Comments are closed.