Message-ID: <2101808139.301425.1369129989219.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_301424_543416569.1369129989218" ------=_Part_301424_543416569.1369129989218 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
To begin with, you should know= how IzPack is organized if you want to use it. Let's go into the directory= where you have installed IzPack on your machine. There are 3 text files an= d a set of directories. The most important for the moment are bin/ doc/ sam= ple/. If you are reading this, you already know that doc contains this docu= mentation
So let's go into bin/. The icons/ directory contains some dire= ctories for your system, in case you would like an icon to launch a compone= nt of IzPack . But the most important things you can see in bin are the com= pile scripts (in both unix* and windows formats). Compile is used to compil= e a ready-to-go xml installation file from a command-line context or from a= n external tool.
Note : these scripts can be launched from anywhere o= n your system as the installer has customized these scripts so that they ca= n inform IzPack of where it is located.
First go get the latest stable= version of IzPack from: http://izpack.org/downloads
If nee= ded download the Latest Java Run Time from Sun's website http://java.sun.co= m/. You should get the JRE if you intend to ONLY run the installer and = get the SDK if you're willing to compile as well.
Don't forget to set up the environment vari= ables:
If using the SDK:
This is obviously assuming that SDK has been installed to &q= uot;C:\j2sdk1.4.2_04"
If using the JRE:
This is obviously assuming that JRE has been installed to &q= uot;C:\Program Files\Java\j2re1.4.2_05" Once this is done, you can ins= tall IzPack using the following command:
Where izpack.jar is the latest release you downloaded from I= zPack website.
If using the SDK:
This is obviously assuming that java has been installed to /= usr/java/j2sdk1.4.2_06
If using the JRE:
This is obviously assuming that JRE has been installed to &q= uot;/usr/java/j2re1.4.2_05" You can put them into any script launched = at startup if you don't want to have to do it everytime. For example, .bash= rc of your user, so that whenever you'll start a bash console the variables= will be set.
To verify that the environment is correct, type SET in = the command prompt and check if those variables are set before running any = compilation.
Then you install IzPack using the following command:=
By default it will be installed in /usr/local/IzPack. Theref= ore you can create two scripts, one for compiling your code and the second = to execute the installer.
#!/bin/s= h /usr/local/IzPack/bin/compile /yourpath/Install.xml -b /yourpath -o /yourpa= th/yourjaroutput.jar -k standard=09=09
BUGS and TROUBLESHOOTING
Normally launching packages created by IzPack un= der Gnome, KDE or XFCE works fine. If when trying to launch a pack you rece= ive this error message:
Then, it's most probably the fact that in some dis= tribution the console and environment variables are "erased" when= switching between users. So, you can type 'su -' in order to obtain all co= mmands. With 'su -' $DISPLAY variables is erased and all X11 connections is= refused. So, a best and fast practice in this way is:
N= ow you probably can't wait to build your first installer. So go on open a c= ommand-line shell and navigate to sample/. The following should work on bot= h unix* and windows systems. for the latter, just change the path separator= (slash '/') to a backslash. So type ($ is your shell prompt !) :
There you are! The first command has produced the installer = and the second one did launch it.
(thanks to Bartz Klaus)
Here are the steps needed to develop and= debug IzPack with Eclipse:
Compile your installation; now you have %INSTALLER_DEST%i= nstall.jar Run > Debug... Java Application New give a name e.g. "In= stallMyInstall" select in "Main" the project "IzPack&qu= ot; select as "main class" "Installer" (from package co= m.izforge.izpack.installer) as "VM arguments" use -DTRACE=3Dtrue = select the tab "Classpath" select "User classes" (2.x) = or "User Entries" (3.x) select "Add External JARs..." s= elect %INSTALLER_DEST%install.jar (may be, that's the trick...) install.jar= must be under the project entry
BUGS and TROUBLESHOOTING
If you get this error when running the application could not cre= ate shortcut instance
then it means you forgot to put the shelllink.dll into the c=
orrect source folder in that case, copy %IZPACK_HOME%binnativeizpackShellLi=
nk.dll to %IZPACK_HOME%srclibcomizforgeizpackutilosShellLink.dll
Now = you can debug the installation. With 2.x you can edit on demand, if %INSTAL= LER_DEST%install.jar is shown in "Classpath" under the project. W= ith 3.x it seems so, that always the JAR will be loaded; therefore the cont= ents of install.jar and the sources should be synchron.
Now that you hav= e packaged your first installer, it's time for you to understand how the wh= ole thing works.
The compilation system is quite modular. Indeed, you = can use the compiler in 2 ways :
The compiler takes as its input an xml installati= on file that describes (at a relatively high-level) the installation. this = file contains detailed information such as the application name, the author= s, the files to install, the panels to use, which resources to load and muc= h more.
The compiler can generate different kinds of installers, but = this information is not located inside the xml file as it is not were it sh= ould be. On the contrary, this is a compiler parameter.
The compilati= on options for a command-line installer are the following:
-? Gives a= list of the available options. -b Specifies the base path, ie the one that= will be used to resolve the relative paths. if your xml file contains abso= lute paths, specify it to an empty string (-b ""). -k Specifies t= he installer kind, for instance most users will want standard here. -o Spec= ifies the resulting installer jar file name.
An installer presents its = panels to the end-user. for instance, there is one to select the packages, = one to prompt for the license agreement, one to select the installation pat= h and so on. You have a choice from a variety of panels to place in the ins= taller. For example, you can choose between a plain text and a html text pa= nel for the license agreement. also, if you don't want of the hellopanel, y= ou just don't include it.
It is very important to understand that som= e of the panels may need extra data. for instance, the license agreement pa= nel needs the license text. A simple approach to specify such data would ha= ve been to add as many xml tags as needed for each panel. However, this mak= es the xml file too specific and not easy to maintain. The approach that ha= s been chosen is to put the data in files and we call these files resource = files. They are specified with a unique xml tag. this is a much cleaner app= roach.
You might wonder how your files are packaged. They can be grou= ped in packs. For instance, you can have one pack for the core files, one f= or the documentation, one for the source code and so on. In this way, your = end-users will have the choice to install a pack or not (provided that the = pack they don't want to install is not mandatory). Inside the jar file (whi= ch is a zip file), a sub directory contains the pack files. Each pack file = contains the files that are part of it. Could we do it simpler ?
There are 2 kinds of installers available :
By default th= e installer will be made for the current most used version of the java runt= ime environment. It is possible to create an installation that is runable w= ith an older vm version.
What version is used can be detected in the = ant properties file that is used to build izpack. It is izpackroot/src/ant.properties. The value of the propert= y "source" determines the vm version.
If compatibility to o= lder versions is needed, a recompilation of the jar files of the izpack sys= tem should be done. For this the sources of izpack and an ant installation = are needed. the sources of izpack are selectable at installation time of iz= pack. Before a recompilation of all can be triggered, the version of byte c= ode should be changed. This can be done simple by changing the "source= " entry in izpackroot/src/ant.p= roperties to the needed value. The recompilation should be performed with t= he current most used vm version because there are classes of it referenced = in the izpack code. Usage of an older vm version at installation time will = be possible because the classes of the newer vm version are only used after= a vm version check. Of course, some features of izpack will be missing at = using an old vm version. To recompile izpack go into izpackroot/src. Use a current jdk (not jre) for this. call=
then all jar files in izp= ackroot/lib, izpackroot/bin/pane= ls and izpackroot/bin/customactions = should be recompiled with the selected source version.------=_Part_301424_543416569.1369129989218--