...
Listeners
An IzPack listener is a Java class that can add to, or modify, IzPack functionality at various points during install, uninstall, or compile.
Using Listeners
Listeners are embedded into an installer using the <listeners>
element. Any number of <listener>
tags can be included for any of the three IzPack lifecycle stages.
Code Block | ||||
---|---|---|---|---|
| ||||
<listeners> <listener classname="AntActionInstallerListener" stage="install"/> <listener classname="ConfigurationInstallerListener" stage="install"/> </listeners> |
The <listeners>
<listener>
element has the following attributes:
...
Attribute Name | DescriptionPossible Values (Default) | Required | ||
---|---|---|---|---|
classname | The Specifies the name of the class implementing the required listener. | Any classname, which can be found in the package com.izforge.izpack.event (none) | yesMay be a bare class name (usually used for built-in listeners, e.g. AntActionInstallerListener ) or a fully-qualified class name. | Yes |
stage | The lifecycle stage in which the listener should be used, either during installation, uninstallation or compilation phase. |
(none) | yes |
Each listener might require additional
- jar files
- resource
registered. Valid values are:
| Yes | |
jar | For custom listeners, specifies the containing JAR file. Must be an absolute path, or relative to IZPACK_HOME . | No, unless the specified class is not a built-in IzPack listener |
A listener might require that additional JAR files or resources be added to the installation descriptor. See the documentation of the specific listener you intend to use. For example the AntActionInstallerListener expects , the AntActionInstallerListener
expects at least several jar files from Apache Ant (or more, in case of using non-standard Ant tasks), and an Ant buildfile as resource. See the documentation of the specific listener you intend to use.