Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: undesigned links removed

...

  • Implement com.izforge.izpack.event.CompilerListener or extend com.izforge.izpack.event.SimpleCompilerListener. Place it as [IzPackRoot]/src/lib/[MyPackagePath]/MyCompilerListener.java.
  • Add a "build-compiler-listener" macro call in to the build.listeners target in [IzPackRoot]/src/build.xml. Note that the name attribute value in the build-instealler-listener must match CompilerListenerimplementation 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. An ant 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.

...