Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

<executable> - mark file as executable and optionally execute it

...

Attribute

Description

Required

Values 
(Default)

targetfile

Relative or absolute target path of a pack file added before, which should reeceive executable permissions or which should be executed.

May contain IzPack variables resolved during installation.

Example: $INSTALL_PATH/bin/launch-script.sh

no
(required, if no nested fileset is used) 

File path

type

bin or jar (the default is bin)

no

"bin" | "jar" 
("bin")

class

If the executable is a jar file, this is the class to run for a Java program

no

A valid Java class within the jar file

stage

Specifies at which stage when to launch the executable:

  • never 
    will never launch it (useful to set the +x flag on Unix)
  • postinstall 
    just after the installation is done
  • uninstall 
    when the application is uninstalled. The executable is executed before any files are deleted.

no

"never" | "postinstall" | "uninstall" 
("never")

failure

specifies what to do when an error occurs:

  • ask (default) will ask the user what to do
  • abort will abort the installation process
  • warn will just tell the user that something is wrong
  • ignore don't tell the user, just continue

no

"ask" | "abort" | "warn" | "ignore" 
("ask")

keep

Whether the file will be kept after execution

no

"true" | "false" 
("false")

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

ID of a condition which has to be fulfilled to execute this file

no

A valid condition ID

...

Code Block
xml
xml
<pack name="core" required="yes">
...
	<file targetdir="$INSTALL_PATH" src="projectNotification.bat" />
	<executable targetfile="$INSTALL_PATH/projectNotification.bat" type="bin" stage="postinstall" failure ="warn" keep="true" >
		<os family="windows" />
		<args>
			<arg value="-version"/>
		</args>
	</executable>
...
</pack>

Executing Multiple Files

One or more <fileset> tags can be used to specify multiple files executable at once. The <fileset> which can be used here does not have all of the attributes and nested tags of a Pack FileSet. Only the attributes targetdir, includes and excludes and the children <include> and <exclude> are allowed. The children <include> and <exclude> only can have the attribute name.

...