Message-ID: <1273176043.41856.1371682292640.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_41855_736304751.1371682292639" ------=_Part_41855_736304751.1371682292639 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
IzPa= ck can execute Java classes provided by third party developers. =C2=A0<= p>This can be useful to extend IzPack's functionality in a number of ways= p>
= IzPack can display output from these classes via a ProcessPanel, or you cou= ld create a custom (possibly hidden) panel that calls your Java code. =C2= =A0
This following example shows how to use a custom Java class with = a ProcessPanel.
An external Java class must have a run() method with = some parameters.
Note: This is not (NOT!) t= he run() method from the java.lang.Runnable interface. Nor is this codified= as an interface in the IzPack javadoc. =C2=A0Instead, this would seem to be a magic method signature that is oth= erwise undocumented.
This class uses the=C2=A0com.izforge.izpack.util= .AbstractUIProcessHandler class to log output into a calling = ProcessPanel. See the IzPack javadoc for details.
You will obviously need to include the stand= alone-compiler.jar on your classpath, in order to compile your class:
$ javac = -cp "/path/to/izpack-standalone-compiler.jar:." org/callimachusproject/Hell= oWorld.java=09=09
IzPack can only reference JAR files not individual class files from a Proc= essPanel.
NB: You should eventually use Maven to automate the compilat= ion, packaging and moving of your JAR file.
t; section of your install.xml, reference an external file =
T= he=C2=A0ProcessPanel.Spec.xml file holds the XML = configuration for the external Java class you want to execute.
In the install.xml file's top le= vel, reference the JAR file containing your class.
This is partially =
NB: The path to the JAR is the path at *compile = time*.
A good place to put this is near the <resources> defin= ition.
In the install.xml file in the panels section, use a Process= Panel to execute your Java class.
<= installation> <resources> <res id=3D"ProcessPanel.Spec.xml" src=3D"installer/ProcessPanel.Spec= .xml"/> </resources> ... <jar src=3D"path/to/hello.jar" stage=3D"install"/> .... =C2=A0 ... <panels> ... <panel classname=3D"ProcessPanel"/> </panels> =C2=A0 .... </installation>=09=09
This is partially documented in=C2=A0 http://izpack.org/documentation/panels.html#processpanel=C2=A0 = DOES THIS NEED TO BE ADDED TO = THE VERSION 5 DOCS?
<= processing> <logfiledir>$INSTALL_PATH</logfiledir> <job name=3D"setup"> <executeclass name=3D"org.callimachusproject.HelloWorld"></exe= cuteclass> </job> <onFail previous=3D"true" next=3D"false" /> <onSuccess previous=3D"false" next=3D"true" /> </processing>=09=09
The IzPack javadoc= is available in the distribution (although apparently not online). There i= s an RPM for Linux users.