394 lines
16 KiB
HTML
394 lines
16 KiB
HTML
![]() |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html><head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||
|
|
||
|
<title>Launch4j :: Cross-platform java application wrapper for creating Windows native executables</title><meta content="Grzegorz Kowal" name="author">
|
||
|
<meta content="Cross-platform java application wrapper for creating Windows native executables.
|
||
|
Features native splash screen, application icon, small stub." name="description">
|
||
|
<meta name="Keywords" content="Java, java, exe, native, windows, Windows, jar, wrap, wrapper, launch,
|
||
|
run, execute, executable, splash, icon, ico, ant, build, script, deploy, free, freeware, open source,
|
||
|
gpl, GPL, lgpl, LGPL, sourceforge, c++, C++, W2K, WXP, W98, linux, Linux">
|
||
|
<link rel="stylesheet" type="text/css" href="layout.css">
|
||
|
<link rel="stylesheet" type="text/css" href="style.css"></head>
|
||
|
|
||
|
<body>
|
||
|
<div id="container">
|
||
|
<div id="top"><img style="width: 249px; height: 58px;" alt="" src="launch4j.gif"><span style="color: rgb(48, 127, 225);"> <small><span style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;">1.4.2,
|
||
|
2.0.RC3</span></small></span>
|
||
|
</div>
|
||
|
<div id="leftnav">
|
||
|
<ul id="navlist">
|
||
|
<li><a href="index.html"><span style="font-weight: bold;"></span>Home</a></li>
|
||
|
<li><a href="docs1.html"><span style="font-weight: bold;"></span>1.x
|
||
|
docs</a></li>
|
||
|
<li><a href="docs2.html"><span style="font-weight: bold;"></span>2.x
|
||
|
docs</a></li>
|
||
|
<li><a href="changelog.html"><span style="font-weight: bold;"></span>Changelog</a></li>
|
||
|
<li><a href="http://sourceforge.net/project/screenshots.php?group_id=95944"><span style="font-weight: bold;"></span>Screenshots</a></li>
|
||
|
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=95944"><span style="font-weight: bold;"></span>Download</a></li>
|
||
|
<li><a href="http://sourceforge.net/forum/?group_id=95944"><span style="font-weight: bold;"></span>Support</a></li>
|
||
|
<li><a href="http://sourceforge.net/projects/launch4j"><span style="font-weight: bold;"></span>Project
|
||
|
summary</a></li>
|
||
|
<li><a href="http://sourceforge.net/tracker/?atid=613100&group_id=95944"><span style="font-weight: bold;"></span>Bug
|
||
|
tracker</a></li>
|
||
|
<li><a href="links.html"><span style="font-weight: bold;"></span>Links</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="content">
|
||
|
<a href="#Running_launch4j">Running
|
||
|
launch4j</a><br>
|
||
|
<a href="#Configuration_file">Configuration
|
||
|
file</a><br>
|
||
|
<a href="#Importing_1.x_configuration">Importing
|
||
|
1.x configuration</a><br>
|
||
|
<a href="#Ant_task">Ant Task</a><br>
|
||
|
<br>
|
||
|
<br>
|
||
|
<h2><a name="Running_launch4j"></a>Running
|
||
|
launch4j<br>
|
||
|
</h2>
|
||
|
Run <em>launch4j.exe</em>
|
||
|
or <em>launch4j</em>
|
||
|
script without command
|
||
|
line arguments to enter the GUI mode.<br>
|
||
|
<pre>launch4j.exe<br></pre>
|
||
|
To wrap a jar in console mode use <em>launch4jc.exe</em> <em></em>and
|
||
|
specify the configuration file using an absolute path.<br>
|
||
|
<pre>launch4jc.exe c:\src\demo\l4j\config.xml<br></pre>
|
||
|
On linux use the <em>launch4j</em>
|
||
|
script.<br>
|
||
|
<pre>launch4j ~/src/demo/l4j/config.xml<br></pre>
|
||
|
<br>
|
||
|
<h2><a name="Configuration_file"></a>Configuration
|
||
|
file</h2>
|
||
|
Launch4j requires an xml configuration file for each output executable.
|
||
|
You can create and edit it conveniently using the graphic user
|
||
|
interface or your favorite editor. Alternatively it's possible to pass
|
||
|
all of the configuration parameters through the Ant task. All files
|
||
|
except for <em><jre><path></em>
|
||
|
may be absolute paths or
|
||
|
relative to the configuration file path.<br>
|
||
|
<pre><!-- <strong>Bold</strong> elements are required --><br><strong><launch4jConfig><br></strong> <!-- Header types: 0-GUI, 1-console --><strong><br></strong> <strong><headerType></strong><span class="codeword">0|1</span><strong></headerType></strong><br> <strong><jar></strong><span class="codeword">file</span><span class="codeword"></span><strong></jar><br></strong> <strong><outfile></strong><span class="codeword">file.exe</span><strong><span class="codeword"></span></outfile></strong><br> <errTitle><span class="codeword">text</span></errTitle><br> <jarArgs><span class="codeword">text</span></jarArgs><br> <chdir><span class="codeword">path</span></chdir><br> <customProcName><span class="codeword">true|<u>false</u></span></customProcName><br> <stayAlive><span class="codeword">true|false</span></stayAlive><br> <icon><span class="codeword">file</span></icon><br> <strong><jre><br></strong> <!-- Specify one of the following or both --><br> <strong><path></strong><span class="codeword">path</span><strong></path><br> </strong><strong><minVersion></strong><span class="codeword">x.x.x[_xx]</span><strong></minVersion><br></strong> <maxVersion><span class="codeword">x.x.x[_xx]</span></maxVersion><br> <!-- Heap sizes in MB, 0-use default --><br> <initialHeapSize><span class="codeword">MB</span></initialHeapSize><br> <maxHeapSize><span class="codeword">MB</span></maxHeapSize><br> <args><span class="codeword">text</span></args><br> <strong></jre></strong><br> <splash><br> <strong><file></strong><span class="codeword">file</span><strong></file></strong><br> <waitForWindow><span class="codeword"><u>true</u>|false</span></waitForWindow><br> <timeout><span class="codeword">seconds [60]</span></timeout><br> <timeoutErr><span class="codeword"><u>true</u>|false</span></timeoutErr><br> </splash><br> <versionInfo><br> <strong><fileVersion></strong><span class="codeword">x.x.x.x</span><strong></fileVersion></strong><br> <strong><txtFileVersion></strong><span class="codeword">text</span><strong></txtFileVersion></strong><br> <strong><fileDescription></strong><span class="codeword">text</span><strong></fileDescription></strong><br> <strong><copyright></strong><span class="codeword">text</span><strong></copyright></strong><br> <strong><productVersion></strong><span class="codeword">x.x.x.x</span><strong></productVersion></strong><br> <strong><txtProductVersion></strong><span class="codeword">text</span><strong></txtProductVersion></strong><br> <strong><productName></strong><span class="codeword">text</span><strong></productName></strong><br> <companyName><span class="codeword">text</span></companyName><br> <strong><internalName></strong><span class="codeword">filename</span><strong></internalName></strong><br> <strong><originalFilename></strong><span class="codeword">filename.exe</span><strong></originalFilename></strong><br> </versionInfo><br><strong></launch4jConfig></strong><br></pre>
|
||
|
<dl>
|
||
|
<dt><headerType></dt>
|
||
|
<dd>Type of the header used to
|
||
|
wrap the application.</dd>
|
||
|
</dl>
|
||
|
<table style="text-align: left;" border="1" cellpadding="4" cellspacing="0">
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td style="text-align: center;"><span style="font-weight: bold;">Header </span><span style="font-weight: bold;">type</span><br>
|
||
|
</td>
|
||
|
<td style="white-space: nowrap; text-align: center; font-weight: bold;">App
|
||
|
type<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;"><span style="font-weight: bold;">Launcher</span><br>
|
||
|
</td>
|
||
|
<td style="white-space: nowrap; text-align: center; font-weight: bold;">Splash
|
||
|
screen</td>
|
||
|
<td style="text-align: center; font-weight: bold; white-space: nowrap;">Wait
|
||
|
for the application to
|
||
|
close </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align: center;">0<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;">GUI<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;">javaw<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;">yes<br>
|
||
|
</td>
|
||
|
<td>wrapper
|
||
|
waits only if <em>stayAlive</em>
|
||
|
is set to true, otherwise it terminates immediately or after closing
|
||
|
the splash screen.<br>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align: center;">1<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;">console<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;">java<br>
|
||
|
</td>
|
||
|
<td style="text-align: center;">no<br>
|
||
|
</td>
|
||
|
<td>always waits and
|
||
|
returns application's exit code.<br>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<br>
|
||
|
<dl>
|
||
|
<dt><jar></dt>
|
||
|
<dd>Executable jar to wrap.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><outfile></dt>
|
||
|
<dd>Output executable file.<strong></strong></dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><errTitle></dt>
|
||
|
<dd>Optional,
|
||
|
sets the title of the error message box that's displayed if Java cannot
|
||
|
be found for instance. This usually should contain the name of your
|
||
|
application. The console header prefixes error messages with this
|
||
|
property (myapp: error...)</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><jarArgs></dt>
|
||
|
<dd>Optional, constant
|
||
|
command line arguments.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><chdir></dt>
|
||
|
<dd>Optional. Change current
|
||
|
directory to an arbitrary path relative to the executable. <br>
|
||
|
If you omit this property
|
||
|
or leave it blank it will have no effect. Setting it to <em>.</em>
|
||
|
will change the current dir to the same directory as the executable. <em>..</em>
|
||
|
will change it to the parent directory, and so on.</dd>
|
||
|
<dd>
|
||
|
<pre><chdir>.</chdir></pre>
|
||
|
</dd>
|
||
|
<dd>
|
||
|
<pre><chdir>../somedir</chdir></pre>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><customProcName></dt>
|
||
|
<dd>Optional, defaults to
|
||
|
false.
|
||
|
Set the process name as the executable filename. Creates a temporary
|
||
|
file in launch4j-tmp directory inside the used JRE. These files are
|
||
|
deleted by
|
||
|
any launch4j wrapped application, which sets the process name and uses
|
||
|
the same JRE. The removal takes place when the application <strong>starts</strong>,
|
||
|
so at least one copy of this file will always be present.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><stayAlive></dt>
|
||
|
<dd>Optional, defaults to
|
||
|
false
|
||
|
in GUI header, <em></em>
|
||
|
always true<span style="font-weight: bold;"> </span>in console header.
|
||
|
When enabled the
|
||
|
launcher waits for the Java application to finish and returns it's exit
|
||
|
code.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><icon></dt>
|
||
|
<dd>Application icon in ICO
|
||
|
format. May contain multiple color depths/resolutions.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><jre></dt>
|
||
|
<dd>Required element that groups
|
||
|
JRE settings.</dd>
|
||
|
</dl>
|
||
|
<blockquote>
|
||
|
<dl>
|
||
|
<dt><path>,
|
||
|
<minVersion>, <maxVersion><br>
|
||
|
</dt>
|
||
|
<dd>The <em><path></em>
|
||
|
property
|
||
|
is used
|
||
|
to specify the relative path (to the executable) of an embedded JRE, it
|
||
|
does not rely on the current directory or <em><chdir></em>.
|
||
|
Note that this path is
|
||
|
not checked until the actual application execution. If you'd like the
|
||
|
wrapper to search for a JRE (public or SDK
|
||
|
private) use the <em><minVersion></em>
|
||
|
property, you may also specify the <em><maxVersion></em>
|
||
|
to prevent it from using higher Java versions. Launch4j will always use
|
||
|
the highest version available (in the min/max range of course). You can
|
||
|
also combine these properties to change the startup process...</dd>
|
||
|
</dl>
|
||
|
<div style="margin-left: 40px;">
|
||
|
<dl>
|
||
|
<dt><path></dt>
|
||
|
<dd>Run if bundled JRE and
|
||
|
javaw.exe
|
||
|
are present, otherwise stop with error.</dd>
|
||
|
<dt><path> +
|
||
|
<minVersion> [+ <maxVersion>]</dt>
|
||
|
<dd>Use bundled JRE first,
|
||
|
if it
|
||
|
cannot be located search for Java, if that fails display error message
|
||
|
and open the Java download page.</dd>
|
||
|
<dt><minVersion>
|
||
|
[+ <maxVersion>]</dt>
|
||
|
<dd>Search for Java, if an
|
||
|
appropriate version cannot be found display error message and open the
|
||
|
Java download page.</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
</blockquote>
|
||
|
<blockquote>
|
||
|
<dl>
|
||
|
<dt><initialHeapSize></dt>
|
||
|
<dd>Optional, initial heap
|
||
|
size in MB, 0 - use default.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><maxHeapSize></dt>
|
||
|
<dd>Optional, max heap size in
|
||
|
MB, 0 - use default.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><args></dt>
|
||
|
<dd>Optional, accepts
|
||
|
everything you would normally pass to
|
||
|
java/javaw
|
||
|
launcher: assertion options, system properties and X options.</dd>
|
||
|
</dl>
|
||
|
</blockquote>
|
||
|
<dl>
|
||
|
<dt><splash></dt>
|
||
|
<dd>Optional, groups the splash
|
||
|
screen settings. Allowed only in GUI header.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<blockquote>
|
||
|
<dl>
|
||
|
<dt><file></dt>
|
||
|
<dd>Splash screen image in BMP
|
||
|
format.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><waitForWindow></dt>
|
||
|
<dd>Optional,
|
||
|
defaults to true. Close the splash screen when an application window or
|
||
|
Java error message box appears. If set to false, the splash screen will
|
||
|
be closed on timeout.<br>
|
||
|
</dd>
|
||
|
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><timeout></dt>
|
||
|
<dd>Optional, defaults to
|
||
|
60.
|
||
|
Number of seconds after which the splash screen must be closed. Splash
|
||
|
timeout may cause an error depending on <em><timeoutErr></em>.</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><timeoutErr></dt>
|
||
|
<dd>Optional, defaults to
|
||
|
true.
|
||
|
True signals
|
||
|
an error on splash timeout, false
|
||
|
closes the splash screen quietly.</dd>
|
||
|
</dl>
|
||
|
</blockquote>
|
||
|
<dl>
|
||
|
<dt><versionInfo></dt>
|
||
|
<dd>Optional, version
|
||
|
information to be displayed by the Windows
|
||
|
Explorer.</dd>
|
||
|
</dl>
|
||
|
<blockquote>
|
||
|
<dl>
|
||
|
<dt><fileVersion></dt>
|
||
|
<dd>Version number 'x.x.x.x'<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><txtFileVersion></dt>
|
||
|
<dd>Free form file version,
|
||
|
for example '1.20.RC1'.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><fileDescription></dt>
|
||
|
<dd>File description presented
|
||
|
to the user.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><copyright></dt>
|
||
|
<dd>Legal copyright.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><productVersion></dt>
|
||
|
<dd>Version number 'x.x.x.x'<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><txtProductVersion></dt>
|
||
|
<dd>Free form file version,
|
||
|
for example '1.20.RC1'.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><productName></dt>
|
||
|
<dd>Text.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><companyName></dt>
|
||
|
<dd>Optional text.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><internalName></dt>
|
||
|
<dd>Internal name without
|
||
|
extension, original filename or module
|
||
|
name for example.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl>
|
||
|
<dt><originalFilename></dt>
|
||
|
<dd>Original name of the file
|
||
|
without the path. Allows to determine
|
||
|
whether a file has been renamed by a user.<br>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</blockquote>
|
||
|
<br>
|
||
|
<h2><a name="Importing_1.x_configuration"></a>Importing
|
||
|
1.x
|
||
|
configuration</h2>
|
||
|
It's possible to import a 1.x configuration file using the GUI
|
||
|
interface. Open the file, correct the paths and save it as a new xml
|
||
|
configuration.<br>
|
||
|
<br>
|
||
|
<h2><a name="Ant_task"></a>Ant
|
||
|
task</h2>
|
||
|
You may set a launch4j directory property or change the task definition.
|
||
|
<pre><property name="launch4j.dir" location="/opt/launch4j" /></pre>
|
||
|
Define the task in your Ant build script.<br>
|
||
|
<pre><taskdef name="launch4j"<br> classname="net.sf.launch4j.ant.Launch4jTask"<br> classpath="${launch4j.dir}/launch4j.jar<br> :${launch4j.dir}/lib/xstream.jar" /><br></pre>
|
||
|
Execute the task!<br>
|
||
|
<pre><launch4j configFile="./l4j/demo.xml" /></pre>
|
||
|
You can set or override the following configuration properties...<br>
|
||
|
<em><jar><br>
|
||
|
<outfile><br>
|
||
|
<versionInfo><br>
|
||
|
<fileVersion><br>
|
||
|
<txtFileVersion><br>
|
||
|
<productVersion><br>
|
||
|
<txtProductVersion></em><em><br>
|
||
|
</em>
|
||
|
<pre><launch4j configFile="./l4j/demo.xml"<br> outfile="mydemo.exe"<br> fileVersion="1.0.0.0" txtFileVersion="1.0 RC2" /><br></pre>
|
||
|
You can also define the entire configuration in the task, but it will
|
||
|
not be possible to edit such a file in the GUI mode. All paths except
|
||
|
for <em><chdir></em> and <em><jre><path></em> are
|
||
|
calculated using the <em>basedir</em> project attribute.
|
||
|
<pre><launch4j><br> <config headerType="0" jar="demo.jar" outfile="demo.exe"><br> <jre minVersion="1.4.0" /><br> </config><br></launch4j><br></pre>
|
||
|
</div>
|
||
|
<div id="footer">Copyright
|
||
|
© 2005 Grzegorz Kowal
|
||
|
<br>
|
||
|
<br>
|
||
|
<p><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=95944&type=4" alt="SourceForge.net Logo" border="0" height="37" width="125"></a>
|
||
|
<a href="http://www.nosoftwarepatents.com"><img alt="" src="http://www.nosoftwarepatents.com/banners/90x40_3.jpg" style="border: 0px solid ; width: 90px; height: 40px;"></a>
|
||
|
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" border="0" height="31" width="88"></a>
|
||
|
</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body></html>
|