TargetPanel
Usage
This panel allows the user to modify the default installation path.
<panel classname="TargetPanel"> Â Â <validator classname="com.izforge.izpack.installer.validator.ConditionValidator"/> </panel>
The panel will display a panel window with a text area that can be edited by the user and a browse button which allows the user to browse for the desired folder.
The IzPack variable INSTALL_PATH
 will be set to the user's selection.
TargetPanel checks the $INSTALL_PATH/.installationinformation file on updates when the installer is set to the modification mode, see <writeinstallationinformation> in the <info> section and InstallationTypePanel for more information how to handle this.
Configuration
Use the nested <configuration> (see Panels) element to customize the TargetPanel for your purposes:
Name | Value | Default Value | Description |
---|---|---|---|
ShowCreateDirectoryMessage | true|false | true | If true, the panel will show the "Target directory will be created" dialog if a directory does not exist. Since:Â 5.0 RC5 |
ShowExistingDirectoryWarning | true|false | true | If true, the panel will show the "The directory already exists! Are you sure you want to install here and possibly overwrite existing files?" warning dialog, if the given directory already exists. Deactivating this might be convenient in the case of update installers. Since:Â 5.0 RC5 |
Example:
<panel classname="TargetPanel"> <validator classname="com.izforge.izpack.installer.validator.ConditionValidator"/> <configuration> <!-- Don't show warning if target directory already exists --> <ShowExistingDirectoryWarning>false</ShowExistingDirectoryWarning> </configuration> </panel>
You can set a the default installation directories for different target installation platforms. When the compiled installer is executed, IzPack chooses the one that matches the assigned platform. This can be achieved by explicitly setting variables with the prefix: TargetPanel.dir
. IzPack recognizes this as a built-in variable which can be user-modified.
 For a more detailed description see Setting Default Installation Directories.
Built-in Variable | Description | Default Value |
---|---|---|
| The platform-specific default installation path, which can be overridden by the user in TargetPanel. | determined automatically according to the OS and platform |
ShowCreateDirectoryMessage | true |
Translations
The text for these keys is specified in language resource files as described in the section on Internationalizing resources.
Key | Default (English) | Description |
---|---|---|
TargetPanel.headline | Target Path | The headline of the panel (the one with the white background). GUI only: This is a standard translation for all type of graphical panels, if the <guiprefs> modifier useHeadingForSummary is set "yes".This has no effect on console installations. |
TargetPanel.summaryCaption | Installation Path | The summary caption text of the panel. GUI only: This is a standard translation for all type of graphical panels, if the <guiprefs> modifier useHeadingForSummary is not set or different to "yes". This has no effect on console installations. |
TargetPanel.info | Select the installation path:Â | The label text above the target directory edit field. |
TargetPanel.browse | Browse... | The label text of the directory chooser button. |
TargetPanel.warn | The directory already exists! Are you sure you want to install here and possibly overwrite existing files? | Warning message if the directory specified already exists. |
TargetPanel.incompatibleInstallation | Incompatible installation detected. Uninstall it first, or choose another directory to install to. | Warning message if the specified location is not suitable for a new installation. |
TargetPanel.empty_target | You have not specified a target location! Is this correct? | Warning message given when the user has not selected a target but has pressed OK. |
TargetPanel.notwritable | This directory can not be written! Please choose another directory! | Warning that IzPack can not create files in the selected location. |
TargetPanel.createdir | The target directory will be created: | |
TargetPanel.nodir | This file is not a directory! Please choose a directory! | |
PathInputPanel.intro | Intro text with an explanation, rarely used, is empty by default. | |
PathInputPanel.extendedIntro | ||
PathInputPanel.required | The chosen directory should exist. | |
PathInputPanel.required.forModificationInstallation | The chosen directory should exist. | The alternative for PathInputPanel.required, if the IzPack variable modify.izpack.install is set "true" and an .installationinformation file exists in the target folder. See the  InstallationTypePanel for more installation how the modify.izpack.install variable is automatically set. |
PathInputPanel.notValid | The chosen directory does not contain the required product. |
To change the text "Select the installation path: Â " to "Select the folder where My Application 2.1 should be installed:Â ", Â TargetPanel.info
 should be specified in a language resource file for each language supported.
<resources> <res id="TargetPanelText.xml" src="TargetPanelText.xml"/> <res id="TargetPanelText.xml_fra" src="TargetPanelText.xml_fra"/> </resources>
The TargetPanelText.xml file which is the default language resource, should look something like this:
<langpack> <str id="TargetPanel.info" txt="Select the folder where $APP_NAME $APP_VER should be installed."/> </langpack>
A similar TargetPanelText.xml.fra file needs to be created to specify the French translation.