Added RMS and clipping alert in tree view

This commit is contained in:
2020-05-23 20:18:49 +01:00
parent 1005619211
commit 19bf57143c
94 changed files with 3437 additions and 204 deletions

30
launch4j/src/LICENSE.txt Normal file
View File

@@ -0,0 +1,30 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2017 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:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder 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 HOLDER 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.

View File

@@ -1,2 +1,2 @@
versionNumber=3.7.0.0
version=3.7
versionNumber=3.12.0.0
version=3.12

View File

@@ -82,6 +82,10 @@ public class Builder {
FileOutputStream os = null;
final RcBuilder rcb = new RcBuilder();
try {
if (c.isJniApplication()) {
_log.append("WARNING: Some features are not implemented in JNI headers, see documentation.");
}
rc = rcb.build(c);
ro = Util.createTempFile("o");
outfile = ConfigPersister.getInstance().getOutputFile();
@@ -102,8 +106,7 @@ public class Builder {
.add("--dynamicbase")
.add("--nxcompat")
.add("--no-seh")
.add((c.getHeaderType().equals(Config.GUI_HEADER))
? "--subsystem windows" : "--subsystem console")
.add(c.isGuiApplication() ? "--subsystem windows" : "--subsystem console")
.add("-s") // strip symbols
.addFiles(c.getHeaderObjects())
.addAbsFile(ro)

View File

@@ -68,6 +68,7 @@ public class Main {
}
} catch (Exception e) {
Log.getConsoleLog().append(e.getMessage());
System.exit(1);
}
}
@@ -85,7 +86,7 @@ public class Main {
" (http://launch4j.sourceforge.net/)\n" +
"Cross-platform Java application wrapper" +
" for creating Windows native executables.\n\n" +
"Copyright (C) 2004, 2015 Grzegorz Kowal\n\n" +
"Copyright (C) 2004, 2018 Grzegorz Kowal\n\n" +
"Launch4j comes with ABSOLUTELY NO WARRANTY.\n" +
"This is free software, licensed under the BSD License.\n" +
"This product includes software developed by the Apache Software Foundation" +

View File

@@ -44,6 +44,7 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.List;
import net.sf.launch4j.config.CharsetID;
import net.sf.launch4j.config.Config;
import net.sf.launch4j.config.ConfigPersister;
import net.sf.launch4j.config.Jre;
@@ -111,7 +112,7 @@ public class RcBuilder {
public static final int INSTANCE_ALREADY_EXISTS_MSG = 105;
private final StringBuffer _sb = new StringBuffer();
public String getContent() {
return _sb.toString();
}
@@ -176,13 +177,19 @@ public class RcBuilder {
}
private void writeResourceFile(File file) throws IOException {
FileOutputStream os = null;
OutputStreamWriter osw = null;
BufferedWriter w = null;
try {
w = new BufferedWriter(new FileWriter(file));
os = new FileOutputStream(file);
osw = new OutputStreamWriter(os, "ISO-8859-1");
w = new BufferedWriter(osw);
w.write(_sb.toString());
} finally {
Util.close(w);
Util.close(osw);
Util.close(os);
}
}
@@ -225,7 +232,9 @@ public class RcBuilder {
"{\n" +
" BLOCK \"StringFileInfo\"\n" +
" {\n" +
" BLOCK \"040904E4\"\n" + // English
" BLOCK \"");
_sb.append(String.format("%04X%04X", v.getLanguage().getId(), CharsetID.MULTILINGUAL.getId()));
_sb.append("\"\n" +
" {\n");
addVerBlockValue("CompanyName", v.getCompanyName());
@@ -233,10 +242,13 @@ public class RcBuilder {
addVerBlockValue("FileVersion", v.getTxtFileVersion());
addVerBlockValue("InternalName", v.getInternalName());
addVerBlockValue("LegalCopyright", v.getCopyright());
addVerBlockValue("LegalTrademarks", v.getTrademarks());
addVerBlockValue("OriginalFilename", v.getOriginalFilename());
addVerBlockValue("ProductName", v.getProductName());
addVerBlockValue("ProductVersion", v.getTxtProductVersion());
_sb.append(" }\n }\nBLOCK \"VarFileInfo\"\n{\nVALUE \"Translation\", 0x0409, 0x04E4\n}\n}");
_sb.append(" }\n }\nBLOCK \"VarFileInfo\"\n{\nVALUE \"Translation\", ");
_sb.append(String.format("0x%04X, 0x%04X", v.getLanguage().getId(), CharsetID.MULTILINGUAL.getId()));
_sb.append("\n}\n}");
}
private void addJre(Jre jre) {

View File

@@ -0,0 +1,110 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2015 Sebastian Bögl
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder 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 HOLDER 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.
*/
package net.sf.launch4j.config;
import java.util.Arrays;
/**
* @see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx">VERSIONINFO resource</a>
* @see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa381057%28v=vs.85%29.aspx">VarFileInfo BLOCK</a>
*/
public enum CharsetID implements Describable {
/** 0x0000 */
ASCII(0, Messages.getString("Charset.ascii")),
/** 0x04E8 */
ARABIC(1256, Messages.getString("Language.arabic")),
/** 0x04E3 */
CYRILLIC(1251, Messages.getString("Charset.cyrillic")),
/** 0x04E5 */
GREEK(1253, Messages.getString("Language.greek")),
/** 0x04E7 */
HEBREW(1255, Messages.getString("Language.hebrew")),
/** 0x03A4 */
SHIFT_JIS(932, Messages.getString("Charset.shift.jis")),
/** 0x03B5 */
SHIFT_KSC(949, Messages.getString("Charset.shift.ksc")),
/** 0x04E2 */
LATIN2(1250, Messages.getString("Charset.latin2")),
/** 0x04E4 */
MULTILINGUAL(1252, Messages.getString("Charset.multilingual")),
/** 0x0B63 */
BIG5(950, Messages.getString("Charset.big5")),
/** 0x04E6 */
TURKISH(1254, Messages.getString("Language.turkish")),
/** 0x04B0 */
UNICODE(1200, Messages.getString("Charset.unicode")),
;
private static final CharsetID[] VALUES = CharsetID.values();
static {
Arrays.sort(VALUES, new DescribableComparator());
}
private final int id;
private final String description;
CharsetID(int id, String description) {
this.id = id;
this.description = description;
}
public int getId() {
return id;
}
@Override
public String toString() {
return description;
}
@Override
public String getDescription() {
return description;
}
@Override
public int getIndex() {
for (int i = 0; i < VALUES.length; i++) {
if (VALUES[i] == this) {
return i;
}
}
// should never happen
return -1;
}
public static CharsetID[] sortedValues() {
return VALUES;
}
}

View File

@@ -53,7 +53,7 @@ public class ClassPath implements IValidatable {
Messages.getString("ClassPath.mainClass"));
Validator.checkOptStrings(paths,
Validator.MAX_PATH,
Validator.MAX_BIG_STR,
Validator.MAX_ARGS,
"paths",
Messages.getString("ClassPath.path"));
}

View File

@@ -63,9 +63,13 @@ public class Config implements IValidatable {
public static final String GUI_HEADER = "gui";
public static final String CONSOLE_HEADER = "console";
public static final String JNI_GUI_HEADER_32 = "jniGui32";
public static final String JNI_CONSOLE_HEADER_32 = "jniConsole32";
private static final String[] HEADER_TYPES = new String[] { GUI_HEADER,
CONSOLE_HEADER };
CONSOLE_HEADER,
JNI_GUI_HEADER_32,
JNI_CONSOLE_HEADER_32 };
private static final String[] PRIORITY_CLASS_NAMES = new String[] { "normal",
"idle",
@@ -119,7 +123,7 @@ public class Config implements IValidatable {
if (!Validator.isEmpty(chdir)) {
Validator.checkRelativeWinPath(chdir, "chdir",
Messages.getString("Config.chdir.relative"));
Validator.checkFalse(chdir.toLowerCase().equals("true")
Validator.checkFalse(chdir.toLowerCase().equals("true")
|| chdir.toLowerCase().equals("false"),
"chdir", Messages.getString("Config.chdir.path"));
}
@@ -135,7 +139,7 @@ public class Config implements IValidatable {
"supportUrl", Messages.getString("Config.support.url"));
Validator.checkIn(getHeaderType(), HEADER_TYPES, "headerType",
Messages.getString("Config.header.type"));
Validator.checkFalse(getHeaderType().equals(CONSOLE_HEADER) && splash != null,
Validator.checkFalse(!isGuiApplication() && splash != null,
"headerType",
Messages.getString("Config.splash.not.impl.by.console.hdr"));
Validator.checkOptStrings(variables,
@@ -147,9 +151,31 @@ public class Config implements IValidatable {
Messages.getString("Config.variables.err"));
Validator.checkIn(getPriority(), PRIORITY_CLASS_NAMES, "priority",
Messages.getString("Config.priority"));
checkJniInvariants();
jre.checkInvariants();
}
private void checkJniInvariants() {
// TODO: Remove once JNI is fully implemented.
if (isJniApplication()) {
Validator.checkTrue(".".equals(chdir), "chdir",
"Only '.' is allowed in change directory.");
Validator.checkTrue(Validator.isEmpty(cmdLine), "cmdLine",
"Constant command line arguments not supported.");
Validator.checkFalse(stayAlive, "stayAlive",
"Stay alive option is not used in JNI, this is the default behavior.");
Validator.checkFalse(restartOnCrash, "restartOnCrash",
"Restart on crash not supported.");
Validator.checkIn(getPriority(), new String[] { "normal" }, "priority",
"Process priority is not supported,");
Validator.checkNotNull(classPath, "classpath", "classpath");
Validator.checkFalse(jre.getBundledJre64Bit(), "jre.bundledJre64Bit",
"64-bit bundled JRE not supported.");
Validator.checkTrue(Jre.RUNTIME_BITS_32.equals(jre.getRuntimeBits()), "jre.runtimeBits",
"64-bit JRE not supported.");
}
}
public void validate() {
checkInvariants();
if (classPath != null) {
@@ -189,10 +215,19 @@ public class Config implements IValidatable {
public void setErrTitle(String errTitle) {
this.errTitle = errTitle;
}
public boolean isGuiApplication() {
return GUI_HEADER.equals(headerType) || JNI_GUI_HEADER_32.equals(headerType);
}
public boolean isJniApplication() {
return JNI_GUI_HEADER_32.equals(headerType)
|| JNI_CONSOLE_HEADER_32.equals(headerType);
}
/** launch4j header file. */
public String getHeaderType() {
return headerType.toLowerCase();
return headerType;
}
public void setHeaderType(String headerType) {
@@ -215,9 +250,7 @@ public class Config implements IValidatable {
public List<String> getHeaderObjects() {
return isCustomHeaderObjects() ? headerObjects
: getHeaderType().equals(GUI_HEADER)
? LdDefaults.GUI_HEADER_OBJECTS
: LdDefaults.CONSOLE_HEADER_OBJECTS;
: LdDefaults.getHeaderObjects(getHeaderTypeIndex());
}
public void setHeaderObjects(List<String> headerObjects) {
@@ -229,7 +262,7 @@ public class Config implements IValidatable {
}
public List<String> getLibs() {
return isCustomLibs() ? libs : LdDefaults.LIBS;
return isCustomLibs() ? libs : LdDefaults.getLibs(headerType);
}
public void setLibs(List<String> libs) {

View File

@@ -0,0 +1,18 @@
package net.sf.launch4j.config;
import java.util.Comparator;
public interface Describable {
String getDescription();
int getIndex();
class DescribableComparator implements Comparator<Describable> {
@Override
public int compare(Describable o1, Describable o2) {
return o1.getDescription().compareTo(o2.getDescription());
}
}
}

View File

@@ -54,8 +54,8 @@ public class Jre implements IValidatable {
public static final String ARGS = "jvmArgs";
// __________________________________________________________________________________
public static final String VERSION_PATTERN = "(\\d\\.){2}\\d(_\\d+)?";
public static final String VERSION_PATTERN = "(1\\.\\d\\.\\d(_\\d{1,3})?)|[1-9][0-9]{0,2}(\\.\\d{1,3}){0,2}";
public static final String JDK_PREFERENCE_JRE_ONLY = "jreOnly";
public static final String JDK_PREFERENCE_PREFER_JRE = "preferJre";
public static final String JDK_PREFERENCE_PREFER_JDK = "preferJdk";
@@ -98,9 +98,9 @@ public class Jre implements IValidatable {
private List<String> options;
public void checkInvariants() {
Validator.checkOptString(minVersion, 10, VERSION_PATTERN,
Validator.checkOptString(minVersion, 20, VERSION_PATTERN,
"jre.minVersion", Messages.getString("Jre.min.version"));
Validator.checkOptString(maxVersion, 10, VERSION_PATTERN,
Validator.checkOptString(maxVersion, 20, VERSION_PATTERN,
"jre.maxVersion", Messages.getString("Jre.max.version"));
if (Validator.isEmpty(path)) {
Validator.checkFalse(bundledJre64Bit, "jre.bundledJre64Bit",
@@ -116,7 +116,7 @@ public class Jre implements IValidatable {
if (!Validator.isEmpty(maxVersion)) {
Validator.checkFalse(Validator.isEmpty(minVersion),
"jre.minVersion", Messages.getString("Jre.specify.min.version"));
Validator.checkTrue(minVersion.compareTo(maxVersion) < 0,
Validator.checkTrue(JreVersion.parseString(minVersion).compareTo(JreVersion.parseString(maxVersion)) < 0,
"jre.maxVersion", Messages.getString("Jre.max.greater.than.min"));
}
Validator.checkTrue(initialHeapSize == null || maxHeapSize != null,
@@ -155,7 +155,7 @@ public class Jre implements IValidatable {
Validator.checkOptStrings(options,
Validator.MAX_ARGS,
Validator.MAX_ARGS,
"[^%]*|([^%]*([^%]*%[^%]+%[^%]*)+[^%]*)*",
"[^%]*|([^%]*([^%]*%[^%]*%[^%]*)+[^%]*)*",
"jre.options",
Messages.getString("Jre.jvm.options"),
Messages.getString("Jre.jvm.options.variable"));

View File

@@ -0,0 +1,124 @@
package net.sf.launch4j.config;
/**
* This class will abstract application from JRE versioning schema and provide
* comparing capabilities
*
* @author sergeyk
*
*/
public class JreVersion implements Comparable<JreVersion> {
private int x1;
private int x2;
private int x3;
private int x4;
public static JreVersion parseString(String versionStr) {
JreVersion ret = new JreVersion();
if (versionStr == null || versionStr.trim().length() == 0) {
return ret;
}
if (!versionStr.matches(Jre.VERSION_PATTERN)) {
// NOTE: This is actually shouldn't happen because version format had to be
// checked by Jre#checkInvariants BEFORE calling this method
throw new IllegalArgumentException("JRE version is not in a right format.");
}
String[] parts = versionStr.split("[\\._]");
int first = Integer.parseInt(parts[0]);
if (first > 1) {
// java 9+ version schema
ret.x1 = 1;
ret.x2 = first;
if (parts.length >= 2) {
ret.x3 = Integer.parseInt(parts[1]);
if (parts.length >= 3) {
ret.x4 = Integer.parseInt(parts[2]);
}
}
} else {
// java <= 1.8 version schema
ret.x1 = first;
if (parts.length >= 2) {
ret.x2 = Integer.parseInt(parts[1]);
if (parts.length >= 3) {
ret.x3 = Integer.parseInt(parts[2]);
if (parts.length == 4) {
ret.x4 = Integer.parseInt(parts[3]);
}
}
}
}
return ret;
}
@Override
public String toString() {
if (x2 >= 9) {
return x2 + "." + x3 + "." + x4;
}
return x1 + "." + x2 + "." + x3 + (x4 > 0 ? "_" + x4 : "");
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + x1;
result = prime * result + x2;
result = prime * result + x3;
result = prime * result + x4;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
JreVersion other = (JreVersion) obj;
if (x1 != other.x1) {
return false;
}
if (x2 != other.x2) {
return false;
}
if (x3 != other.x3) {
return false;
}
if (x4 != other.x4) {
return false;
}
return true;
}
@Override
public int compareTo(JreVersion o) {
if (this.equals(o)) {
return 0;
}
if (x1 != o.x1) {
return x1 - o.x1;
}
if (x2 != o.x2) {
return x2 - o.x2;
}
if (x3 != o.x3) {
return x3 - o.x3;
}
if (x4 != o.x4) {
return x4 - o.x4;
}
throw new IllegalStateException("If you see this exception it means JreVersion::equals() method is buggy");
}
}

View File

@@ -0,0 +1,132 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2015 Sebastian Bögl
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder 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 HOLDER 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.
*/
package net.sf.launch4j.config;
import java.util.Arrays;
/**
* @see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx">VERSIONINFO resource</a>
* @see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa381057%28v=vs.85%29.aspx">VarFileInfo BLOCK</a>
*/
public enum LanguageID implements Describable {
ALBANIAN(0x041C, Messages.getString("Language.albanian")),
ARABIC(0x0401, Messages.getString("Language.arabic")),
BAHASA(0x0421, Messages.getString("Language.bahasa")),
DUTCH_BELGIAN(0x0813, Messages.getString("Language.belgian.dutch")),
FRENCH_BELGIAN(0x080C, Messages.getString("Language.belgian.french")),
BULGARIAN(0x0402, Messages.getString("Language.bulgarian")),
FRENCH_CANADIAN(0x0C0C, Messages.getString("Language.canadian.french")),
CASTILIAN_SPANISH(0x040A, Messages.getString("Language.spanish.castilian")),
CATALAN(0x0403, Messages.getString("Language.catalan")),
CROATO_SERBIAN_LATIN(0x041A, Messages.getString("Language.croato.serbian.latin")),
CZECH(0x0405, Messages.getString("Language.czech")),
DANISH(0x0406, Messages.getString("Language.danish")),
DUTCH(0x0413, Messages.getString("Language.dutch")),
ENGLISH_UK(0x0809, Messages.getString("Language.english.uk")),
ENGLISH_US(0x0409, Messages.getString("Language.english.us")),
FINNISH(0x040B, Messages.getString("Language.finnish")),
FRENCH(0x040C, Messages.getString("Language.french")),
GERMAN(0x0407, Messages.getString("Language.german")),
GREEK(0x0408, Messages.getString("Language.greek")),
HEBREW(0x040D, Messages.getString("Language.hebrew")),
HUNGARIAN(0x040E, Messages.getString("Language.hungarian")),
ICELANDIC(0x040F, Messages.getString("Language.icelandic")),
ITALIAN(0x0410, Messages.getString("Language.italian")),
JAPANESE(0x0411, Messages.getString("Language.japanese")),
KOREAN(0x0412, Messages.getString("Language.korean")),
NORWEGIAN_BOKMAL(0x0414, Messages.getString("Language.norwegian.bokmal")),
NORWEGIAN_NYNORSK(0x0814, Messages.getString("Language.norwegian.nynorsk")),
POLISH(0x0415, Messages.getString("Language.polish")),
PORTUGUESE_BRAZIL(0x0416, Messages.getString("Language.portuguese.brazil")),
PORTUGUESE_PORTUGAL(0x0816, Messages.getString("Language.portuguese.portugal")),
RHAETO_ROMANIC(0x0417, Messages.getString("Language.rhaeto.romanic")),
ROMANIAN(0x0418, Messages.getString("Language.romanian")),
RUSSIAN(0x0419, Messages.getString("Language.russian")),
SERBO_CROATIAN_CYRILLIC(0x081A, Messages.getString("Language.serbo.croatian.cyrillic")),
SIMPLIFIED_CHINESE(0x0804, Messages.getString("Language.chinese.simplified")),
SLOVAK(0x041B, Messages.getString("Language.slovak")),
SPANISH_MEXICO(0x080A, Messages.getString("Language.spanish.mexico")),
SWEDISH(0x041D, Messages.getString("Language.swedish")),
FRENCH_SWISS(0x100C, Messages.getString("Language.swiss.french")),
GERMAN_SWISS(0x0807, Messages.getString("Language.swiss.german")),
ITALIAN_SWISS(0x0810, Messages.getString("Language.swiss.italian")),
THAI(0x041E, Messages.getString("Language.thai")),
TRADITIONAL_CHINESE(0x0404, Messages.getString("Language.chinese.traditional")),
TURKISH(0x041F, Messages.getString("Language.turkish")),
URDU(0x0420, Messages.getString("Language.urdu")),
;
private static final LanguageID[] VALUES = LanguageID.values();
static {
Arrays.sort(VALUES, new DescribableComparator());
}
private final int id;
private final String description;
LanguageID(int id, String description) {
this.id = id;
this.description = description;
}
public int getId() {
return id;
}
@Override
public String getDescription() {
return description;
}
@Override
public String toString() {
return description;
}
@Override
public int getIndex() {
for (int i = 0; i < VALUES.length; i++) {
if (VALUES[i] == this) {
return i;
}
}
// should never happen
return -1;
}
public static LanguageID[] sortedValues() {
return VALUES;
}
}

View File

@@ -36,22 +36,36 @@
*/
package net.sf.launch4j.config;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class LdDefaults {
public static final List<String> GUI_HEADER_OBJECTS = Arrays.asList(new String[] {
private static final List<String> GUI_OBJECTS = Arrays.asList(new String[] {
"w32api/crt2.o",
"head/guihead.o",
"head/head.o" });
public static final List<String> CONSOLE_HEADER_OBJECTS = Arrays.asList(new String[] {
private static final List<String> CONSOLE_OBJECTS = Arrays.asList(new String[] {
"w32api/crt2.o",
"head/consolehead.o",
"head/head.o"});
"head/head.o" });
private static final List<String> JNI_GUI_32_OBJECTS = Arrays.asList(new String[] {
"w32api_jni/crt2.o",
"head_jni_BETA/jniguihead.o",
"head_jni_BETA/head.o",
"head_jni_BETA/jnihead.o" });
public static final List<String> LIBS = Arrays.asList(new String[] {
private static final List<String> JNI_CONSOLE_32_OBJECTS = Arrays.asList(new String[] {
"w32api_jni/crt2.o",
"head_jni_BETA/jniconsolehead.o",
"head_jni_BETA/head.o",
"head_jni_BETA/jnihead.o" });
private static final List<List<String>> HEADER_OBJECTS;
private static final List<String> LIBS = Arrays.asList(new String[] {
"w32api/libmingw32.a",
"w32api/libgcc.a",
"w32api/libmsvcrt.a",
@@ -59,4 +73,45 @@ public class LdDefaults {
"w32api/libuser32.a",
"w32api/libadvapi32.a",
"w32api/libshell32.a" });
private static final List<String> JNI_LIBS = Arrays.asList(new String[] {
"w32api_jni/libmingw32.a",
"w32api_jni/libmingwex.a",
"w32api_jni/libgcc.a",
"w32api_jni/libmsvcrt.a",
"w32api_jni/libmoldname.a",
"w32api_jni/libkernel32.a",
"w32api_jni/libuser32.a",
"w32api_jni/libadvapi32.a",
"w32api_jni/libshell32.a" });
static {
HEADER_OBJECTS = new ArrayList<List<String>>();
HEADER_OBJECTS.add(GUI_OBJECTS);
HEADER_OBJECTS.add(CONSOLE_OBJECTS);
HEADER_OBJECTS.add(JNI_GUI_32_OBJECTS);
HEADER_OBJECTS.add(JNI_CONSOLE_32_OBJECTS);
}
public static List<String> getHeaderObjects(int headerTypeIndex) {
if (headerTypeIndex < 0 || headerTypeIndex > 3) {
throw new IllegalArgumentException("headerTypeIndex is out of range: " + headerTypeIndex);
}
return HEADER_OBJECTS.get(headerTypeIndex);
}
public static List<String> getLibs(String headerType) {
if (Config.GUI_HEADER.equals(headerType)
|| Config.CONSOLE_HEADER.equals(headerType)) {
return LIBS;
}
if (Config.JNI_GUI_HEADER_32.equals(headerType)
|| Config.JNI_CONSOLE_HEADER_32.equals(headerType)) {
return JNI_LIBS;
}
throw new IllegalArgumentException("Unknown headerType: " + headerType);
}
}

View File

@@ -44,6 +44,7 @@ import net.sf.launch4j.binding.Validator;
*/
public class VersionInfo implements IValidatable {
public static final String VERSION_PATTERN = "(\\d+\\.){3}\\d+";
public static final int DEFAULT_LANGUAGE_INDEX = LanguageID.ENGLISH_US.getIndex();
private String fileVersion;
private String txtFileVersion;
@@ -55,6 +56,8 @@ public class VersionInfo implements IValidatable {
private String companyName;
private String internalName;
private String originalFilename;
private String trademarks;
private LanguageID language;
public void checkInvariants() {
Validator.checkString(fileVersion, 20, VERSION_PATTERN,
@@ -77,6 +80,8 @@ public class VersionInfo implements IValidatable {
Messages.getString("VersionInfo.company.name"));
Validator.checkString(internalName, 50, "versionInfo.internalName",
Messages.getString("VersionInfo.internal.name"));
Validator.checkOptString(trademarks, 150, "versionInfo.trademarks",
Messages.getString("VersionInfo.trademarks"));
Validator.checkTrue(!internalName.endsWith(".exe"), "versionInfo.internalName",
Messages.getString("VersionInfo.internal.name.not.exe"));
Validator.checkString(originalFilename, 50, "versionInfo.originalFilename",
@@ -165,4 +170,28 @@ public class VersionInfo implements IValidatable {
public void setTxtProductVersion(String txtProductVersion) {
this.txtProductVersion = txtProductVersion;
}
public String getTrademarks() {
return trademarks;
}
public void setTrademarks(String trademarks) {
this.trademarks = trademarks;
}
public LanguageID getLanguage() {
return (language == null) ? LanguageID.sortedValues()[DEFAULT_LANGUAGE_INDEX] : language;
}
public void setLanguage(LanguageID language) {
this.language = language;
}
public int getLanguageIndex() {
return (language == null) ? DEFAULT_LANGUAGE_INDEX : language.getIndex();
}
public void setLanguageIndex(int index) {
language = LanguageID.sortedValues()[index];
}
}

View File

@@ -63,13 +63,14 @@ VersionInfo.product.version=Product version, should be 'x.x.x.x'
VersionInfo.txt.product.version=Free from product version
VersionInfo.product.name=Product name
VersionInfo.company.name=Company name
VersionInfo.trademarks=Trademarks
VersionInfo.internal.name=Internal name
VersionInfo.internal.name.not.exe=Internal name shouldn't have the .exe extension.
VersionInfo.original.filename=Original filename
VersionInfo.original.filename.exe=Original filename should end with the .exe extension.
Jre.min.version=Minimum JRE version should be x.x.x[_xx]
Jre.max.version=Maximum JRE version should be x.x.x[_xx]
Jre.min.version=Minimum JRE version should be 1.x.x[_xxx] or the Java 9 new version scheme xxx[.xxx[.xxx]], e.g., 1.5, 1.8.0_121, 10.0.1
Jre.max.version=Maximum JRE version should be 1.x.x[_xxx] or the Java 9 new version scheme xxx[.xxx[.xxx]], e.g., 1.5, 1.8.0_121, 10.0.1
Jre.specify.jre.min.version.or.path=Specify minimum JRE version and/or bundled JRE path.
Jre.bundled.path=Bundled JRE path
Jre.bundled.64bit.invalid=The bundled JRE 64-bit option can only be used if the JRE path is specified.
@@ -94,3 +95,57 @@ Msg.launcherErr=Launcher error message
SingleInstance.mutexName=Mutex name
SingleInstance.windowTitle=Window title
Charset.ascii=7-bit ASCII
Charset.unicode=Unicode
Charset.multilingual=Multilingual
Charset.shift.jis=Japan (Shift JIS X-0208)
Charset.shift.ksc=Korea (Shift KSC 5601)
Charset.big5=Taiwan (Big5)
Charset.latin2=Latin-2 (Eastern European)
Charset.cyrillic=Cyrillic
Language.arabic=Arabic
Language.bulgarian=Bulgarian
Language.catalan=Catalan
Language.chinese.traditional=Chinese (Traditional)
Language.czech=Czech
Language.danish=Danish
Language.german=German
Language.english.us=English U.S.
Language.greek=Greek
Language.hebrew=Hebrew
Language.polish=Polish
Language.portuguese.brazil=Portuguese (Brazil)
Language.rhaeto.romanic=Rhaeto Romanic
Language.romanian=Romanian
Language.russian=Russian
Language.spanish.castilian=Spanish (Castilian)
Language.finnish=Finnish
Language.french=French
Language.hungarian=Hungarian
Language.icelandic=Icelandic
Language.italian=Italian
Language.japanese=Japanese
Language.korean=Korean
Language.dutch=Dutch
Language.norwegian.bokmal=Norwegian Bokm\u00E5l
Language.croato.serbian.latin=Croato-Serbian (Latin)
Language.slovak=Slovak
Language.albanian=Albanian
Language.swedish=Swedish
Language.thai=Thai
Language.turkish=Turkish
Language.urdu=Urdu
Language.bahasa=Bahasa
Language.chinese.simplified=Chinese (Simplified)
Language.swiss.german=Swiss German
Language.english.uk=English U.K.
Language.spanish.mexico=Spanish (Mexico)
Language.belgian.french=Belgian French
Language.canadian.french=Canadian French
Language.swiss.italian=Swiss Italian
Language.belgian.dutch=Belgian Dutch
Language.norwegian.nynorsk=Norwegian Nynorsk
Language.portuguese.portugal=Portuguese (Portugal)
Language.serbo.croatian.cyrillic=Serbo-Croatian (Cyrillic)
Language.swiss.french=Swiss French

View File

@@ -229,7 +229,6 @@ public abstract class BasicForm extends JPanel
_errorTitleField.setToolTipText(Messages.getString("errorTitleTip"));
jpanel1.add(_errorTitleField,cc.xywh(4,24,7,1));
_downloadUrlLabel.setIcon(loadImage("images/asterix.gif"));
_downloadUrlLabel.setName("downloadUrlLabel");
_downloadUrlLabel.setText(Messages.getString("downloadUrl"));
jpanel1.add(_downloadUrlLabel,cc.xy(2,26));

View File

@@ -4,6 +4,7 @@ import com.jeta.forms.components.separator.TitledSeparator;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import javax.swing.Box;
@@ -27,6 +28,8 @@ public abstract class HeaderForm extends JPanel
protected final JCheckBox _headerObjectsCheck = new JCheckBox();
protected final JCheckBox _libsCheck = new JCheckBox();
protected final TitledSeparator _linkerOptionsSeparator = new TitledSeparator();
protected final JRadioButton _jniGuiHeaderRadio = new JRadioButton();
protected final JRadioButton _jniConsoleHeaderRadio = new JRadioButton();
/**
* Default constructor
@@ -106,7 +109,7 @@ public abstract class HeaderForm extends JPanel
public JPanel createPanel()
{
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE","CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(0.2),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE","CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(0.2),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
@@ -117,12 +120,14 @@ public abstract class HeaderForm extends JPanel
_guiHeaderRadio.setActionCommand("GUI");
_guiHeaderRadio.setName("guiHeaderRadio");
_guiHeaderRadio.setText(Messages.getString("gui"));
_guiHeaderRadio.setToolTipText(Messages.getString("guiTooltip"));
_headerButtonGroup.add(_guiHeaderRadio);
jpanel1.add(_guiHeaderRadio,cc.xy(4,2));
_consoleHeaderRadio.setActionCommand("Console");
_consoleHeaderRadio.setName("consoleHeaderRadio");
_consoleHeaderRadio.setText(Messages.getString("console"));
_consoleHeaderRadio.setToolTipText(Messages.getString("consoleTooltip"));
_headerButtonGroup.add(_consoleHeaderRadio);
jpanel1.add(_consoleHeaderRadio,cc.xy(6,2));
@@ -131,14 +136,14 @@ public abstract class HeaderForm extends JPanel
jscrollpane1.setViewportView(_headerObjectsTextArea);
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane1,cc.xywh(4,6,4,1));
jpanel1.add(jscrollpane1,cc.xywh(4,6,8,1));
_libsTextArea.setName("libsTextArea");
JScrollPane jscrollpane2 = new JScrollPane();
jscrollpane2.setViewportView(_libsTextArea);
jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane2,cc.xywh(4,8,4,1));
jpanel1.add(jscrollpane2,cc.xywh(4,8,8,1));
_headerObjectsCheck.setActionCommand("Object files");
_headerObjectsCheck.setName("headerObjectsCheck");
@@ -152,9 +157,25 @@ public abstract class HeaderForm extends JPanel
_linkerOptionsSeparator.setName("linkerOptionsSeparator");
_linkerOptionsSeparator.setText(Messages.getString("linkerOptions"));
jpanel1.add(_linkerOptionsSeparator,cc.xywh(2,4,6,1));
jpanel1.add(_linkerOptionsSeparator,cc.xywh(2,4,10,1));
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8 },new int[]{ 1,2,3,4,5,6,7,8,9 });
_jniGuiHeaderRadio.setActionCommand(Messages.getString("jniGui"));
_jniGuiHeaderRadio.setForeground(new Color(255,102,0));
_jniGuiHeaderRadio.setName("jniGuiHeaderRadio");
_jniGuiHeaderRadio.setText(Messages.getString("jniGui"));
_jniGuiHeaderRadio.setToolTipText(Messages.getString("jniGuiTooltip"));
_headerButtonGroup.add(_jniGuiHeaderRadio);
jpanel1.add(_jniGuiHeaderRadio,cc.xy(8,2));
_jniConsoleHeaderRadio.setActionCommand(Messages.getString("jniConsole"));
_jniConsoleHeaderRadio.setForeground(new Color(255,102,0));
_jniConsoleHeaderRadio.setName("jniConsoleHeaderRadio");
_jniConsoleHeaderRadio.setText(Messages.getString("jniConsole"));
_jniConsoleHeaderRadio.setToolTipText(Messages.getString("jniConsoleTooltip"));
_headerButtonGroup.add(_jniConsoleHeaderRadio);
jpanel1.add(_jniConsoleHeaderRadio,cc.xy(10,2));
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12 },new int[]{ 1,2,3,4,5,6,7,8,9 });
return jpanel1;
}

View File

@@ -9,6 +9,7 @@ import java.awt.Dimension;
import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
@@ -37,6 +38,10 @@ public abstract class VersionInfoForm extends JPanel
protected final JTextField _internalNameField = new JTextField();
protected final JLabel _companyNameLabel = new JLabel();
protected final JTextField _companyNameField = new JTextField();
protected final JLabel _languageLabel = new JLabel();
protected final JComboBox _languageCombo = new JComboBox();
protected final JLabel _trademarksLabel = new JLabel();
protected final JTextField _trademarksField = new JTextField();
/**
* Default constructor
@@ -116,7 +121,7 @@ public abstract class VersionInfoForm extends JPanel
public JPanel createPanel()
{
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:60DLU:NONE,FILL:7DLU:NONE,RIGHT:DEFAULT:NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE","CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:60DLU:NONE,FILL:7DLU:NONE,RIGHT:DEFAULT:NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE","CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
@@ -215,7 +220,21 @@ public abstract class VersionInfoForm extends JPanel
_companyNameField.setName("companyNameField");
jpanel1.add(_companyNameField,cc.xywh(4,16,5,1));
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 });
_languageLabel.setName("languageLabel");
_languageLabel.setText(Messages.getString("language"));
jpanel1.add(_languageLabel,cc.xy(2,24));
_languageCombo.setName("languageCombo");
jpanel1.add(_languageCombo,cc.xywh(4,24,3,1));
_trademarksLabel.setName("trademarksLabel");
_trademarksLabel.setText(Messages.getString("trademarks"));
jpanel1.add(_trademarksLabel,cc.xy(2,22));
_trademarksField.setName("trademarksField");
jpanel1.add(_trademarksField,cc.xywh(4,22,5,1));
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 });
return jpanel1;
}

View File

@@ -71,7 +71,13 @@ importClassPath=Import attributes from a jar's manifest.
headerType=Header type:
gui=GUI
guiTooltip=Stable version of the GUI header which uses the javaw.exe launcher.
console=Console
consoleTooltip=Stable version of the console header which uses the java.exe launcher.
jniGui=JNI GUI (beta)
jniGuiTooltip=BETA version of the GUI header which launches the Java VM through JNI.
jniConsole=JNI Console (beta)
jniConsoleTooltip=BETA version of the console header which launches the Java VM through JNI.
objectFiles=Object files:
libs=w32api:
linkerOptions=Custom header - linker options
@@ -141,6 +147,9 @@ originalFilenameTip=Original name of the file without the path. Allows to determ
internalName=Internal name:
internalNameTip=Internal name without extension, original filename or module name for example.
companyName=Company name:
trademarks=Trademarks:
language=Language:
charset=Charset:
addMessages=Add custom messages
startupErr=Startup error:

View File

@@ -40,8 +40,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JRadioButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import net.sf.launch4j.binding.Binding;
import net.sf.launch4j.binding.Bindings;
@@ -58,24 +56,45 @@ public class HeaderFormImpl extends HeaderForm {
public HeaderFormImpl(Bindings bindings) {
_bindings = bindings;
_bindings.add("headerTypeIndex", new JRadioButton[] { _guiHeaderRadio,
_consoleHeaderRadio })
_consoleHeaderRadio,
_jniGuiHeaderRadio,
_jniConsoleHeaderRadio })
.add("headerObjects", "customHeaderObjects", _headerObjectsCheck,
_headerObjectsTextArea)
.add("libs", "customLibs", _libsCheck, _libsTextArea);
_guiHeaderRadio.addChangeListener(new HeaderTypeChangeListener());
_guiHeaderRadio.setActionCommand(Config.GUI_HEADER);
_consoleHeaderRadio.setActionCommand(Config.CONSOLE_HEADER);
_jniGuiHeaderRadio.setActionCommand(Config.JNI_GUI_HEADER_32);
_jniConsoleHeaderRadio.setActionCommand(Config.JNI_CONSOLE_HEADER_32);
ActionListener headerTypeActionListener = new HeaderTypeActionListener();
_guiHeaderRadio.addActionListener(headerTypeActionListener);
_consoleHeaderRadio.addActionListener(headerTypeActionListener);
_jniGuiHeaderRadio.addActionListener(headerTypeActionListener);
_jniConsoleHeaderRadio.addActionListener(headerTypeActionListener);
_headerObjectsCheck.addActionListener(new HeaderObjectsActionListener());
_libsCheck.addActionListener(new LibsActionListener());
}
private void updateLibs() {
if (!_libsCheck.isSelected()) {
ConfigPersister.getInstance().getConfig().setLibs(null);
Binding b = _bindings.getBinding("libs");
b.put(ConfigPersister.getInstance().getConfig());
}
}
private class HeaderTypeChangeListener implements ChangeListener {
public void stateChanged(ChangeEvent e) {
private class HeaderTypeActionListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
Config c = ConfigPersister.getInstance().getConfig();
c.setHeaderType(_guiHeaderRadio.isSelected() ? Config.GUI_HEADER
: Config.CONSOLE_HEADER);
c.setHeaderType(e.getActionCommand());
if (!_headerObjectsCheck.isSelected()) {
Binding b = _bindings.getBinding("headerObjects");
b.put(c);
updateLibs();
}
}
}
@@ -92,11 +111,7 @@ public class HeaderFormImpl extends HeaderForm {
private class LibsActionListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (!_libsCheck.isSelected()) {
ConfigPersister.getInstance().getConfig().setLibs(null);
Binding b = _bindings.getBinding("libs");
b.put(ConfigPersister.getInstance().getConfig());
}
updateLibs();
}
}
}

View File

@@ -69,7 +69,6 @@ import net.sf.launch4j.Util;
import net.sf.launch4j.binding.Binding;
import net.sf.launch4j.binding.BindingException;
import net.sf.launch4j.binding.InvariantViolationException;
import net.sf.launch4j.config.Config;
import net.sf.launch4j.config.ConfigPersister;
import net.sf.launch4j.config.ConfigPersisterException;
@@ -226,7 +225,7 @@ public class MainFrame extends JFrame {
}
private void showConfigName(File config) {
setTitle(Main.getName() + " - " + (config != null ? config.getName()
setTitle(Main.getName() + " - " + (config != null ? config.getName()
: Messages.getString("MainFrame.untitled")));
}
@@ -309,8 +308,8 @@ public class MainFrame extends JFrame {
ConfigPersister.getInstance().getConfig().checkInvariants();
Builder b = new Builder(log);
_outfile = b.build();
setRunEnabled(ConfigPersister.getInstance().getConfig()
.getHeaderType() == Config.GUI_HEADER // TODO fix console app test
setRunEnabled(ConfigPersister.getInstance().getConfig().isGuiApplication()
// TODO fix console app test
&& (Util.WINDOWS_OS || !ConfigPersister.getInstance()
.getConfig().isDontWrapJar()));
} catch (InvariantViolationException ex) {

View File

@@ -36,9 +36,11 @@
*/
package net.sf.launch4j.formimpl;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import net.sf.launch4j.binding.Bindings;
import net.sf.launch4j.config.LanguageID;
import net.sf.launch4j.config.VersionInfo;
import net.sf.launch4j.form.VersionInfoForm;
@@ -48,6 +50,7 @@ import net.sf.launch4j.form.VersionInfoForm;
public class VersionInfoFormImpl extends VersionInfoForm {
public VersionInfoFormImpl(Bindings bindings, JFileChooser fc) {
_languageCombo.setModel(new DefaultComboBoxModel(LanguageID.sortedValues()));
bindings.addOptComponent("versionInfo", VersionInfo.class, _versionInfoCheck)
.add("versionInfo.fileVersion", _fileVersionField)
.add("versionInfo.productVersion", _productVersionField)
@@ -58,6 +61,9 @@ public class VersionInfoFormImpl extends VersionInfoForm {
.add("versionInfo.txtFileVersion", _txtFileVersionField)
.add("versionInfo.txtProductVersion", _txtProductVersionField)
.add("versionInfo.companyName", _companyNameField)
.add("versionInfo.copyright", _copyrightField);
.add("versionInfo.copyright", _copyrightField)
.add("versionInfo.trademarks", _trademarksField)
.add("versionInfo.languageIndex", _languageCombo, VersionInfo.DEFAULT_LANGUAGE_INDEX)
;
}
}

View File

@@ -35,7 +35,7 @@ Main.usage=usage
Builder.compiling.resources=Compiling resources
Builder.linking=Linking
Builder.wrapping=Wrapping
Builder.wrapping=Wrapping\nWARNING: Sign the executable to minimize antivirus false positives or use launching instead of wrapping.
Builder.success=Successfully created
Builder.generated.resource.file=Generated resource file...\n
Builder.line.has.errors=Line {0} has errors...