...
- Implement
com.izforge.izpack.event.CompilerListener
or extendcom.izforge.izpack.event.SimpleCompilerListener
. Place it as[IzPackRoot
]/src/lib/[
MyPackagePath]
/MyCompilerListener.java
. Add a "
build-compiler-listener
" macro call in to thebuild.listeners
target in[IzPackRoot]
/src/build.xml
. Note that the name attribute value in the build-instealler-listener must matchCompilerListener
implementation class name (not including the package). You should include the actual Listener implementation, as well as any other classes required by the listener.Code Block <build-compiler-listener name="MyCompilerListener"> <include name="[MyPackagePath]/MyCompilerListener.java"/> <include name="[MyPackagePath]/SomeOtherHelperClass.java"/> </build-compiler-listener>
- Run [
IzPackRoot]
/src/build.xml
. Anant
alone will execute the required targets. Add a "listeners" ELEMENT with a "listener" ELEMENT with a "compiler" attribute in to [MyProjectPath]/install.xml
Code Block <listeners> <listener compiler="MyCompilerListener" /> <listeners>
Compile with the following command, or an ant task you have set up.
Code Block java -jar [IzPackRoot]/lib/compiler.jar -HOME [IzPackRoot] [MyProjectPath]/install.xml -b [MyProductPath] -o [MyBuildPath]/install.jar
- Test it
...
As with other listeners a jar file with the same name has to exist in [IzPackRoot]
/bin/customActions
. If compilation (packaging) fails with an "not found" error, verify, that the jar file exists. If not, create it. The jar files are RegistryInstallerListener.jar
and RegistryUninstallerListener.jar
.
...