Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

<parsable> - Mark Text Files For Parsing / Substituting Variables

Pack files marked <parsable> are parsed after copying them to the target system and substitute IzPack variables. Those variables can be defined in a syntax according to their file format, the default for plain files is ${<variable_name>} or $variable_name.

Files must be first added to the pack using <singlefile><file> or <fileset> before they can be marked parsable.

The variable replacement happens before afterpack listeners are executed.

Attributes

Attribute

Description

Required

Values 
(Default)

targetfile

Relative or absolute target path of a pack file added before, where variables should be resolved in place.

May contain IzPack variables resolved during installation.

Example: $INSTALL_PATH/conf/app.properties

(required, if no nested fileset is used) 

File path

type

Specifies the text file type:

  • plain - use for plain text files, where the variable definition syntax cannot conflict with the original file's syntax.
    Syntax variant 1: Prefix: $
    Syntax variant 2: Prefix: ${, Suffix: }
    Example: ${MY_VAR} or $MY_VAR.
  • javaprop - use for Java properties file, to choose the right default encoding "ISO-8859-1" and to replace escapes in the right manner.
  • java - use in Java source files, to replace escapes in the right manner.
  • xml - use for XML files, to choose the right default encoding "UTF-8".
  • shell - use for shell scripts.
    Syntax variant 1: Prefix: %
    Syntax variant 2: Prefix: %{, Suffix: }
    Example: %MY_VAR or %{MY_VAR}.
  • at 
    Prefix: @
    Example: @MY_VAR.
  • ant - use in Ant files, where the plain style for IzPack conflicts with the syntax of Ant property substitutions.
    Prefix: @, Suffix: @
    Example: @MY_VAR@

no

"plain" | "javaprop" (Properties) | "xml" | "java" | "shell" | "at" |"ant" (Ant buildfile) 
("plain")

encoding

The file encoding

no

A valid Java encoding string 
("ISO-8859-1" for type="javaprop", 
"UTF-8" for type="xml", otherwise the Java default charset is assumed as encoding)

os

Limits this action on a particular OS family, works like for <file>

no

No recommended to use any longer, use the nested <os> tag, instead.

condition

Limits this action on a particular condition with the specified ID which has to be fulfilled

no

 

Nested Elements
  • <os> - restrict parsing depending on the target operating system, see the OS Restriction element
  • <fileset> -  tags can be used to mark multiple files parsable at once. 

 

    • The <fileset> which can be used here only supports the attributes targetdir, includes and excludes (not like the similiar Pack FileSet). If targetdir is not defined it will default to "${INSTALL_PATH}".

    • Filtering can be done with the includes or excludes attribute or nested <includes><include name="..."></includes> Elements

Important: <parsable> marks files parsable, which have been added using the <singlefile><file> or <fileset> tags before nested against the <pack> definition. There is no access to the filesystem for a <parsable> fileset, but just to files that are packed into the installer before.

Example:

 

<pack name="core" required="yes">
...
    <file targetdir="$INSTALL_PATH" src="projectExtractor.bat" >
    <file targetdir="$INSTALL_PATH" src="projectInstaller.bat" >
    <parsable type="shell">
        <os family="windows" />
        <fileset targetdir="$INSTALL_PATH" includes="fileCleaner.bat,projectNotification.bat" />
    </parsable>
 
...
<pack>
 
  • No labels