Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Installer SFX creation ant

This document describes creation of XSE archives using Ant.

Overview

XSE archive description could be found at Installer SFX creation using XSEBuilder. The org.eclipse.epp.sfx.archive.ant plugin contains ant task for archive file creation.

Adding SFX archive creation tasks to Ant

To make SFX archive creation Ant tasks available add following code to your build.xml file:

<property name="ant.support.lib"
	value="Path to archive-ant-support-lib.jar" />
<taskdef name="archivetask"
	classname="org.eclipse.epp.sfx.archive.ant.ArchiveTask" 
	classpath="${ant.support.lib}"/>
<taskdef name="unpack"
	classname="org.eclipse.epp.sfx.archive.ant.UnpackEntriesTask" 
	classpath="${ant.support.lib}"/>

Ant Tasks

archivetask

Description

Archives a set of files.

Parameters

Attribute Description Required
rootdir Archive content root directory. Will not be included into archive No; defaults to project basedir.
packagetype "exe" or "sfx"
"sfx" produce archive only, "exe" produce archive and link with Windows launcher
Yes
command archive root relative autorun command line, will be executed by native launcher Yes
archivefile path to resulting archive file, correspondednt file extension (".exe" or ".sfx") will be added automaticaly Yes
pack200 "true" or "false", toggles pack200 compression for .jar files in archive No; defaults is "false".

Parameters specified as nested elements

fileset

All files included in this fileset will be processed as archive content.

To use a FileSet, use the nested <fileset> element.

unpack

All files included in this nested element will be extracted by launcher prior to execution of autorun. In other words when native launcher executed it will extract only this files.

Files to unpack are specified by nested fileset element.

Examples

<?xml version="1.0"?>

<project name="ArchiveTask Test" default="main" basedir="C:/Temp">
	<property name="ant.support.lib"
		value="Path to archive-ant-support-lib.jar" />
	<taskdef name="archivetask"
		classname="org.eclipse.epp.sfx.archive.ant.ArchiveTask" 
		classpath="${ant.support.lib}"/>
	<taskdef name="unpack"
		classname="org.eclipse.epp.sfx.archive.ant.UnpackEntriesTask" 
		classpath="${ant.support.lib}"/>

	
	<target name="main">
		<archivetask
			packagetype="exe"
			command="installer/install.exe -vmargs -Dinstaller.jar.path=$#launcher#"
			archivefile="${basedir}/../test-install"
			pack200="true">
			
			<fileset dir="${basedir}">
				<include name="**/*.*"/>
			</fileset>
			
			<unpack>
				<fileset dir="${basedir}/installer">
					<include name="**/*.*"/>
				</fileset>
			</unpack>
		</archivetask>
	</target>
</project>

This example creates installation package from set of files on path "C:/Temp". Result archive will be created at "C:\test-install.exe". Pack200 compression will be used for .jar files. After native extractor unpacked files from "C:/Temp/installer" then "C:/Temp/installer/install.exe" will be executed with '-vmargs -Dinstaller.jar.path=$#launcher#"' parameter.

Back to the top