I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 7212f855 authored by zzz's avatar zzz
Browse files

Upgrade to launch4j 3.0.1 2008-07-20.

The license is BSD for launch4j and MIT for the wrapper code in head/

Changelog is in installer/lib/launch4j/web/changelog.html
Hopefully this will fix installs for 64-bit JRE on 64-bit windows.

The previous version was 2.0-RC3 2005-08-13.
The previous license was GPLv2 for launch4j and LGPLv2.1 for the wrapper code in head/

The bin/ld.exe and bin/windres.exe files were contributed by
i2p users in 2005 so the i2p installer could be built on windows.

They have not been updated for 3.0.1, so pkg builds on windows
will presumably still get 2.0-RC3.
parent d7e90969
No related branches found
No related tags found
No related merge requests found
Showing
with 429 additions and 383 deletions
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
<!-- <requestedExecutionLevel level="highestAvailable" uiAccess="false"/> -->
<!-- <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> -->
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
</assembly>
\ No newline at end of file
Launch4j Cross-platform java application wrapper for creating windows native executables.
Copyright (C) 2005 Grzegorz Kowal
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Head subproject (the code which is attached to the wrapped jars) is
licensed under the GNU Lesser General Public License.
Launch4j may be used for wrapping closed source, commercial applications.
The following projects are used by Launch4j...
MinGW binutils (http://www.mingw.org/)
Commons BeanUtils (http://jakarta.apache.org/commons/beanutils/)
Commons Logging (http://jakarta.apache.org/commons/logging/)
XStream (http://xstream.codehaus.org/)
JGoodies Forms (http://www.jgoodies.com/freeware/forms/)
JGoodies Looks (http://www.jgoodies.com/freeware/looks/)
Foxtrot (http://foxtrot.sourceforge.net/)
Nuvola Icon Theme (http://www.icon-king.com)
Forms were created using Abeille Forms Designer (https://abeille.dev.java.net/)
This product includes software developed by the Apache Software Foundation (http://www.apache.org/).
installer/lib/launch4j/src/images/asterix-o.gif

51 B

installer/lib/launch4j/src/images/asterix.gif

53 B

installer/lib/launch4j/src/images/button_ok.png

883 B

installer/lib/launch4j/src/images/cancel16.png

1.11 KiB

installer/lib/launch4j/src/images/down16.png

912 B

installer/lib/launch4j/src/images/edit_add16.png

1.06 KiB

installer/lib/launch4j/src/images/new16.png

805 B

installer/lib/launch4j/src/images/ok16.png

883 B

installer/lib/launch4j/src/images/up16.png

906 B

versionNumber=3.0.1.0
version=3.0.1
/*
launch4j :: Cross-platform Java application wrapper for creating Windows native executables
Copyright (C) 2005 Grzegorz Kowal
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Created on 2005-04-24
*/
package net.sf.launch4j;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import net.sf.launch4j.binding.InvariantViolationException;
import net.sf.launch4j.config.Config;
import net.sf.launch4j.config.ConfigPersister;
/**
* @author Copyright (C) 2005 Grzegorz Kowal
*/
public class Builder {
private final Log _log;
public Builder(Log log) {
_log = log;
}
/**
* @return Output file path.
*/
public File build() throws BuilderException {
final Config c = ConfigPersister.getInstance().getConfig();
try {
c.validate();
} catch (InvariantViolationException e) {
throw new BuilderException(e.getMessage());
}
File rc = null;
File ro = null;
File outfile = null;
FileInputStream is = null;
FileOutputStream os = null;
final RcBuilder rcb = new RcBuilder();
try {
String basedir = Util.getJarBasedir();
if (basedir == null) {
basedir = ".";
}
rc = rcb.build(c);
ro = File.createTempFile("launch4j", "o");
outfile = ConfigPersister.getInstance().getOutputFile();
Cmd resCmd = new Cmd(basedir);
resCmd.addExe("/bin/windres")
.add(Util.WINDOWS_OS ? "--preprocessor=type" : "--preprocessor=cat")
.add("-J rc -O coff -F pe-i386")
.add(rc.getPath())
.add(ro.getPath());
_log.append("Compiling resources");
Util.exec(resCmd.toString(), _log);
Cmd ldCmd = new Cmd(basedir);
ldCmd.addExe("/bin/ld")
.add("-mi386pe")
.add("--oformat pei-i386")
.add((c.getHeaderType() == Config.GUI_HEADER)
? "--subsystem windows" : "--subsystem console")
.add("-s") // strip symbols
.addFile("/w32api/crt2.o")
.addFile((c.getHeaderType() == Config.GUI_HEADER)
? "/head/guihead.o" : "/head/consolehead.o")
.addFile("/head/head.o")
.addAbsFile(ro.getPath())
.addFile("/w32api/libmingw32.a")
.addFile("/w32api/libgcc.a")
.addFile("/w32api/libmsvcrt.a")
.addFile("/w32api/libkernel32.a")
.addFile("/w32api/libuser32.a")
.addFile("/w32api/libadvapi32.a")
.addFile("/w32api/libshell32.a")
.add("-o")
.addAbsFile(outfile.getPath());
_log.append("Linking");
Util.exec(ldCmd.toString(), _log);
_log.append("Wrapping");
int len;
byte[] buffer = new byte[1024];
is = new FileInputStream(
Util.getAbsoluteFile(ConfigPersister.getInstance().getConfigPath(), c.getJar()));
os = new FileOutputStream(outfile, true);
while ((len = is.read(buffer)) > 0) {
os.write(buffer, 0, len);
}
_log.append("Successfully created " + outfile.getPath());
return outfile;
} catch (IOException e) {
Util.delete(outfile);
_log.append(e.getMessage());
throw new BuilderException(e);
} catch (ExecException e) {
Util.delete(outfile);
String msg = e.getMessage();
if (msg != null && msg.indexOf("windres") != -1) {
_log.append("Generated resource file...\n");
_log.append(rcb.getContent());
}
throw new BuilderException(e);
} finally {
Util.close(is);
Util.close(os);
Util.delete(rc);
Util.delete(ro);
}
}
}
class Cmd {
private final StringBuffer _sb = new StringBuffer();
private final String _basedir;
private final boolean _quote;
public Cmd(String basedir) {
_basedir = basedir;
_quote = basedir.indexOf(' ') != -1;
}
public Cmd add(String s) {
space();
_sb.append(s);
return this;
}
public Cmd addAbsFile(String file) {
space();
boolean quote = file.indexOf(' ') != -1;
if (quote) {
_sb.append('"');
}
_sb.append(file);
if (quote) {
_sb.append('"');
}
return this;
}
public Cmd addFile(String file) {
space();
if (_quote) {
_sb.append('"');
}
_sb.append(_basedir);
_sb.append(file);
if (_quote) {
_sb.append('"');
}
return this;
}
public Cmd addExe(String file) {
return addFile(Util.WINDOWS_OS ? file + ".exe" : file);
}
private void space() {
if (_sb.length() > 0) {
_sb.append(' ');
}
}
public String toString() {
return _sb.toString();
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2007 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Launch4j nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Created on 2005-04-24
*/
package net.sf.launch4j;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import net.sf.launch4j.binding.InvariantViolationException;
import net.sf.launch4j.config.Config;
import net.sf.launch4j.config.ConfigPersister;
/**
* @author Copyright (C) 2005 Grzegorz Kowal
*/
public class Builder {
private final Log _log;
private final File _basedir;
public Builder(Log log) {
_log = log;
_basedir = Util.getJarBasedir();
}
public Builder(Log log, File basedir) {
_log = log;
_basedir = basedir;
}
/**
* @return Output file path.
*/
public File build() throws BuilderException {
final Config c = ConfigPersister.getInstance().getConfig();
try {
c.validate();
} catch (InvariantViolationException e) {
throw new BuilderException(e.getMessage());
}
File rc = null;
File ro = null;
File outfile = null;
FileInputStream is = null;
FileOutputStream os = null;
final RcBuilder rcb = new RcBuilder();
try {
rc = rcb.build(c);
ro = Util.createTempFile("o");
outfile = ConfigPersister.getInstance().getOutputFile();
Cmd resCmd = new Cmd(_basedir);
resCmd.addExe("windres")
.add(Util.WINDOWS_OS ? "--preprocessor=type" : "--preprocessor=cat")
.add("-J rc -O coff -F pe-i386")
.addAbsFile(rc)
.addAbsFile(ro);
_log.append(Messages.getString("Builder.compiling.resources"));
resCmd.exec(_log);
Cmd ldCmd = new Cmd(_basedir);
ldCmd.addExe("ld")
.add("-mi386pe")
.add("--oformat pei-i386")
.add((c.getHeaderType().equals(Config.GUI_HEADER))
? "--subsystem windows" : "--subsystem console")
.add("-s") // strip symbols
.addFiles(c.getHeaderObjects())
.addAbsFile(ro)
.addFiles(c.getLibs())
.add("-o")
.addAbsFile(outfile);
_log.append(Messages.getString("Builder.linking"));
ldCmd.exec(_log);
if (!c.isDontWrapJar()) {
_log.append(Messages.getString("Builder.wrapping"));
int len;
byte[] buffer = new byte[1024];
is = new FileInputStream(Util.getAbsoluteFile(
ConfigPersister.getInstance().getConfigPath(), c.getJar()));
os = new FileOutputStream(outfile, true);
while ((len = is.read(buffer)) > 0) {
os.write(buffer, 0, len);
}
}
_log.append(Messages.getString("Builder.success") + outfile.getPath());
return outfile;
} catch (IOException e) {
Util.delete(outfile);
_log.append(e.getMessage());
throw new BuilderException(e);
} catch (ExecException e) {
Util.delete(outfile);
String msg = e.getMessage();
if (msg != null && msg.indexOf("windres") != -1) {
if (e.getErrLine() != -1) {
_log.append(Messages.getString("Builder.line.has.errors",
String.valueOf(e.getErrLine())));
_log.append(rcb.getLine(e.getErrLine()));
} else {
_log.append(Messages.getString("Builder.generated.resource.file"));
_log.append(rcb.getContent());
}
}
throw new BuilderException(e);
} finally {
Util.close(is);
Util.close(os);
Util.delete(rc);
Util.delete(ro);
}
}
}
class Cmd {
private final List _cmd = new ArrayList();
private final File _basedir;
private final File _bindir;
public Cmd(File basedir) {
_basedir = basedir;
String path = System.getProperty("launch4j.bindir");
if (path == null) {
_bindir = new File(basedir, "bin");
} else {
File bindir = new File(path);
_bindir = bindir.isAbsolute() ? bindir : new File(basedir, path);
}
}
public Cmd add(String s) {
StringTokenizer st = new StringTokenizer(s);
while (st.hasMoreTokens()) {
_cmd.add(st.nextToken());
}
return this;
}
public Cmd addAbsFile(File file) {
_cmd.add(file.getPath());
return this;
}
public Cmd addFile(String pathname) {
_cmd.add(new File(_basedir, pathname).getPath());
return this;
}
public Cmd addExe(String pathname) {
if (Util.WINDOWS_OS) {
pathname += ".exe";
}
_cmd.add(new File(_bindir, pathname).getPath());
return this;
}
public Cmd addFiles(List files) {
for (Iterator iter = files.iterator(); iter.hasNext();) {
addFile((String) iter.next());
}
return this;
}
public void exec(Log log) throws ExecException {
String[] cmd = (String[]) _cmd.toArray(new String[_cmd.size()]);
Util.exec(cmd, log);
}
}
/*
* Created on Jun 4, 2005
*/
package net.sf.launch4j;
/**
* This class allows launch4j to act as a launcher instead of a wrapper.
* It's useful on Windows because an application cannot be a GUI and console one
* at the same time. So there are two launchers that start launch4j.jar: launch4j.exe
* for GUI mode and launch4jc.exe for console operation.
* The Launcher class is packed into an executable jar that contains nothing else but
* the manifest with Class-Path attribute defined as in the application jar. The jar
* is wrapped with launch4j.
*
* @author Copyright (C) 2005 Grzegorz Kowal
*/
public class Launcher {
public static void main(String[] args) {
Main.main(args);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment