![]() |
Integrating install4j with your ant script (read about ant at
ant.apache.org)
is easy. Just use the install4j task
that is provided in $INSTALL4J_HOME/bin/ant.jar
and set the projectfile parameter to the install4j project
file that you want to build.
To make the install4j task available to ant, you must first insert a taskdef element that tells ant where to find the task definition. Here is an example of using the task in an ant build file: <taskdef name="install4j" classname="com.install4j.Install4JTask" classpath="C:\Program Files\install4j\bin\ant.jar"/> <target name="media"> <install4j projectfile="myapp.install4j"/> </target> The taskdef definition must occur only once per ant-build file and can appear anywhere on the top level below the project element. Note: it is not possible to copy the ant.jar archive to the lib folder of your ant distribution. You have to reference a full installation of install4j in the task definition. |
![]() |
The install4j task supports the following parameters:
Contained elements: The variable element supports the following parameters:
Example: <install4j projectfile="myapp.install4j"> <variable name="MYVARIABLE" value="15"/> <variable name="OTHERVARIABLE" value="test" mediafileid="8"/> </install4j> The install4j task can contain vmParameter elements. These elements set VM parameters for the install4j command line compiler process. The vmParameter element supports the following parameters:
Example for setting an HTTP proxy (an internet connection is required for Windows code signing): <install4j projectfile="myapp.install4j" winKeystorePassword="Kajjs7sgLg22"> <vmParameter value="-DproxySet=true"/> <vmParameter value="-DproxyHost=myproxy"/> <vmParameter value="-DproxyPort=1234"/> <vmParameter value="-DproxyAuth=true"/> <vmParameter value="-DproxyAuthUser=buildServer"/> <vmParameter value="-DproxyAuthPassword=iq4zexwb8et"/> </install4j> |
![]() |
The "hello" sample project includes an ant build script that shows how to setup
the install4j task. To install the sample projects, invoke
Project->Open Sample Project from the install4j IDE. When you
do this for the first time, the sample projects are copied to the "Documents" folder
in your
home directory.
In the samples/hello directory, execute ant media to start the build. If you have not defined install4jHomeDir in build.xml, the build will fail with a corresponding error message. |