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.
Difference between revisions of "Installer SFX creation ant"
Line 53: | Line 53: | ||
<tr> | <tr> | ||
<td>pack200</td> | <td>pack200</td> | ||
− | <td>"true" or "false"</td> | + | <td>"true" or "false", toggles pack200 compression for .jar files in archive</td> |
<td>No; defaults is "false".</td> | <td>No; defaults is "false".</td> | ||
</tr> | </tr> | ||
Line 74: | Line 74: | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
− | <project name="ArchiveTask Test" default="main" basedir="C:/ | + | <project name="ArchiveTask Test" default="main" basedir="C:/Temp"> |
<property name="ant.support.lib" | <property name="ant.support.lib" | ||
− | value=" | + | value="Path to archive-ant-support-lib.jar" /> |
<taskdef name="archivetask" | <taskdef name="archivetask" | ||
classname="org.eclipse.epp.sfx.archive.ant.ArchiveTask" | classname="org.eclipse.epp.sfx.archive.ant.ArchiveTask" | ||
Line 87: | Line 87: | ||
<target name="main"> | <target name="main"> | ||
<archivetask | <archivetask | ||
− | |||
packagetype="exe" | packagetype="exe" | ||
− | command="installer/ | + | command="installer/install.exe -vmargs -Dinstaller.jar.path=$#launcher#" |
− | archivefile="${basedir}/../ | + | archivefile="${basedir}/../test-install" |
pack200="true"> | pack200="true"> | ||
Line 102: | Line 101: | ||
</fileset> | </fileset> | ||
</unpack> | </unpack> | ||
− | |||
</archivetask> | </archivetask> | ||
</target> | </target> | ||
</project> | </project> | ||
</pre></code> | </pre></code> | ||
+ | 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. |
Latest revision as of 05:28, 13 July 2007
This document describes creation of XSE archives using Ant.
Contents
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.