diff --git a/build.xml b/build.xml
new file mode 100755
index 0000000..79d2e53
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+ Builds, tests, and runs the project ColorOracle.
+
+
+
+
+
+
+
+
+
+
diff --git a/build/built-jar.properties b/build/built-jar.properties
new file mode 100644
index 0000000..ce7418c
--- /dev/null
+++ b/build/built-jar.properties
@@ -0,0 +1,4 @@
+#Thu, 18 Apr 2013 15:04:00 -0700
+
+
+/Users/bernie/Documents/ColorBlindness/ColorOracleWindows/ColorOracle=
diff --git a/build/classes/com/muchsoft/util/Sys.class b/build/classes/com/muchsoft/util/Sys.class
new file mode 100755
index 0000000..0d6e6ea
Binary files /dev/null and b/build/classes/com/muchsoft/util/Sys.class differ
diff --git a/build/classes/ika/colororacle/AboutPanel$1.class b/build/classes/ika/colororacle/AboutPanel$1.class
new file mode 100755
index 0000000..5cf50b5
Binary files /dev/null and b/build/classes/ika/colororacle/AboutPanel$1.class differ
diff --git a/build/classes/ika/colororacle/AboutPanel.class b/build/classes/ika/colororacle/AboutPanel.class
new file mode 100755
index 0000000..74a847e
Binary files /dev/null and b/build/classes/ika/colororacle/AboutPanel.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$1.class b/build/classes/ika/colororacle/ColorOracle$1.class
new file mode 100755
index 0000000..4d6e9f8
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$1.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$10$1.class b/build/classes/ika/colororacle/ColorOracle$10$1.class
new file mode 100755
index 0000000..19bcf6f
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$10$1.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$10.class b/build/classes/ika/colororacle/ColorOracle$10.class
new file mode 100755
index 0000000..8604311
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$10.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$11.class b/build/classes/ika/colororacle/ColorOracle$11.class
new file mode 100755
index 0000000..17cc829
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$11.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$2.class b/build/classes/ika/colororacle/ColorOracle$2.class
new file mode 100755
index 0000000..c1bf103
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$2.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$3.class b/build/classes/ika/colororacle/ColorOracle$3.class
new file mode 100755
index 0000000..bf22362
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$3.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$4.class b/build/classes/ika/colororacle/ColorOracle$4.class
new file mode 100755
index 0000000..1cca379
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$4.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$5.class b/build/classes/ika/colororacle/ColorOracle$5.class
new file mode 100755
index 0000000..1cc2fb3
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$5.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$6.class b/build/classes/ika/colororacle/ColorOracle$6.class
new file mode 100755
index 0000000..acb5ff5
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$6.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$7.class b/build/classes/ika/colororacle/ColorOracle$7.class
new file mode 100755
index 0000000..181d320
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$7.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$8.class b/build/classes/ika/colororacle/ColorOracle$8.class
new file mode 100755
index 0000000..7889e4e
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$8.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$9.class b/build/classes/ika/colororacle/ColorOracle$9.class
new file mode 100755
index 0000000..88ecbff
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$9.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle$Simulation.class b/build/classes/ika/colororacle/ColorOracle$Simulation.class
new file mode 100755
index 0000000..0688ae8
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle$Simulation.class differ
diff --git a/build/classes/ika/colororacle/ColorOracle.class b/build/classes/ika/colororacle/ColorOracle.class
new file mode 100755
index 0000000..7d0856d
Binary files /dev/null and b/build/classes/ika/colororacle/ColorOracle.class differ
diff --git a/build/classes/ika/colororacle/ImageDisplay.class b/build/classes/ika/colororacle/ImageDisplay.class
new file mode 100755
index 0000000..2289abb
Binary files /dev/null and b/build/classes/ika/colororacle/ImageDisplay.class differ
diff --git a/build/classes/ika/colororacle/ImageDisplayWithPanel.class b/build/classes/ika/colororacle/ImageDisplayWithPanel.class
new file mode 100755
index 0000000..5ab0376
Binary files /dev/null and b/build/classes/ika/colororacle/ImageDisplayWithPanel.class differ
diff --git a/build/classes/ika/colororacle/MainWindow.class b/build/classes/ika/colororacle/MainWindow.class
new file mode 100755
index 0000000..3887e87
Binary files /dev/null and b/build/classes/ika/colororacle/MainWindow.class differ
diff --git a/build/classes/ika/colororacle/Screen.class b/build/classes/ika/colororacle/Screen.class
new file mode 100755
index 0000000..2368eb2
Binary files /dev/null and b/build/classes/ika/colororacle/Screen.class differ
diff --git a/build/classes/ika/colororacle/Simulator$1.class b/build/classes/ika/colororacle/Simulator$1.class
new file mode 100755
index 0000000..0fb1d52
Binary files /dev/null and b/build/classes/ika/colororacle/Simulator$1.class differ
diff --git a/build/classes/ika/colororacle/Simulator$RedGreenFilter.class b/build/classes/ika/colororacle/Simulator$RedGreenFilter.class
new file mode 100755
index 0000000..f22fe04
Binary files /dev/null and b/build/classes/ika/colororacle/Simulator$RedGreenFilter.class differ
diff --git a/build/classes/ika/colororacle/Simulator$TritanFilter.class b/build/classes/ika/colororacle/Simulator$TritanFilter.class
new file mode 100755
index 0000000..03bf2a8
Binary files /dev/null and b/build/classes/ika/colororacle/Simulator$TritanFilter.class differ
diff --git a/build/classes/ika/colororacle/Simulator.class b/build/classes/ika/colororacle/Simulator.class
new file mode 100755
index 0000000..6ac4f0c
Binary files /dev/null and b/build/classes/ika/colororacle/Simulator.class differ
diff --git a/build/classes/ika/icons/deutanpanel.png b/build/classes/ika/icons/deutanpanel.png
new file mode 100755
index 0000000..755cb17
Binary files /dev/null and b/build/classes/ika/icons/deutanpanel.png differ
diff --git a/build/classes/ika/icons/icon48x48.png b/build/classes/ika/icons/icon48x48.png
new file mode 100755
index 0000000..9da18db
Binary files /dev/null and b/build/classes/ika/icons/icon48x48.png differ
diff --git a/build/classes/ika/icons/icon_big.png b/build/classes/ika/icons/icon_big.png
new file mode 100755
index 0000000..f42a09f
Binary files /dev/null and b/build/classes/ika/icons/icon_big.png differ
diff --git a/build/classes/ika/icons/menuIcon.gif b/build/classes/ika/icons/menuIcon.gif
new file mode 100755
index 0000000..4309af7
Binary files /dev/null and b/build/classes/ika/icons/menuIcon.gif differ
diff --git a/build/classes/ika/icons/protanpanel.png b/build/classes/ika/icons/protanpanel.png
new file mode 100755
index 0000000..ec0d3b7
Binary files /dev/null and b/build/classes/ika/icons/protanpanel.png differ
diff --git a/build/classes/ika/icons/tritanpanel.png b/build/classes/ika/icons/tritanpanel.png
new file mode 100755
index 0000000..f547d7d
Binary files /dev/null and b/build/classes/ika/icons/tritanpanel.png differ
diff --git a/dist/ColorOracle.jar b/dist/ColorOracle.jar
new file mode 100755
index 0000000..28a6c81
Binary files /dev/null and b/dist/ColorOracle.jar differ
diff --git a/dist/README.TXT b/dist/README.TXT
new file mode 100755
index 0000000..57bd7d3
--- /dev/null
+++ b/dist/README.TXT
@@ -0,0 +1,32 @@
+========================
+BUILD OUTPUT DESCRIPTION
+========================
+
+When you build an Java application project that has a main class, the IDE
+automatically copies all of the JAR
+files on the projects classpath to your projects dist/lib folder. The IDE
+also adds each of the JAR files to the Class-Path element in the application
+JAR files manifest file (MANIFEST.MF).
+
+To run the project from the command line, go to the dist folder and
+type the following:
+
+java -jar "ColorOracle.jar"
+
+To distribute this project, zip up the dist folder (including the lib folder)
+and distribute the ZIP file.
+
+Notes:
+
+* If two JAR files on the project classpath have the same name, only the first
+JAR file is copied to the lib folder.
+* Only JAR files are copied to the lib folder.
+If the classpath contains other types of files or folders, these files (folders)
+are not copied.
+* If a library on the projects classpath also has a Class-Path element
+specified in the manifest,the content of the Class-Path element has to be on
+the projects runtime path.
+* To set a main class in a standard Java project, right-click the project node
+in the Projects window and choose Properties. Then click Run and enter the
+class name in the Main Class field. Alternatively, you can manually type the
+class name in the manifest Main-Class element.
diff --git a/manifest.mf b/manifest.mf
new file mode 100755
index 0000000..328e8e5
--- /dev/null
+++ b/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
new file mode 100755
index 0000000..6210a17
--- /dev/null
+++ b/nbproject/build-impl.xml
@@ -0,0 +1,1400 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+
+
+
+
+
+ java -cp "${run.classpath.with.dist.jar}" ${main.class}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+ Must select one file in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
new file mode 100755
index 0000000..1606e79
--- /dev/null
+++ b/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=0f5ae39e
+build.xml.script.CRC32=18e42ff7
+build.xml.stylesheet.CRC32=240b97a2
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=06d44573
+nbproject/build-impl.xml.script.CRC32=51061edb
+nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties
new file mode 100755
index 0000000..e69de29
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
new file mode 100755
index 0000000..756d231
--- /dev/null
+++ b/nbproject/private/private.properties
@@ -0,0 +1,8 @@
+application.args=
+compile.on.save=false
+do.depend=false
+do.jar=true
+javac.debug=true
+javadoc.preview=true
+jaxbwiz.endorsed.dirs=/Applications/NetBeans/NetBeans 6.8.app/Contents/Resources/NetBeans/ide12/modules/ext/jaxb/api
+user.properties.file=/Users/bernie/Library/Application Support/NetBeans/7.2/build.properties
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
new file mode 100755
index 0000000..6a7ad41
--- /dev/null
+++ b/nbproject/private/private.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+ file:/Users/bernie/Documents/ColorBlindness/ColorOracleWindows/ColorOracle/build.xml
+ file:/Users/bernie/Documents/ColorBlindness/ColorOracleWindows/ColorOracle/src/ika/colororacle/AboutPanel.java
+
+
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100755
index 0000000..6852885
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,80 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+application.args=
+application.title=ColorOracle
+application.vendor=jenny
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/ColorOracle.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=true
+jar.index=${jnlp.enabled}
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
+jnlp.codebase.type=no.codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=default
+jnlp.offline-allowed=false
+jnlp.signed=false
+jnlp.signing=
+jnlp.signing.alias=
+jnlp.signing.keystore=
+main.class=ika.colororacle.ColorOracle
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+src.dir=src
+test.src.dir=test
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100755
index 0000000..b519fb1
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,16 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ ColorOracle
+ 1.6.5
+
+
+
+
+
+
+
+
+
diff --git a/src/com/muchsoft/util/Sys.java b/src/com/muchsoft/util/Sys.java
new file mode 100755
index 0000000..e7c5922
--- /dev/null
+++ b/src/com/muchsoft/util/Sys.java
@@ -0,0 +1,313 @@
+package com.muchsoft.util;
+
+/**
+ *
This class lets you determine which system your Java application runs on. Furthermore, it offers
+ * methods for cross-platform queries for certain paths such as the preferences folder. It is used as
+ * follows:
+ *
if (Sys.isMacOSX())
+ * {
+ * // Mac OS X-specific code goes here...
+ * }
+ * else
+ * {
+ * // code for other systems
+ * }
+ *
+ * // store user's configuration data
+ * DataOutputStream out = new DataOutputStream(
+ * new BufferedOutputStream(
+ * new FileOutputStream(
+ * new File( Sys.getPrefsDirectory(), "config.dat" )
+ * )));
+ * //...
Copyright 1998-2004 by Thomas Much, thomas@muchsoft.com.
+ * This class is free for commercial and non-commercial use,
+ * as long as you do not distribute modified versions of the source code.
+ * If you have any suggestions, bug reports or feature requests, let me know.
+ *
Version History:
+ *
+ *
2004-10-13
+ *
Added a new package, com.muchsoft.util.mac, and a new class, {@link Mac}.
+ *
+ *
+ * @author Thomas Much
+ * @version 2004-10-13
+ */
+
+public class Sys {
+
+
+private static final boolean ismacos;
+private static final boolean ismacosx;
+private static final boolean islinux;
+private static final boolean iswindows;
+private static final boolean isos2;
+
+private static final String homeDir = System.getProperty("user.home");
+private static final String workDir = System.getProperty("user.dir");
+private static final String prefDir;
+private static final String localPrefDir;
+private static final String javaHome;
+
+
+
+static {
+
+ String osname = System.getProperty("os.name");
+ String vendor = System.getProperty("java.vendor");
+ String jhome = System.getProperty("java.home");
+
+ ismacosx = osname.toLowerCase().startsWith("mac os x");
+ ismacos = (!ismacosx) && ((vendor.indexOf("Apple") >= 0) || (osname.indexOf("Mac OS") >= 0));
+ islinux = (osname.indexOf("Linux") >= 0);
+ iswindows = (osname.indexOf("Windows") >= 0);
+ isos2 = (osname.indexOf("OS/2") >= 0);
+
+ if (ismacosx)
+ {
+ String pref = homeDir + "/Library/Preferences";
+ String localPref = "/Library/Preferences";
+
+/* // this way we'd do it ultra-correctly on Mac OS X / Java 1.4,
+ // but then all Java apps would get a menu bar, which might not
+ // be suitable for all situations
+
+ try
+ {
+ Class fileman = Class.forName("com.apple.eio.FileManager");
+
+ java.lang.reflect.Method findFolder =
+ fileman.getMethod("findFolder", new Class[] { short.class, int.class });
+
+ final int kPreferencesFolderType = 0x70726566;
+ final short kUserDomain = -32763;
+ final short kLocalDomain = -32765;
+
+ pref = (String)findFolder.invoke(null,
+ new Object[] { new Short(kUserDomain), new Integer(kPreferencesFolderType) });
+
+ localPref = (String)findFolder.invoke(null,
+ new Object[] { new Short(kLocalDomain), new Integer(kPreferencesFolderType) });
+ }
+ catch (Exception e) {} */
+
+ prefDir = pref;
+ localPrefDir = localPref;
+
+ if ((jhome == null) || (jhome.length() == 0))
+ {
+ jhome = "/Library/Java/Home";
+ }
+ }
+ else
+ {
+ prefDir = homeDir;
+ localPrefDir = (islinux) ? "/etc" : workDir;
+ }
+
+ javaHome = jhome;
+}
+
+
+
+private Sys() { }
+
+
+
+/**
+ * @return true, if the application is running on Mac OS 8/9, false otherwise
+ */
+
+public static boolean isMacOS() {
+
+ return ismacos;
+}
+
+
+
+/**
+ * @return true, if the application is running on Mac OS X, false otherwise
+ */
+
+public static boolean isMacOSX() {
+
+ return ismacosx;
+}
+
+
+
+/**
+ * @return true, if the application is running on a Mac (OS 8, 9 or X), false otherwise
+ */
+
+public static boolean isAMac() {
+
+ return (ismacosx || ismacos);
+}
+
+
+
+/**
+ * @return true, if the application is running on Linux, false otherwise
+ */
+
+public static boolean isLinux() {
+
+ return islinux;
+}
+
+
+
+/**
+ * @return true, if the application is running on Windows, false otherwise
+ */
+
+public static boolean isWindows() {
+
+ return iswindows;
+}
+
+
+
+/**
+ * @return true, if the application is running on OS/2, false otherwise
+ */
+
+public static boolean isOS2() {
+
+ return isos2;
+}
+
+
+
+/**
+ * The home directory contains the user's data and applications. On UNIX systems this directory is denoted
+ * by ~ and can be queried through the system property user.home.
+ * @return the user's home directory without a trailing path separator
+ */
+
+public static String getHomeDirectory() {
+
+ return homeDir;
+}
+
+
+
+/**
+ * The directory from which the application was launched is called the working directory. Its path can
+ * be queried through the system property user.dir.
+ * @return the application's working directory without a trailing path separator
+ */
+
+public static String getWorkingDirectory() {
+
+ return workDir;
+}
+
+
+
+/**
+ * The preferences directory contains the user's configuration files. On Mac OS X, this method returns
+ * ~/Library/Preferences, on all other systems the user's home directory is used.
+ * @return the user's preferences directory without a trailing path separator
+ */
+
+public static String getPrefsDirectory() {
+
+ return prefDir;
+}
+
+
+
+/**
+ * The local preferences directory contains configuration files that are shared by all users on the computer.
+ * On Mac OS X, this method returns /Library/Preferences, on Linux /etc. On all
+ * other systems the application's working directory is used.
+ * Please note: There is no guarantee that your application has permission to use this directory!
+ * @return the shared preferences directory (without a trailing path separator) of all users on a local computer
+ */
+
+public static String getLocalPrefsDirectory() {
+
+ return localPrefDir;
+}
+
+
+
+/**
+ * The Java home directory contains the bin subdirectory and is needed to invoke the Java tools
+ * at runtime. It is specified by the environment variable $JAVA_HOME and can be queried through
+ * the system property java.home. If the variable is not set properly, this method returns
+ * /Library/Java/Home on Mac OS X.
+ * @return the Java home directory without a trailing path separator
+ */
+
+public static String getJavaHome() {
+
+ return javaHome;
+}
+
+
+
+/**
+ * This is a small test case for all the methods in this class.
+ * On Mac OS X you can launch it by simply double-clicking the jar file (output goes to the Console).
+ * On other systems, you can start it with java -classpath .:Sys.jar com.muchsoft.util.Sys
+ * (or java -jar Sys.jar)
+ * @param args not used
+ */
+
+public static void main(String[] args) {
+
+ System.out.println();
+ System.out.println("** com.muchsoft.util.Sys version 2004-10-13");
+ System.out.println("**");
+ System.out.println("** JavaHome: " + getJavaHome());
+ System.out.println("** AppWork: " + getWorkingDirectory());
+ System.out.println("** UserHome: " + getHomeDirectory());
+ System.out.println("** UserPrefs: " + getPrefsDirectory());
+ System.out.println("** LocalPrefs: " + getLocalPrefsDirectory());
+ System.out.println("**");
+ System.out.print( "** System: ");
+
+ if (isMacOSX())
+ {
+ System.out.println("Mac OS X");
+ }
+ else if (isMacOS())
+ {
+ System.out.println("Mac OS 8/9");
+ }
+ else if (isLinux())
+ {
+ System.out.println("Linux");
+ }
+ else if (isWindows())
+ {
+ System.out.println("Windows");
+ }
+ else if (isOS2())
+ {
+ System.out.println("OS/2");
+ }
+ else
+ {
+ System.out.println("unknown");
+ }
+
+ System.out.println("** " + System.getProperty("os.name"));
+ System.out.println("** Java: " + System.getProperty("java.version"));
+ System.out.println("** " + System.getProperty("java.runtime.version"));
+ System.out.println("** " + System.getProperty("java.vm.version"));
+ System.out.println("** " + System.getProperty("java.vendor"));
+ System.out.println("** MRJ: " + System.getProperty("mrj.version"));
+ System.out.println();
+}
+
+}
diff --git a/src/ika/colororacle/AboutPanel.form b/src/ika/colororacle/AboutPanel.form
new file mode 100755
index 0000000..5e35978
--- /dev/null
+++ b/src/ika/colororacle/AboutPanel.form
@@ -0,0 +1,100 @@
+
+
+
diff --git a/src/ika/colororacle/AboutPanel.java b/src/ika/colororacle/AboutPanel.java
new file mode 100755
index 0000000..fb6a950
--- /dev/null
+++ b/src/ika/colororacle/AboutPanel.java
@@ -0,0 +1,106 @@
+/*
+ * AboutPanel.java
+ *
+ * Created on February 5, 2007, 10:00 AM
+ */
+
+package ika.colororacle;
+
+import java.awt.Desktop;
+import java.net.URI;
+import javax.swing.JButton;
+
+/**
+ * About panel for Color Oracle.
+ * @author Bernhard Jenny, Institute of Cartography, ETH Zurich.
+ */
+public class AboutPanel extends javax.swing.JPanel {
+
+ /** Creates new form AboutPanel */
+ public AboutPanel() {
+ initComponents();
+ versionLabel.setText("Java version " + System.getProperty("java.version"));
+ // Before the Desktop API is used (since VM 1.6), first check
+ // whether the API is supported by this particular
+ // virtual machine (VM) on this particular host.
+ this.homepageButton.setEnabled(Desktop.isDesktopSupported());
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ javax.swing.JLabel textLabel = new javax.swing.JLabel();
+ homepageButton = new javax.swing.JButton();
+ javax.swing.JLabel iconLabel = new javax.swing.JLabel();
+ javax.swing.JLabel titleLabel = new javax.swing.JLabel();
+ versionLabel = new javax.swing.JLabel();
+
+ setLayout(new java.awt.GridBagLayout());
+
+ textLabel.setFont(textLabel.getFont().deriveFont(textLabel.getFont().getSize()-2f));
+ textLabel.setText("
Version 1.2.1
Programming by Bernhard Jenny Oregon State University
Ideas, Testing and Icon by Nathaniel Vaughn Kelso, Stamen Design.
Photoshop all versions 3.0-7.0, CS, CS2 on PowerPC Macintosh (OS X, OS 9 and Classic)
+
Photoshop 4.0 / MacOS 8.0 on 68K Macintosh
+
Photoshop 5.0, 7.0 & CS on Windows 98/NT and XP.
+
Paint Shop Pro 9 (may not work correctly with earlier versions due to PSP plugin compatibility issues)
+
reported to work with Photoshop Elements 3.0 (Mac US$79.99/Win US$89.99. Prices at time of writing)
+
+
+
Free software - donation requested
+
+This program is free software licensed under the terms of the GNU General Public License.
+If you use this program and like it, please use PayPal
+to send the author what you think it is worth (US$5 suggested):
+
+
+The program is fully supported. Please contact the author with any bug reports, suggestions or comments.
+
+
To install
+
+
+
Move the plugin into the "File Formats" folder
+ inside your Photoshop Plugins folder:
+
+
On Windows, ICOFormat.8bi
+
On OS X/Classic, icoformat
+
On 68K MacOS, icoformat(68K)
+
+
Quit and relaunch Photoshop, if it's already running.
+
+
+
To use the plugin
+
+
+
Use Photoshop's Open command (File menu) to open .ICO files (which will now appear
+ in the file browser)
+
Use Photoshop's Save command to create .ICO files.
+
+
+
Having trouble?
+
+
+
If you are not sure if the plugin is correctly installed, look for "ICO (Windows Icon)"
+ under Photoshop's "About Plug-in" menu (on Windows, look under "Help"; on OS X, under "Photoshop").
+ If it is not listed:
+
+
check you have downloaded the correct version (Windows/Mac)
+
is it in the "File Formats" subdirectory of Photoshop's "Plugins" folder?
+
have you quit and re-launched Photoshop?
+
+
The plugin is not a Filter or Import/Export plugin, so don't look for it there.
+ It appears as a format option when Opening or Saving (eligible images).
+
The ICO format does not allow images more than 256 pixels high or wide.
+
Only Bitmap, Grey Scale, Indexed and RGB mode images, no more than 8 bits per channel,
+ can be saved as ICO.
+
Using Windows98? If you see messages about "Assertion Failed", please download this
+ alternative build.
+ (Thanks to Qwerky for pointing out this issue.)
+
+
+
Features
+
+
+
Reads and writes .ICO files of 1,4,8 bits as Indexed mode images, and 16,24,32 bit as RGB mode
+
If an input file contains multiple icons, a dialog box prompts to select one
+(indicates pixel size and colour depth of each contained icon).
+
ICO files created by the plugin contain one icon only.
+
In version 1.7 and later, when saving an icon, it is possible to save in either standard ICO
+ or PNG (Vista) compressed formats. The latter format is not compatible with all software.
+
+
+
How to add a "favourites" icon (favicon, favicon.ico) to your web site
+
+
+
Create the file named favicon.ico with your desired graphic
+ (as "standard ICO" format, if asked when saving by version 1.7)
+
Put it at the root level
+ of your web site. (If you want Internet Explorer to recognise it, it must be 16x16 pixels in size.)
+
Put a tag as follows in the <HEAD>...</HEAD> section of your top-level HTML page (home page):
+
+The ICO format has an inherent 1 bit transparency mask (0 = opaque, 1 = transparent), called the AND bitmap.
+
+
When reading or saving an RGB mode image in Photoshop 6.0 or later, layer transparency is used for the mask
+
If the image is Indexed mode, and uses a "transparent index", this will be used to set the icon mask
+
In other cases, the ICO mask is treated as an alpha channel (black = 0 = opaque, white = 255 = transparent)
+
In PNG (Vista) format icons, the alpha channel is simply stored as part of the PNG. There is no separate mask.
+
+
+
Saving indexed mode images
+
+To ensure output files are as compact as possible, the smallest pixel depth is chosen
+ sufficient to represent the colours used by the icon:
+
+
RGB mode: no colour table
+
Indexed/Grey Scale mode with >16 colours: 8 bits per pixel (up to 256 colours in colour table)
+
Indexed/Grey Scale mode with >2 colours: 4 bits per pixel (up to 16 colours in colour table)
+
Bitmap or Indexed/Grey Scale mode with 2 or fewer colours: 1 bit per pixel (up to 2 colours in colour table)
+
+
+
A note on file sizes (Mac only)
+
+Do not be alarmed if the Mac Finder shows an unexpectedly large file size for ICO files saved out of Photoshop.
+The ICO itself is stored in the data fork and is as small as possible (see above).
+
+The Finder's size calculation is increased by Photoshop's prolific "metadata" in the resource fork,
+and does not truly reflect the size of the ICO data. (This is stored for all files saved out of Photoshop,
+regardless of format, and whether image thumbnails and previews are enabled in Preferences.)
+Finder's "K" size is also affected by the volume's minimum allocation size (often 4 or 8K depending on partition size).
+
+On upload to a web site, the data fork alone is copied and the resource fork is stripped, and so this extra data
+(and Finder's padded figure) has no effect or relevance whatsoever. The "true" logical size of the ICO file
+can be confirmed in OS X's Terminal with ls -l in the icon's directory (or files -x br in MPW Shell).
+
+
+The plugin can create 32-bit icons with 8-bit alpha transparency. This will occur in two cases:
+
+
in Photoshop 6.0 or later, saving a layered RGB image (i.e. not flattened)
+
in any version of Photoshop, saving a flat RGB image with 2 or more alpha channels.
+
+
+In the first case, the layer transparency will be used as the ICO alpha.
+The 1-bit "AND mask" is taken from the first alpha channel, or if there is no available alpha channel,
+is derived from layer transparency.
+
+In the second case, the first alpha channel is used to create the 1-bit "AND mask",
+and the second alpha channel becomes the 8-bit ICO alpha.
+
+In both cases, the colour data is set to zero (black) where the icon is transparent.
+This should produce the desired result (complete transparency over the background).
+
+
Still confused, or having trouble?
+
+Don't hesitate to write to us.
+
+
+
+
diff --git a/win/ICOFormat_cs2-1 Folder/gpl.html b/win/ICOFormat_cs2-1 Folder/gpl.html
new file mode 100755
index 0000000..3c5b29f
--- /dev/null
+++ b/win/ICOFormat_cs2-1 Folder/gpl.html
@@ -0,0 +1,616 @@
+
+
+
+GNU General Public License - GNU Project - Free Software Foundation (FSF)
+
+
+
+
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+
+0.
+ This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+
+
+1.
+ You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+
+2.
+ You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+
+
+
+
+a)
+ You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+
+
+
+
+
+
+b)
+ You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+
+
+
+
+
+
+c)
+ If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+
+
+
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+
+
+3.
+ You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+
+
+
+
+
+
+
+a)
+ Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+
+
+
+
+
+
+b)
+ Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+
+
+
+
+
+
+c)
+ Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+
+
+
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+4.
+ You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+
+5.
+ You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+
+
+6.
+ Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+
+
+7.
+ If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+
+8.
+ If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+
+
+9.
+ The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+
+
+
+10.
+ If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+
+
+
NO WARRANTY
+
+
+
+11.
+ BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+
+
+12.
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+
+
+one line to give the program's name and an idea of what it does.
+Copyright (C) yyyyname of author
+
+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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+
+
+
+Gnomovision version 69, Copyright (C) yearname of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w'. This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c'
+for details.
+
+
+
+The hypothetical commands `show w' and `show c' should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w' and
+`show c'; they could even be mouse-clicks or menu items--whatever
+suits your program.
+
+
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+
+
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision'
+(which makes passes at compilers) written
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+
+
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the
+GNU Lesser General Public License
+instead of this License.
+
+
+Please see the
+Translations
+README for information on coordinating and submitting
+translations of this article.
+
+
+
+Copyright notice above.
+51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+
+Verbatim copying and distribution of this entire article is
+permitted in any medium without royalty provided this notice is
+preserved.
+
+
+
+
diff --git a/win/icon/16x16 32bpp.ico b/win/icon/16x16 32bpp.ico
new file mode 100755
index 0000000..e52311b
Binary files /dev/null and b/win/icon/16x16 32bpp.ico differ
diff --git a/win/icon/16x16 32bpp.png b/win/icon/16x16 32bpp.png
new file mode 100755
index 0000000..6b463ef
Binary files /dev/null and b/win/icon/16x16 32bpp.png differ
diff --git a/win/icon/16x16 4bpp.ico b/win/icon/16x16 4bpp.ico
new file mode 100755
index 0000000..dcfad22
Binary files /dev/null and b/win/icon/16x16 4bpp.ico differ
diff --git a/win/icon/16x16 4bpp.png b/win/icon/16x16 4bpp.png
new file mode 100755
index 0000000..9f7c41d
Binary files /dev/null and b/win/icon/16x16 4bpp.png differ
diff --git a/win/icon/16x16 8bpp.gif b/win/icon/16x16 8bpp.gif
new file mode 100755
index 0000000..3f186af
Binary files /dev/null and b/win/icon/16x16 8bpp.gif differ
diff --git a/win/icon/16x16 8bpp.ico b/win/icon/16x16 8bpp.ico
new file mode 100755
index 0000000..7af3c56
Binary files /dev/null and b/win/icon/16x16 8bpp.ico differ
diff --git a/win/icon/32x32 32bpp.ico b/win/icon/32x32 32bpp.ico
new file mode 100755
index 0000000..5a134b6
Binary files /dev/null and b/win/icon/32x32 32bpp.ico differ
diff --git a/win/icon/32x32 32bpp.png b/win/icon/32x32 32bpp.png
new file mode 100755
index 0000000..b296480
Binary files /dev/null and b/win/icon/32x32 32bpp.png differ
diff --git a/win/icon/32x32 4bpp.ico b/win/icon/32x32 4bpp.ico
new file mode 100755
index 0000000..f6540e2
Binary files /dev/null and b/win/icon/32x32 4bpp.ico differ
diff --git a/win/icon/32x32 4bpp.png b/win/icon/32x32 4bpp.png
new file mode 100755
index 0000000..f5a538a
Binary files /dev/null and b/win/icon/32x32 4bpp.png differ
diff --git a/win/icon/32x32 8bpp.gif b/win/icon/32x32 8bpp.gif
new file mode 100755
index 0000000..559d902
Binary files /dev/null and b/win/icon/32x32 8bpp.gif differ
diff --git a/win/icon/32x32 8bpp.ico b/win/icon/32x32 8bpp.ico
new file mode 100755
index 0000000..5a134b6
Binary files /dev/null and b/win/icon/32x32 8bpp.ico differ
diff --git a/win/icon/48x48 32bpp.ico b/win/icon/48x48 32bpp.ico
new file mode 100755
index 0000000..fc5c63f
Binary files /dev/null and b/win/icon/48x48 32bpp.ico differ
diff --git a/win/icon/48x48 32bpp.png b/win/icon/48x48 32bpp.png
new file mode 100755
index 0000000..848d484
Binary files /dev/null and b/win/icon/48x48 32bpp.png differ
diff --git a/win/icon/48x48 4bpp.ico b/win/icon/48x48 4bpp.ico
new file mode 100755
index 0000000..2a28ab7
Binary files /dev/null and b/win/icon/48x48 4bpp.ico differ
diff --git a/win/icon/48x48 4bpp.png b/win/icon/48x48 4bpp.png
new file mode 100755
index 0000000..3762720
Binary files /dev/null and b/win/icon/48x48 4bpp.png differ
diff --git a/win/icon/48x48 8bpp.gif b/win/icon/48x48 8bpp.gif
new file mode 100755
index 0000000..ba94568
Binary files /dev/null and b/win/icon/48x48 8bpp.gif differ
diff --git a/win/icon/48x48 8bpp.ico b/win/icon/48x48 8bpp.ico
new file mode 100755
index 0000000..8aaaba9
Binary files /dev/null and b/win/icon/48x48 8bpp.ico differ
diff --git a/win/icon/4bit Photoshop Windows-LUT.act b/win/icon/4bit Photoshop Windows-LUT.act
new file mode 100755
index 0000000..39f930b
Binary files /dev/null and b/win/icon/4bit Photoshop Windows-LUT.act differ
diff --git a/win/icon/Icon for Windows.rtf b/win/icon/Icon for Windows.rtf
new file mode 100755
index 0000000..e1d1df5
--- /dev/null
+++ b/win/icon/Icon for Windows.rtf
@@ -0,0 +1,23 @@
+{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+{\fonttbl\f0\fnil\fcharset77 Verdana;}
+{\colortbl;\red255\green255\blue255;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
+\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sa260\ql\qnatural
+
+\f0\fs26\fsmilli13200 \cf0 Erstellen von ICO-Icon f\'9fr Windows mit variabler Aufl\'9asung und Farbtiefe\
+\
+Zuerst .ico mit ICOFormat f\'9fr Photoshop erstellen in Gr\'9assen wie unten aufgelistet. Dann alle ico-Files auf ICOBundle draggen und fallen lassen.\
+\
+When you make an icon file you should include at least the following dimensions and color depths: \
+\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural
+\ls1\ilvl0\cf0 {\listtext \'a5 }16x16 4 bpp\
+{\listtext \'a5 }32x32 4 bpp\
+{\listtext \'a5 }48x48 4 bpp\
+{\listtext \'a5 }16x16 8 bpp\
+{\listtext \'a5 }32x32 8 bpp\
+{\listtext \'a5 }48x48 8 bpp\
+{\listtext \'a5 }16x16 32 bpp\
+{\listtext \'a5 }32x32 32 bpp\
+{\listtext \'a5 }48x48 32 bpp}
\ No newline at end of file
diff --git a/win/icon/Thumbs.db b/win/icon/Thumbs.db
new file mode 100755
index 0000000..01f9cb9
Binary files /dev/null and b/win/icon/Thumbs.db differ
diff --git a/win/icons.ico b/win/icons.ico
new file mode 100755
index 0000000..603ea77
Binary files /dev/null and b/win/icons.ico differ
diff --git a/win/launch4j/.classpath b/win/launch4j/.classpath
new file mode 100755
index 0000000..3f7c1e5
--- /dev/null
+++ b/win/launch4j/.classpath
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/win/launch4j/.project b/win/launch4j/.project
new file mode 100755
index 0000000..1c1309d
--- /dev/null
+++ b/win/launch4j/.project
@@ -0,0 +1,17 @@
+
+
+ launch4j
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/win/launch4j/.settings/org.eclipse.core.resources.prefs b/win/launch4j/.settings/org.eclipse.core.resources.prefs
new file mode 100755
index 0000000..4824b80
--- /dev/null
+++ b/win/launch4j/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
diff --git a/win/launch4j/.settings/org.eclipse.core.runtime.prefs b/win/launch4j/.settings/org.eclipse.core.runtime.prefs
new file mode 100755
index 0000000..f8a67de
--- /dev/null
+++ b/win/launch4j/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\r\n
diff --git a/win/launch4j/.settings/org.eclipse.jdt.core.prefs b/win/launch4j/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000..e644e2f
--- /dev/null
+++ b/win/launch4j/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,81 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/win/launch4j/LICENSE.txt b/win/launch4j/LICENSE.txt
new file mode 100755
index 0000000..742ccac
--- /dev/null
+++ b/win/launch4j/LICENSE.txt
@@ -0,0 +1,30 @@
+Launch4j (http://launch4j.sourceforge.net/)
+Cross-platform Java application wrapper for creating Windows native executables.
+
+Copyright (c) 2004, 2011 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.
\ No newline at end of file
diff --git a/win/launch4j/bin/COPYING b/win/launch4j/bin/COPYING
new file mode 100755
index 0000000..60549be
--- /dev/null
+++ b/win/launch4j/bin/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C) 19yy
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/win/launch4j/bin/ld.exe b/win/launch4j/bin/ld.exe
new file mode 100755
index 0000000..5985c0e
Binary files /dev/null and b/win/launch4j/bin/ld.exe differ
diff --git a/win/launch4j/bin/windres.exe b/win/launch4j/bin/windres.exe
new file mode 100755
index 0000000..855b195
Binary files /dev/null and b/win/launch4j/bin/windres.exe differ
diff --git a/win/launch4j/build.xml b/win/launch4j/build.xml
new file mode 100755
index 0000000..d6536bb
--- /dev/null
+++ b/win/launch4j/build.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/win/launch4j/demo/ConsoleApp/ConsoleApp.exe b/win/launch4j/demo/ConsoleApp/ConsoleApp.exe
new file mode 100755
index 0000000..22def69
Binary files /dev/null and b/win/launch4j/demo/ConsoleApp/ConsoleApp.exe differ
diff --git a/win/launch4j/demo/ConsoleApp/ConsoleApp.jar b/win/launch4j/demo/ConsoleApp/ConsoleApp.jar
new file mode 100755
index 0000000..2af4616
Binary files /dev/null and b/win/launch4j/demo/ConsoleApp/ConsoleApp.jar differ
diff --git a/win/launch4j/demo/ConsoleApp/build.bat b/win/launch4j/demo/ConsoleApp/build.bat
new file mode 100755
index 0000000..ed5f704
--- /dev/null
+++ b/win/launch4j/demo/ConsoleApp/build.bat
@@ -0,0 +1,14 @@
+@echo off
+if "%ANT_HOME%"=="" goto noAntHome
+if "%JAVA_HOME%"=="" goto noJavaHome
+call "%ANT_HOME%\bin\ant.bat" exe
+goto end
+
+:noAntHome
+echo ANT_HOME environment variable is not set
+goto end
+
+:noJavaHome
+echo JAVA_HOME environment variable is not set
+
+:end
diff --git a/win/launch4j/demo/ConsoleApp/build.xml b/win/launch4j/demo/ConsoleApp/build.xml
new file mode 100755
index 0000000..7650e11
--- /dev/null
+++ b/win/launch4j/demo/ConsoleApp/build.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/win/launch4j/demo/ConsoleApp/l4j/ConsoleApp.ico b/win/launch4j/demo/ConsoleApp/l4j/ConsoleApp.ico
new file mode 100755
index 0000000..cc4c540
Binary files /dev/null and b/win/launch4j/demo/ConsoleApp/l4j/ConsoleApp.ico differ
diff --git a/win/launch4j/demo/ConsoleApp/lib/readme.txt b/win/launch4j/demo/ConsoleApp/lib/readme.txt
new file mode 100755
index 0000000..ef44ded
--- /dev/null
+++ b/win/launch4j/demo/ConsoleApp/lib/readme.txt
@@ -0,0 +1,8 @@
+Put your jar libs here and the build script will include them
+in the classpath stored inside the jar manifest.
+In order to run your application move the output exe file from
+the dist directory to the same level as lib.
+
+SimpleApp.exe
+lib/
+lib/xml.jar
diff --git a/win/launch4j/demo/ConsoleApp/readme.txt b/win/launch4j/demo/ConsoleApp/readme.txt
new file mode 100755
index 0000000..fa38dc8
--- /dev/null
+++ b/win/launch4j/demo/ConsoleApp/readme.txt
@@ -0,0 +1 @@
+To build the example application set JAVA_HOME and ANT_HOME environment variables.
diff --git a/win/launch4j/demo/ConsoleApp/src/net/sf/launch4j/example/ConsoleApp.java b/win/launch4j/demo/ConsoleApp/src/net/sf/launch4j/example/ConsoleApp.java
new file mode 100755
index 0000000..eb1398c
--- /dev/null
+++ b/win/launch4j/demo/ConsoleApp/src/net/sf/launch4j/example/ConsoleApp.java
@@ -0,0 +1,72 @@
+/*
+ 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.
+*/
+
+package net.sf.launch4j.example;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class ConsoleApp {
+ public static void main(String[] args) {
+ StringBuffer sb = new StringBuffer("Hello World!\n\nJava version: ");
+ sb.append(System.getProperty("java.version"));
+ sb.append("\nJava home: ");
+ sb.append(System.getProperty("java.home"));
+ sb.append("\nCurrent dir: ");
+ sb.append(System.getProperty("user.dir"));
+ if (args.length > 0) {
+ sb.append("\nArgs: ");
+ for (int i = 0; i < args.length; i++) {
+ sb.append(args[i]);
+ sb.append(' ');
+ }
+ }
+ sb.append("\n\nEnter a line of text, Ctrl-C to stop.\n\n>");
+ System.out.print(sb.toString());
+ try {
+ BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
+ String line;
+ while ((line = is.readLine()) != null && !line.equalsIgnoreCase("quit")) {
+ System.out.print("You wrote: " + line + "\n\n>");
+ }
+ is.close();
+ System.exit(123);
+ } catch (IOException e) {
+ System.err.print(e);
+ }
+ }
+}
diff --git a/win/launch4j/demo/LICENSE.txt b/win/launch4j/demo/LICENSE.txt
new file mode 100755
index 0000000..d6d6bb5
--- /dev/null
+++ b/win/launch4j/demo/LICENSE.txt
@@ -0,0 +1,30 @@
+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.
\ No newline at end of file
diff --git a/win/launch4j/demo/SimpleApp/SimpleApp.exe b/win/launch4j/demo/SimpleApp/SimpleApp.exe
new file mode 100755
index 0000000..886935c
Binary files /dev/null and b/win/launch4j/demo/SimpleApp/SimpleApp.exe differ
diff --git a/win/launch4j/demo/SimpleApp/SimpleApp.jar b/win/launch4j/demo/SimpleApp/SimpleApp.jar
new file mode 100755
index 0000000..02d627b
Binary files /dev/null and b/win/launch4j/demo/SimpleApp/SimpleApp.jar differ
diff --git a/win/launch4j/demo/SimpleApp/build.bat b/win/launch4j/demo/SimpleApp/build.bat
new file mode 100755
index 0000000..ed5f704
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/build.bat
@@ -0,0 +1,14 @@
+@echo off
+if "%ANT_HOME%"=="" goto noAntHome
+if "%JAVA_HOME%"=="" goto noJavaHome
+call "%ANT_HOME%\bin\ant.bat" exe
+goto end
+
+:noAntHome
+echo ANT_HOME environment variable is not set
+goto end
+
+:noJavaHome
+echo JAVA_HOME environment variable is not set
+
+:end
diff --git a/win/launch4j/demo/SimpleApp/build.xml b/win/launch4j/demo/SimpleApp/build.xml
new file mode 100755
index 0000000..fd2b286
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/build.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/win/launch4j/demo/SimpleApp/l4j/SimpleApp.ico b/win/launch4j/demo/SimpleApp/l4j/SimpleApp.ico
new file mode 100755
index 0000000..cc4c540
Binary files /dev/null and b/win/launch4j/demo/SimpleApp/l4j/SimpleApp.ico differ
diff --git a/win/launch4j/demo/SimpleApp/l4j/SimpleApp.xml b/win/launch4j/demo/SimpleApp/l4j/SimpleApp.xml
new file mode 100755
index 0000000..66f33d7
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/l4j/SimpleApp.xml
@@ -0,0 +1,18 @@
+
+ gui
+ ../SimpleApp.jar
+ ../SimpleApp.exe
+ SimpleApp
+ .
+ true
+ SimpleApp.ico
+
+ 1.6.0
+
+
+ splash.bmp
+ true
+ 60
+ true
+
+
\ No newline at end of file
diff --git a/win/launch4j/demo/SimpleApp/l4j/splash.bmp b/win/launch4j/demo/SimpleApp/l4j/splash.bmp
new file mode 100755
index 0000000..88d7bbf
Binary files /dev/null and b/win/launch4j/demo/SimpleApp/l4j/splash.bmp differ
diff --git a/win/launch4j/demo/SimpleApp/launch4j.log b/win/launch4j/demo/SimpleApp/launch4j.log
new file mode 100755
index 0000000..a3f4a30
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/launch4j.log
@@ -0,0 +1,20 @@
+
+
+CmdLine: D:\Home\Greg\src\launch4j\demo\SimpleApp\SimpleApp.exe --l4j-debug
+WOW64: yes
+Working dir: D:\Home\Greg\src\launch4j\demo\SimpleApp\.
+Check launcher: (n/a)
+64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
+Match: SOFTWARE\JavaSoft\Java Runtime Environment\1.7
+Match: SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_09
+Using 64-bit runtime.
+64-bit search: SOFTWARE\JavaSoft\Java Development Kit...
+Ignore: SOFTWARE\JavaSoft\Java Development Kit\1.7
+Ignore: SOFTWARE\JavaSoft\Java Development Kit\1.7.0_09
+Using 64-bit runtime.
+Check launcher: C:\Program Files\Java\jre7\bin\javaw.exe (OK)
+Copy: C:\Program Files\Java\jre7\bin\javaw.exe -> C:\Program Files\Java\jre7\launch4j-tmp\SimpleApp.exe
+Launcher: C:\Program Files\Java\jre7\bin\javaw.exe
+Launcher args: -jar "D:\Home\Greg\src\launch4j\demo\SimpleApp\SimpleApp.exe"
+Args length: 61/32768 chars
+Exit code: 259
diff --git a/win/launch4j/demo/SimpleApp/lib/readme.txt b/win/launch4j/demo/SimpleApp/lib/readme.txt
new file mode 100755
index 0000000..ef44ded
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/lib/readme.txt
@@ -0,0 +1,8 @@
+Put your jar libs here and the build script will include them
+in the classpath stored inside the jar manifest.
+In order to run your application move the output exe file from
+the dist directory to the same level as lib.
+
+SimpleApp.exe
+lib/
+lib/xml.jar
diff --git a/win/launch4j/demo/SimpleApp/readme.txt b/win/launch4j/demo/SimpleApp/readme.txt
new file mode 100755
index 0000000..fa38dc8
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/readme.txt
@@ -0,0 +1 @@
+To build the example application set JAVA_HOME and ANT_HOME environment variables.
diff --git a/win/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/SimpleApp.java b/win/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/SimpleApp.java
new file mode 100755
index 0000000..8e87c59
--- /dev/null
+++ b/win/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/SimpleApp.java
@@ -0,0 +1,104 @@
+/*
+ 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.
+*/
+
+package net.sf.launch4j.example;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.UIManager;
+
+public class SimpleApp extends JFrame {
+ public SimpleApp(String[] args) {
+ super("Java Application");
+ final int inset = 100;
+ Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+ setBounds (inset, inset,
+ screenSize.width - inset * 2, screenSize.height - inset * 2);
+
+ JMenu menu = new JMenu("File");
+ menu.add(new JMenuItem("Open"));
+ menu.add(new JMenuItem("Save"));
+ JMenuBar mb = new JMenuBar();
+ mb.setOpaque(true);
+ mb.add(menu);
+ setJMenuBar(mb);
+
+ this.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ System.exit(123);
+ }});
+ setVisible(true);
+
+ StringBuffer sb = new StringBuffer("Java version: ");
+ sb.append(System.getProperty("java.version"));
+ sb.append("\nJava home: ");
+ sb.append(System.getProperty("java.home"));
+ sb.append("\nCurrent dir: ");
+ sb.append(System.getProperty("user.dir"));
+ if (args.length > 0) {
+ sb.append("\nArgs: ");
+ for (int i = 0; i < args.length; i++) {
+ sb.append(args[i]);
+ sb.append(' ');
+ }
+ }
+ JOptionPane.showMessageDialog(this,
+ sb.toString(),
+ "Info",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ public static void setLAF() {
+ JFrame.setDefaultLookAndFeelDecorated(true);
+ Toolkit.getDefaultToolkit().setDynamicLayout(true);
+ System.setProperty("sun.awt.noerasebackground","true");
+ try {
+ UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+ } catch (Exception e) {
+ System.err.println("Failed to set LookAndFeel");
+ }
+ }
+
+ public static void main(String[] args) {
+ setLAF();
+ new SimpleApp(args);
+ }
+}
diff --git a/win/launch4j/demo/readme.txt b/win/launch4j/demo/readme.txt
new file mode 100755
index 0000000..f591782
--- /dev/null
+++ b/win/launch4j/demo/readme.txt
@@ -0,0 +1,3 @@
+JRE/SDK 1.4.0 or higher must be installed on your system to run this demo.
+
+try running it with some command line arguments...
diff --git a/win/launch4j/head/LICENSE.txt b/win/launch4j/head/LICENSE.txt
new file mode 100755
index 0000000..1f8f12f
--- /dev/null
+++ b/win/launch4j/head/LICENSE.txt
@@ -0,0 +1,23 @@
+Copyright (c) 2004, 2007 Grzegorz Kowal
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Except as contained in this notice, the name(s) of the above copyright holders
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/win/launch4j/head/consolehead.o b/win/launch4j/head/consolehead.o
new file mode 100755
index 0000000..739d976
Binary files /dev/null and b/win/launch4j/head/consolehead.o differ
diff --git a/win/launch4j/head/guihead.o b/win/launch4j/head/guihead.o
new file mode 100755
index 0000000..e830aa9
Binary files /dev/null and b/win/launch4j/head/guihead.o differ
diff --git a/win/launch4j/head/head.o b/win/launch4j/head/head.o
new file mode 100755
index 0000000..b87fbde
Binary files /dev/null and b/win/launch4j/head/head.o differ
diff --git a/win/launch4j/head_src/LICENSE.txt b/win/launch4j/head_src/LICENSE.txt
new file mode 100755
index 0000000..607996f
--- /dev/null
+++ b/win/launch4j/head_src/LICENSE.txt
@@ -0,0 +1,23 @@
+Copyright (c) 2004, 2011 Grzegorz Kowal
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Except as contained in this notice, the name(s) of the above copyright holders
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/win/launch4j/head_src/consolehead/Makefile.win b/win/launch4j/head_src/consolehead/Makefile.win
new file mode 100755
index 0000000..349e4c0
--- /dev/null
+++ b/win/launch4j/head_src/consolehead/Makefile.win
@@ -0,0 +1,33 @@
+# Project: consolehead
+# Makefile created by Dev-C++ 4.9.9.2
+
+CPP = g++.exe
+CC = gcc.exe
+WINDRES = windres.exe
+RES =
+OBJ = ../../head/consolehead.o ../../head/head.o $(RES)
+LINKOBJ = ../../head/consolehead.o ../../head/head.o $(RES)
+LIBS = -L"C:/Dev-Cpp/lib" -n -s
+INCS = -I"C:/Dev-Cpp/include"
+CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
+BIN = consolehead.exe
+CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
+CFLAGS = $(INCS) -fexpensive-optimizations -O3
+RM = rm -f
+
+.PHONY: all all-before all-after clean clean-custom
+
+all: all-before consolehead.exe all-after
+
+
+clean: clean-custom
+ ${RM} $(OBJ) $(BIN)
+
+$(BIN): $(OBJ)
+# $(CC) $(LINKOBJ) -o "consolehead.exe" $(LIBS)
+
+../../head/consolehead.o: consolehead.c
+ $(CC) -c consolehead.c -o ../../head/consolehead.o $(CFLAGS)
+
+../../head/head.o: ../head.c
+ $(CC) -c ../head.c -o ../../head/head.o $(CFLAGS)
diff --git a/win/launch4j/head_src/consolehead/consolehead.c b/win/launch4j/head_src/consolehead/consolehead.c
new file mode 100755
index 0000000..755a767
--- /dev/null
+++ b/win/launch4j/head_src/consolehead/consolehead.c
@@ -0,0 +1,65 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2007 Grzegorz Kowal
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ Except as contained in this notice, the name(s) of the above copyright holders
+ shall not be used in advertising or otherwise to promote the sale, use or other
+ dealings in this Software without prior written authorization.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "../resource.h"
+#include "../head.h"
+
+int main(int argc, char* argv[])
+{
+ setConsoleFlag();
+ LPTSTR cmdLine = GetCommandLine();
+ if (*cmdLine == '"') {
+ if (*(cmdLine = strchr(cmdLine + 1, '"') + 1)) {
+ cmdLine++;
+ }
+ } else if ((cmdLine = strchr(cmdLine, ' ')) != NULL) {
+ cmdLine++;
+ } else {
+ cmdLine = "";
+ }
+ int result = prepare(cmdLine);
+ if (result == ERROR_ALREADY_EXISTS) {
+ char errMsg[BIG_STR] = {0};
+ loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
+ msgBox(errMsg);
+ closeLogFile();
+ return 2;
+ }
+ if (result != TRUE) {
+ signalError();
+ return 1;
+ }
+
+ result = (int) execute(TRUE);
+ if (result == -1) {
+ signalError();
+ } else {
+ return result;
+ }
+}
diff --git a/win/launch4j/head_src/consolehead/consolehead.dev b/win/launch4j/head_src/consolehead/consolehead.dev
new file mode 100755
index 0000000..a309ec9
--- /dev/null
+++ b/win/launch4j/head_src/consolehead/consolehead.dev
@@ -0,0 +1,108 @@
+[Project]
+FileName=consolehead.dev
+Name=consolehead
+UnitCount=4
+Type=1
+Ver=1
+ObjFiles=
+Includes=
+Libs=
+PrivateResource=
+ResourceIncludes=
+MakeIncludes=
+Compiler=
+CppCompiler=
+Linker=-n_@@_
+IsCpp=0
+Icon=
+ExeOutput=
+ObjectOutput=..\..\head
+OverrideOutput=0
+OverrideOutputName=consolehead.exe
+HostApplication=
+Folders=
+CommandLine=
+UseCustomMakefile=0
+CustomMakefile=Makefile.win
+IncludeVersionInfo=0
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=0000000001001000000100
+
+[Unit1]
+FileName=consolehead.c
+CompileCpp=0
+Folder=consolehead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=1
+Build=1
+LanguageID=1033
+CharsetID=1252
+CompanyName=
+FileVersion=
+FileDescription=Developed using the Dev-C++ IDE
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=
+AutoIncBuildNr=0
+
+[Unit2]
+FileName=..\resource.h
+CompileCpp=0
+Folder=consolehead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit3]
+FileName=..\head.c
+CompileCpp=0
+Folder=consolehead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit4]
+FileName=..\head.h
+CompileCpp=0
+Folder=consolehead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit5]
+FileName=..\head.rc
+Folder=consolehead
+Compile=1
+Link=0
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit6]
+FileName=..\resid.h
+CompileCpp=0
+Folder=consolehead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
diff --git a/win/launch4j/head_src/guihead/Makefile.win b/win/launch4j/head_src/guihead/Makefile.win
new file mode 100755
index 0000000..30cee56
--- /dev/null
+++ b/win/launch4j/head_src/guihead/Makefile.win
@@ -0,0 +1,33 @@
+# Project: guihead
+# Makefile created by Dev-C++ 4.9.9.2
+
+CPP = g++.exe
+CC = gcc.exe
+WINDRES = windres.exe
+RES =
+OBJ = ../../head/guihead.o ../../head/head.o $(RES)
+LINKOBJ = ../../head/guihead.o ../../head/head.o $(RES)
+LIBS = -L"C:/Dev-Cpp/lib" -mwindows -n -s
+INCS = -I"C:/Dev-Cpp/include"
+CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
+BIN = guihead.exe
+CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
+CFLAGS = $(INCS) -fexpensive-optimizations -O3
+RM = rm -f
+
+.PHONY: all all-before all-after clean clean-custom
+
+all: all-before guihead.exe all-after
+
+
+clean: clean-custom
+ ${RM} $(OBJ) $(BIN)
+
+$(BIN): $(OBJ)
+# $(CC) $(LINKOBJ) -o "guihead.exe" $(LIBS)
+
+../../head/guihead.o: guihead.c
+ $(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
+
+../../head/head.o: ../head.c
+ $(CC) -c ../head.c -o ../../head/head.o $(CFLAGS)
diff --git a/win/launch4j/head_src/guihead/guihead.c b/win/launch4j/head_src/guihead/guihead.c
new file mode 100755
index 0000000..508a5bd
--- /dev/null
+++ b/win/launch4j/head_src/guihead/guihead.c
@@ -0,0 +1,185 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2007 Grzegorz Kowal
+ Sylvain Mina (single instance patch)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ Except as contained in this notice, the name(s) of the above copyright holders
+ shall not be used in advertising or otherwise to promote the sale, use or other
+ dealings in this Software without prior written authorization.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "../resource.h"
+#include "../head.h"
+#include "guihead.h"
+
+extern FILE* hLog;
+extern PROCESS_INFORMATION pi;
+
+HWND hWnd;
+DWORD dwExitCode = 0;
+BOOL stayAlive = FALSE;
+BOOL splash = FALSE;
+BOOL splashTimeoutErr;
+BOOL waitForWindow;
+int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
+
+int APIENTRY WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow) {
+ int result = prepare(lpCmdLine);
+ if (result == ERROR_ALREADY_EXISTS) {
+ HWND handle = getInstanceWindow();
+ ShowWindow(handle, SW_SHOW);
+ SetForegroundWindow(handle);
+ closeLogFile();
+ return 2;
+ }
+ if (result != TRUE) {
+ signalError();
+ return 1;
+ }
+
+ splash = loadBool(SHOW_SPLASH)
+ && strstr(lpCmdLine, "--l4j-no-splash") == NULL;
+ stayAlive = loadBool(GUI_HEADER_STAYS_ALIVE)
+ && strstr(lpCmdLine, "--l4j-dont-wait") == NULL;
+ if (splash || stayAlive) {
+ hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
+ WS_POPUP | SS_BITMAP,
+ 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
+ if (splash) {
+ char timeout[10] = {0};
+ if (loadString(SPLASH_TIMEOUT, timeout)) {
+ splashTimeout = atoi(timeout);
+ if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT) {
+ splashTimeout = DEFAULT_SPLASH_TIMEOUT;
+ }
+ }
+ splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
+ && strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
+ waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
+ HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
+ MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
+ IMAGE_BITMAP, // type of image
+ 0, // desired width
+ 0, // desired height
+ LR_DEFAULTSIZE);
+ if (hImage == NULL) {
+ signalError();
+ return 1;
+ }
+ SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
+ RECT rect;
+ GetWindowRect(hWnd, &rect);
+ int x = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
+ int y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
+ SetWindowPos(hWnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
+ ShowWindow(hWnd, nCmdShow);
+ UpdateWindow (hWnd);
+ }
+ if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc)) {
+ signalError();
+ return 1;
+ }
+ }
+ if (execute(FALSE) == -1) {
+ signalError();
+ return 1;
+ }
+ if (!(splash || stayAlive)) {
+ debug("Exit code:\t0\n");
+ closeHandles();
+ return 0;
+ }
+
+ MSG msg;
+ while (GetMessage(&msg, NULL, 0, 0)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ debug("Exit code:\t%d\n", dwExitCode);
+ closeHandles();
+ return dwExitCode;
+}
+
+HWND getInstanceWindow() {
+ char windowTitle[STR];
+ char instWindowTitle[STR] = {0};
+ if (loadString(INSTANCE_WINDOW_TITLE, instWindowTitle)) {
+ HWND handle = FindWindowEx(NULL, NULL, NULL, NULL);
+ while (handle != NULL) {
+ GetWindowText(handle, windowTitle, STR - 1);
+ if (strstr(windowTitle, instWindowTitle) != NULL) {
+ return handle;
+ } else {
+ handle = FindWindowEx(NULL, handle, NULL, NULL);
+ }
+ }
+ }
+ return NULL;
+}
+
+BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam) {
+ DWORD processId;
+ GetWindowThreadProcessId(hwnd, &processId);
+ if (pi.dwProcessId == processId) {
+ LONG styles = GetWindowLong(hwnd, GWL_STYLE);
+ if ((styles & WS_VISIBLE) != 0) {
+ splash = FALSE;
+ ShowWindow(hWnd, SW_HIDE);
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+VOID CALLBACK TimerProc(
+ HWND hwnd, // handle of window for timer messages
+ UINT uMsg, // WM_TIMER message
+ UINT idEvent, // timer identifier
+ DWORD dwTime) { // current system time
+
+ if (splash) {
+ if (splashTimeout == 0) {
+ splash = FALSE;
+ ShowWindow(hWnd, SW_HIDE);
+ if (waitForWindow && splashTimeoutErr) {
+ KillTimer(hwnd, ID_TIMER);
+ signalError();
+ PostQuitMessage(0);
+ }
+ } else {
+ splashTimeout--;
+ if (waitForWindow) {
+ EnumWindows(enumwndfn, 0);
+ }
+ }
+ }
+ GetExitCodeProcess(pi.hProcess, &dwExitCode);
+ if (dwExitCode != STILL_ACTIVE
+ || !(splash || stayAlive)) {
+ KillTimer(hWnd, ID_TIMER);
+ PostQuitMessage(0);
+ }
+}
diff --git a/win/launch4j/head_src/guihead/guihead.dev b/win/launch4j/head_src/guihead/guihead.dev
new file mode 100755
index 0000000..7c30088
--- /dev/null
+++ b/win/launch4j/head_src/guihead/guihead.dev
@@ -0,0 +1,109 @@
+[Project]
+FileName=guihead.dev
+Name=guihead
+UnitCount=5
+Type=0
+Ver=1
+ObjFiles=
+Includes=
+Libs=
+PrivateResource=
+ResourceIncludes=
+MakeIncludes=
+Compiler=
+CppCompiler=
+Linker=-n_@@_
+IsCpp=0
+Icon=
+ExeOutput=
+ObjectOutput=..\..\head
+OverrideOutput=0
+OverrideOutputName=guihead.exe
+HostApplication=
+Folders=
+CommandLine=
+UseCustomMakefile=1
+CustomMakefile=Makefile.win
+IncludeVersionInfo=0
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=0000000001001000000100
+
+[Unit1]
+FileName=guihead.c
+CompileCpp=0
+Folder=guihead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
+
+[Unit2]
+FileName=guihead.h
+CompileCpp=0
+Folder=guihead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=1
+Build=1
+LanguageID=1033
+CharsetID=1252
+CompanyName=
+FileVersion=
+FileDescription=Developed using the Dev-C++ IDE
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=
+AutoIncBuildNr=0
+
+[Unit4]
+FileName=..\head.h
+CompileCpp=0
+Folder=guihead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit6]
+FileName=..\resid.h
+CompileCpp=0
+Folder=guihead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit3]
+FileName=..\head.c
+CompileCpp=0
+Folder=guihead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit5]
+FileName=..\resource.h
+CompileCpp=0
+Folder=guihead
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
diff --git a/win/launch4j/head_src/guihead/guihead.h b/win/launch4j/head_src/guihead/guihead.h
new file mode 100755
index 0000000..2fc71e3
--- /dev/null
+++ b/win/launch4j/head_src/guihead/guihead.h
@@ -0,0 +1,43 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2007 Grzegorz Kowal
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ Except as contained in this notice, the name(s) of the above copyright holders
+ shall not be used in advertising or otherwise to promote the sale, use or other
+ dealings in this Software without prior written authorization.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#define ID_TIMER 1
+#define DEFAULT_SPLASH_TIMEOUT 60 /* 60 seconds */
+#define MAX_SPLASH_TIMEOUT 60 * 15 /* 15 minutes */
+
+HWND getInstanceWindow();
+
+BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam);
+
+VOID CALLBACK TimerProc(
+ HWND hwnd, // handle of window for timer messages
+ UINT uMsg, // WM_TIMER message
+ UINT idEvent, // timer identifier
+ DWORD dwTime // current system time
+);
diff --git a/win/launch4j/head_src/head.c b/win/launch4j/head_src/head.c
new file mode 100755
index 0000000..10ad509
--- /dev/null
+++ b/win/launch4j/head_src/head.c
@@ -0,0 +1,814 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2008 Grzegorz Kowal,
+ Ian Roberts (jdk preference patch)
+ Sylvain Mina (single instance patch)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ Except as contained in this notice, the name(s) of the above copyright holders
+ shall not be used in advertising or otherwise to promote the sale, use or other
+ dealings in this Software without prior written authorization.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#include "resource.h"
+#include "head.h"
+
+HMODULE hModule;
+FILE* hLog;
+BOOL console = FALSE;
+BOOL wow64 = FALSE;
+int foundJava = NO_JAVA_FOUND;
+
+struct _stat statBuf;
+PROCESS_INFORMATION pi;
+DWORD priority;
+
+char mutexName[STR] = {0};
+
+char errUrl[256] = {0};
+char errTitle[STR] = "Launch4j";
+char errMsg[BIG_STR] = {0};
+
+char javaMinVer[STR] = {0};
+char javaMaxVer[STR] = {0};
+char foundJavaVer[STR] = {0};
+char foundJavaKey[_MAX_PATH] = {0};
+
+char oldPwd[_MAX_PATH] = {0};
+char workingDir[_MAX_PATH] = {0};
+char cmd[_MAX_PATH] = {0};
+char args[MAX_ARGS] = {0};
+
+FILE* openLogFile(const char* exePath, const int pathLen) {
+ char path[_MAX_PATH] = {0};
+ strncpy(path, exePath, pathLen);
+ strcat(path, "\\launch4j.log");
+ return fopen(path, "a");
+}
+
+void closeLogFile() {
+ if (hLog != NULL) {
+ fclose(hLog);
+ }
+}
+
+void setWow64Flag() {
+ LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
+ GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
+
+ if (fnIsWow64Process != NULL) {
+ fnIsWow64Process(GetCurrentProcess(), &wow64);
+ }
+ debug("WOW64:\t\t%s\n", wow64 ? "yes" : "no");
+}
+
+void setConsoleFlag() {
+ console = TRUE;
+}
+
+void msgBox(const char* text) {
+ if (console) {
+ printf("%s: %s\n", errTitle, text);
+ } else {
+ MessageBox(NULL, text, errTitle, MB_OK);
+ }
+}
+
+void signalError() {
+ DWORD err = GetLastError();
+ if (err) {
+ LPVOID lpMsgBuf;
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
+ | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL);
+ debug("Error:\t\t%s\n", (LPCTSTR) lpMsgBuf);
+ strcat(errMsg, "\n\n");
+ strcat(errMsg, (LPCTSTR) lpMsgBuf);
+ msgBox(errMsg);
+ LocalFree(lpMsgBuf);
+ } else {
+ msgBox(errMsg);
+ }
+ if (*errUrl) {
+ debug("Open URL:\t%s\n", errUrl);
+ ShellExecute(NULL, "open", errUrl, NULL, NULL, SW_SHOWNORMAL);
+ }
+ closeLogFile();
+}
+
+BOOL loadString(const int resID, char* buffer) {
+ HRSRC hResource;
+ HGLOBAL hResourceLoaded;
+ LPBYTE lpBuffer;
+
+ hResource = FindResourceEx(hModule, RT_RCDATA, MAKEINTRESOURCE(resID),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT));
+ if (NULL != hResource) {
+ hResourceLoaded = LoadResource(hModule, hResource);
+ if (NULL != hResourceLoaded) {
+ lpBuffer = (LPBYTE) LockResource(hResourceLoaded);
+ if (NULL != lpBuffer) {
+ int x = 0;
+ do {
+ buffer[x] = (char) lpBuffer[x];
+ } while (buffer[x++] != 0);
+ // debug("Resource %d:\t%s\n", resID, buffer);
+ return TRUE;
+ }
+ }
+ } else {
+ SetLastError(0);
+ }
+ return FALSE;
+}
+
+BOOL loadBool(const int resID) {
+ char boolStr[20] = {0};
+ loadString(resID, boolStr);
+ return strcmp(boolStr, TRUE_STR) == 0;
+}
+
+int loadInt(const int resID) {
+ char intStr[20] = {0};
+ loadString(resID, intStr);
+ return atoi(intStr);
+}
+
+BOOL regQueryValue(const char* regPath, unsigned char* buffer,
+ unsigned long bufferLength) {
+ HKEY hRootKey;
+ char* key;
+ char* value;
+ if (strstr(regPath, HKEY_CLASSES_ROOT_STR) == regPath) {
+ hRootKey = HKEY_CLASSES_ROOT;
+ } else if (strstr(regPath, HKEY_CURRENT_USER_STR) == regPath) {
+ hRootKey = HKEY_CURRENT_USER;
+ } else if (strstr(regPath, HKEY_LOCAL_MACHINE_STR) == regPath) {
+ hRootKey = HKEY_LOCAL_MACHINE;
+ } else if (strstr(regPath, HKEY_USERS_STR) == regPath) {
+ hRootKey = HKEY_USERS;
+ } else if (strstr(regPath, HKEY_CURRENT_CONFIG_STR) == regPath) {
+ hRootKey = HKEY_CURRENT_CONFIG;
+ } else {
+ return FALSE;
+ }
+ key = strchr(regPath, '\\') + 1;
+ value = strrchr(regPath, '\\') + 1;
+ *(value - 1) = 0;
+
+ HKEY hKey;
+ unsigned long datatype;
+ BOOL result = FALSE;
+ if ((wow64 && RegOpenKeyEx(hRootKey,
+ key,
+ 0,
+ KEY_READ | KEY_WOW64_64KEY,
+ &hKey) == ERROR_SUCCESS)
+ || RegOpenKeyEx(hRootKey,
+ key,
+ 0,
+ KEY_READ,
+ &hKey) == ERROR_SUCCESS) {
+ result = RegQueryValueEx(hKey, value, NULL, &datatype, buffer, &bufferLength)
+ == ERROR_SUCCESS;
+ RegCloseKey(hKey);
+ }
+ *(value - 1) = '\\';
+ return result;
+}
+
+void regSearch(const HKEY hKey, const char* keyName, const int searchType) {
+ DWORD x = 0;
+ unsigned long size = BIG_STR;
+ FILETIME time;
+ char buffer[BIG_STR] = {0};
+ while (RegEnumKeyEx(
+ hKey, // handle to key to enumerate
+ x++, // index of subkey to enumerate
+ buffer, // address of buffer for subkey name
+ &size, // address for size of subkey buffer
+ NULL, // reserved
+ NULL, // address of buffer for class string
+ NULL, // address for size of class buffer
+ &time) == ERROR_SUCCESS) {
+
+ if (strcmp(buffer, javaMinVer) >= 0
+ && (!*javaMaxVer || strcmp(buffer, javaMaxVer) <= 0)
+ && strcmp(buffer, foundJavaVer) > 0) {
+ strcpy(foundJavaVer, buffer);
+ strcpy(foundJavaKey, keyName);
+ appendPath(foundJavaKey, buffer);
+ foundJava = searchType;
+ debug("Match:\t\t%s\\%s\n", keyName, buffer);
+ } else {
+ debug("Ignore:\t\t%s\\%s\n", keyName, buffer);
+ }
+ size = BIG_STR;
+ }
+}
+
+void regSearchWow(const char* keyName, const int searchType) {
+ HKEY hKey;
+ debug("64-bit search:\t%s...\n", keyName);
+ if (wow64 && RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ keyName,
+ 0,
+ KEY_READ | KEY_WOW64_64KEY,
+ &hKey) == ERROR_SUCCESS) {
+
+ regSearch(hKey, keyName, searchType | KEY_WOW64_64KEY);
+ RegCloseKey(hKey);
+ if ((foundJava & KEY_WOW64_64KEY) != NO_JAVA_FOUND)
+ {
+ debug("Using 64-bit runtime.\n");
+ return;
+ }
+ }
+ debug("32-bit search:\t%s...\n", keyName);
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ keyName,
+ 0,
+ KEY_READ,
+ &hKey) == ERROR_SUCCESS) {
+ regSearch(hKey, keyName, searchType);
+ RegCloseKey(hKey);
+ }
+}
+
+void regSearchJreSdk(const char* jreKeyName, const char* sdkKeyName,
+ const int jdkPreference) {
+ if (jdkPreference == JDK_ONLY || jdkPreference == PREFER_JDK) {
+ regSearchWow(sdkKeyName, FOUND_SDK);
+ if (jdkPreference != JDK_ONLY) {
+ regSearchWow(jreKeyName, FOUND_JRE);
+ }
+ } else { // jdkPreference == JRE_ONLY or PREFER_JRE
+ regSearchWow(jreKeyName, FOUND_JRE);
+ if (jdkPreference != JRE_ONLY) {
+ regSearchWow(sdkKeyName, FOUND_SDK);
+ }
+ }
+}
+
+BOOL findJavaHome(char* path, const int jdkPreference) {
+ regSearchJreSdk("SOFTWARE\\JavaSoft\\Java Runtime Environment",
+ "SOFTWARE\\JavaSoft\\Java Development Kit",
+ jdkPreference);
+ if (foundJava == NO_JAVA_FOUND) {
+ regSearchJreSdk("SOFTWARE\\IBM\\Java2 Runtime Environment",
+ "SOFTWARE\\IBM\\Java Development Kit",
+ jdkPreference);
+ }
+ if (foundJava != NO_JAVA_FOUND) {
+ HKEY hKey;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ foundJavaKey,
+ 0,
+ KEY_READ | (foundJava & KEY_WOW64_64KEY),
+ &hKey) == ERROR_SUCCESS) {
+ unsigned char buffer[BIG_STR] = {0};
+ unsigned long bufferlength = BIG_STR;
+ unsigned long datatype;
+ if (RegQueryValueEx(hKey, "JavaHome", NULL, &datatype, buffer,
+ &bufferlength) == ERROR_SUCCESS) {
+ int i = 0;
+ do {
+ path[i] = buffer[i];
+ } while (path[i++] != 0);
+ if (foundJava & FOUND_SDK) {
+ appendPath(path, "jre");
+ }
+ RegCloseKey(hKey);
+ return TRUE;
+ }
+ RegCloseKey(hKey);
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Extract the executable name, returns path length.
+ */
+int getExePath(char* exePath) {
+ if (GetModuleFileName(hModule, exePath, _MAX_PATH) == 0) {
+ return -1;
+ }
+ return strrchr(exePath, '\\') - exePath;
+}
+
+void appendPath(char* basepath, const char* path) {
+ if (basepath[strlen(basepath) - 1] != '\\') {
+ strcat(basepath, "\\");
+ }
+ strcat(basepath, path);
+}
+
+void appendJavaw(char* jrePath) {
+ if (console) {
+ appendPath(jrePath, "bin\\java.exe");
+ } else {
+ appendPath(jrePath, "bin\\javaw.exe");
+ }
+}
+
+void appendLauncher(const BOOL setProcName, char* exePath,
+ const int pathLen, char* cmd) {
+ if (setProcName) {
+ char tmpspec[_MAX_PATH];
+ char tmpfile[_MAX_PATH];
+ strcpy(tmpspec, cmd);
+ strcat(tmpspec, LAUNCH4J_TMP_DIR);
+ tmpspec[strlen(tmpspec) - 1] = 0;
+ if (_stat(tmpspec, &statBuf) == 0) {
+ // Remove temp launchers and manifests
+ struct _finddata_t c_file;
+ long hFile;
+ appendPath(tmpspec, "*.exe");
+ strcpy(tmpfile, cmd);
+ strcat(tmpfile, LAUNCH4J_TMP_DIR);
+ char* filename = tmpfile + strlen(tmpfile);
+ if ((hFile = _findfirst(tmpspec, &c_file)) != -1L) {
+ do {
+ strcpy(filename, c_file.name);
+ debug("Unlink:\t\t%s\n", tmpfile);
+ _unlink(tmpfile);
+ strcat(tmpfile, MANIFEST);
+ debug("Unlink:\t\t%s\n", tmpfile);
+ _unlink(tmpfile);
+ } while (_findnext(hFile, &c_file) == 0);
+ }
+ _findclose(hFile);
+ } else {
+ if (_mkdir(tmpspec) != 0) {
+ debug("Mkdir failed:\t%s\n", tmpspec);
+ appendJavaw(cmd);
+ return;
+ }
+ }
+ char javaw[_MAX_PATH];
+ strcpy(javaw, cmd);
+ appendJavaw(javaw);
+ strcpy(tmpfile, cmd);
+ strcat(tmpfile, LAUNCH4J_TMP_DIR);
+ char* tmpfilename = tmpfile + strlen(tmpfile);
+ char* exeFilePart = exePath + pathLen + 1;
+
+ // Copy manifest
+ char manifest[_MAX_PATH] = {0};
+ strcpy(manifest, exePath);
+ strcat(manifest, MANIFEST);
+ if (_stat(manifest, &statBuf) == 0) {
+ strcat(tmpfile, exeFilePart);
+ strcat(tmpfile, MANIFEST);
+ debug("Copy:\t\t%s -> %s\n", manifest, tmpfile);
+ CopyFile(manifest, tmpfile, FALSE);
+ }
+
+ // Copy launcher
+ strcpy(tmpfilename, exeFilePart);
+ debug("Copy:\t\t%s -> %s\n", javaw, tmpfile);
+ if (CopyFile(javaw, tmpfile, FALSE)) {
+ strcpy(cmd, tmpfile);
+ return;
+ } else if (_stat(javaw, &statBuf) == 0) {
+ long fs = statBuf.st_size;
+ if (_stat(tmpfile, &statBuf) == 0 && fs == statBuf.st_size) {
+ debug("Reusing:\t\t%s\n", tmpfile);
+ strcpy(cmd, tmpfile);
+ return;
+ }
+ }
+ }
+ appendJavaw(cmd);
+}
+
+void appendAppClasspath(char* dst, const char* src, const char* classpath) {
+ strcat(dst, src);
+ if (*classpath) {
+ strcat(dst, ";");
+ }
+}
+
+BOOL isJrePathOk(const char* path) {
+ char javaw[_MAX_PATH];
+ BOOL result = FALSE;
+ if (*path) {
+ strcpy(javaw, path);
+ appendJavaw(javaw);
+ result = _stat(javaw, &statBuf) == 0;
+ }
+ debug("Check launcher:\t%s %s\n", javaw, result ? "(OK)" : "(n/a)");
+ return result;
+}
+
+/*
+ * Expand environment %variables%
+ */
+BOOL expandVars(char *dst, const char *src, const char *exePath, const int pathLen) {
+ char varName[STR];
+ char varValue[MAX_VAR_SIZE];
+ while (strlen(src) > 0) {
+ char *start = strchr(src, '%');
+ if (start != NULL) {
+ char *end = strchr(start + 1, '%');
+ if (end == NULL) {
+ return FALSE;
+ }
+ // Copy content up to %VAR%
+ strncat(dst, src, start - src);
+ // Insert value of %VAR%
+ *varName = 0;
+ strncat(varName, start + 1, end - start - 1);
+ // Remember value start for logging
+ char *currentVarValue = dst + strlen(dst);
+ if (strcmp(varName, "EXEDIR") == 0) {
+ strncat(dst, exePath, pathLen);
+ } else if (strcmp(varName, "EXEFILE") == 0) {
+ strcat(dst, exePath);
+ } else if (strcmp(varName, "PWD") == 0) {
+ GetCurrentDirectory(_MAX_PATH, dst + strlen(dst));
+ } else if (strcmp(varName, "OLDPWD") == 0) {
+ strcat(dst, oldPwd);
+ } else if (strstr(varName, HKEY_STR) == varName) {
+ regQueryValue(varName, dst + strlen(dst), BIG_STR);
+ } else if (GetEnvironmentVariable(varName, varValue, MAX_VAR_SIZE) > 0) {
+ strcat(dst, varValue);
+ }
+ debug("Substitute:\t%s = %s\n", varName, currentVarValue);
+ src = end + 1;
+ } else {
+ // Copy remaining content
+ strcat(dst, src);
+ break;
+ }
+ }
+ return TRUE;
+}
+
+void appendHeapSizes(char *dst) {
+ MEMORYSTATUS m;
+ memset(&m, 0, sizeof(m));
+ GlobalMemoryStatus(&m);
+
+ appendHeapSize(dst, INITIAL_HEAP_SIZE, INITIAL_HEAP_PERCENT,
+ m.dwAvailPhys, "-Xms");
+ appendHeapSize(dst, MAX_HEAP_SIZE, MAX_HEAP_PERCENT,
+ m.dwAvailPhys, "-Xmx");
+}
+
+void appendHeapSize(char *dst, const int absID, const int percentID,
+ const DWORD freeMemory, const char *option) {
+
+ const int mb = 1048576; // 1 MB
+ const int mbLimit32 = 1500; // Max heap size in MB on 32-bit JREs
+ int abs = loadInt(absID);
+ int percent = loadInt(percentID);
+ int free = (long long) freeMemory * percent / (100 * mb); // 100% * 1 MB
+ int size = free > abs ? free : abs;
+ if (size > 0) {
+ if (!(foundJava & KEY_WOW64_64KEY) && size > mbLimit32) {
+ debug("Heap limit:\tReduced %d MB heap size to 32-bit maximum %d MB\n",
+ size, mbLimit32);
+ size = mbLimit32;
+ }
+
+ debug("Heap %s:\t%d MB / %d%%, Free: %d MB, Heap size: %d MB\n",
+ option, abs, percent, freeMemory / mb, size);
+ strcat(dst, option);
+ _itoa(size, dst + strlen(dst), 10); // 10 -- radix
+ strcat(dst, "m ");
+ }
+}
+
+int prepare(const char *lpCmdLine) {
+ char tmp[MAX_ARGS] = {0};
+ hModule = GetModuleHandle(NULL);
+ if (hModule == NULL) {
+ return FALSE;
+ }
+
+ // Get executable path
+ char exePath[_MAX_PATH] = {0};
+ int pathLen = getExePath(exePath);
+ if (pathLen == -1) {
+ return FALSE;
+ }
+
+ // Initialize logging
+ if (strstr(lpCmdLine, "--l4j-debug") != NULL) {
+ hLog = openLogFile(exePath, pathLen);
+ if (hLog == NULL) {
+ return FALSE;
+ }
+ debug("\n\nCmdLine:\t%s %s\n", exePath, lpCmdLine);
+ }
+
+ setWow64Flag();
+
+ // Set default error message, title and optional support web site url.
+ loadString(SUPPORT_URL, errUrl);
+ loadString(ERR_TITLE, errTitle);
+ if (!loadString(STARTUP_ERR, errMsg)) {
+ return FALSE;
+ }
+
+ // Single instance
+ loadString(MUTEX_NAME, mutexName);
+ if (*mutexName) {
+ SECURITY_ATTRIBUTES security;
+ security.nLength = sizeof(SECURITY_ATTRIBUTES);
+ security.bInheritHandle = TRUE;
+ security.lpSecurityDescriptor = NULL;
+ CreateMutexA(&security, FALSE, mutexName);
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ debug("Instance already exists.");
+ return ERROR_ALREADY_EXISTS;
+ }
+ }
+
+ // Working dir
+ char tmp_path[_MAX_PATH] = {0};
+ GetCurrentDirectory(_MAX_PATH, oldPwd);
+ if (loadString(CHDIR, tmp_path)) {
+ strncpy(workingDir, exePath, pathLen);
+ appendPath(workingDir, tmp_path);
+ _chdir(workingDir);
+ debug("Working dir:\t%s\n", workingDir);
+ }
+
+ // Use bundled jre or find java
+ if (loadString(JRE_PATH, tmp_path)) {
+ char jrePath[MAX_ARGS] = {0};
+ expandVars(jrePath, tmp_path, exePath, pathLen);
+ debug("Bundled JRE:\t%s\n", jrePath);
+ if (jrePath[0] == '\\' || jrePath[1] == ':') {
+ // Absolute
+ strcpy(cmd, jrePath);
+ } else {
+ // Relative
+ strncpy(cmd, exePath, pathLen);
+ appendPath(cmd, jrePath);
+ }
+ }
+ if (!isJrePathOk(cmd)) {
+ if (!loadString(JAVA_MIN_VER, javaMinVer)) {
+ loadString(BUNDLED_JRE_ERR, errMsg);
+ return FALSE;
+ }
+ loadString(JAVA_MAX_VER, javaMaxVer);
+ if (!findJavaHome(cmd, loadInt(JDK_PREFERENCE))) {
+ loadString(JRE_VERSION_ERR, errMsg);
+ strcat(errMsg, " ");
+ strcat(errMsg, javaMinVer);
+ if (*javaMaxVer) {
+ strcat(errMsg, " - ");
+ strcat(errMsg, javaMaxVer);
+ }
+ loadString(DOWNLOAD_URL, errUrl);
+ return FALSE;
+ }
+ if (!isJrePathOk(cmd)) {
+ loadString(LAUNCHER_ERR, errMsg);
+ return FALSE;
+ }
+ }
+
+ // Append a path to the Path environment variable
+ char jreBinPath[_MAX_PATH];
+ strcpy(jreBinPath, cmd);
+ strcat(jreBinPath, "\\bin");
+ if (!appendToPathVar(jreBinPath)) {
+ return FALSE;
+ }
+
+ // Set environment variables
+ char envVars[MAX_VAR_SIZE] = {0};
+ loadString(ENV_VARIABLES, envVars);
+ char *var = strtok(envVars, "\t");
+ while (var != NULL) {
+ char *varValue = strchr(var, '=');
+ *varValue++ = 0;
+ *tmp = 0;
+ expandVars(tmp, varValue, exePath, pathLen);
+ debug("Set var:\t%s = %s\n", var, tmp);
+ SetEnvironmentVariable(var, tmp);
+ var = strtok(NULL, "\t");
+ }
+ *tmp = 0;
+
+ // Process priority
+ priority = loadInt(PRIORITY_CLASS);
+
+ // Custom process name
+ const BOOL setProcName = loadBool(SET_PROC_NAME)
+ && strstr(lpCmdLine, "--l4j-default-proc") == NULL;
+ const BOOL wrapper = loadBool(WRAPPER);
+
+ appendLauncher(setProcName, exePath, pathLen, cmd);
+
+ // Heap sizes
+ appendHeapSizes(args);
+
+ // JVM options
+ if (loadString(JVM_OPTIONS, tmp)) {
+ strcat(tmp, " ");
+ } else {
+ *tmp = 0;
+ }
+ /*
+ * Load additional JVM options from .l4j.ini file
+ * Options are separated by spaces or CRLF
+ * # starts an inline comment
+ */
+ strncpy(tmp_path, exePath, strlen(exePath) - 3);
+ strcat(tmp_path, "l4j.ini");
+ long hFile;
+ if ((hFile = _open(tmp_path, _O_RDONLY)) != -1) {
+ const int jvmOptLen = strlen(tmp);
+ char* src = tmp + jvmOptLen;
+ char* dst = src;
+ const int len = _read(hFile, src, MAX_ARGS - jvmOptLen - BIG_STR);
+ BOOL copy = TRUE;
+ int i;
+ for (i = 0; i < len; i++, src++) {
+ if (*src == '#') {
+ copy = FALSE;
+ } else if (*src == 13 || *src == 10) {
+ copy = TRUE;
+ if (dst > tmp && *(dst - 1) != ' ') {
+ *dst++ = ' ';
+ }
+ } else if (copy) {
+ *dst++ = *src;
+ }
+ }
+ *dst = 0;
+ if (len > 0 && *(dst - 1) != ' ') {
+ strcat(tmp, " ");
+ }
+ _close(hFile);
+ }
+
+ // Expand environment %variables%
+ expandVars(args, tmp, exePath, pathLen);
+
+ // MainClass + Classpath or Jar
+ char mainClass[STR] = {0};
+ char jar[_MAX_PATH] = {0};
+ loadString(JAR, jar);
+ if (loadString(MAIN_CLASS, mainClass)) {
+ if (!loadString(CLASSPATH, tmp)) {
+ return FALSE;
+ }
+ char exp[MAX_ARGS] = {0};
+ expandVars(exp, tmp, exePath, pathLen);
+ strcat(args, "-classpath \"");
+ if (wrapper) {
+ appendAppClasspath(args, exePath, exp);
+ } else if (*jar) {
+ appendAppClasspath(args, jar, exp);
+ }
+
+ // Deal with wildcards or >> strcat(args, exp); <<
+ char* cp = strtok(exp, ";");
+ while(cp != NULL) {
+ debug("Add classpath:\t%s\n", cp);
+ if (strpbrk(cp, "*?") != NULL) {
+ int len = strrchr(cp, '\\') - cp + 1;
+ strncpy(tmp_path, cp, len);
+ char* filename = tmp_path + len;
+ *filename = 0;
+ struct _finddata_t c_file;
+ long hFile;
+ if ((hFile = _findfirst(cp, &c_file)) != -1L) {
+ do {
+ strcpy(filename, c_file.name);
+ strcat(args, tmp_path);
+ strcat(args, ";");
+ debug(" \" :\t%s\n", tmp_path);
+ } while (_findnext(hFile, &c_file) == 0);
+ }
+ _findclose(hFile);
+ } else {
+ strcat(args, cp);
+ strcat(args, ";");
+ }
+ cp = strtok(NULL, ";");
+ }
+ *(args + strlen(args) - 1) = 0;
+
+ strcat(args, "\" ");
+ strcat(args, mainClass);
+ } else if (wrapper) {
+ strcat(args, "-jar \"");
+ strcat(args, exePath);
+ strcat(args, "\"");
+ } else {
+ strcat(args, "-jar \"");
+ strncat(args, exePath, pathLen);
+ appendPath(args, jar);
+ strcat(args, "\"");
+ }
+
+ // Constant command line args
+ if (loadString(CMD_LINE, tmp)) {
+ strcat(args, " ");
+ strcat(args, tmp);
+ }
+
+ // Command line args
+ if (*lpCmdLine) {
+ strcpy(tmp, lpCmdLine);
+ char* dst;
+ while ((dst = strstr(tmp, "--l4j-")) != NULL) {
+ char* src = strchr(dst, ' ');
+ if (src == NULL || *(src + 1) == 0) {
+ *dst = 0;
+ } else {
+ strcpy(dst, src + 1);
+ }
+ }
+ if (*tmp) {
+ strcat(args, " ");
+ strcat(args, tmp);
+ }
+ }
+
+ debug("Launcher:\t%s\n", cmd);
+ debug("Launcher args:\t%s\n", args);
+ debug("Args length:\t%d/32768 chars\n", strlen(args));
+ return TRUE;
+}
+
+void closeHandles() {
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+ closeLogFile();
+}
+
+/*
+ * Append a path to the Path environment variable
+ */
+BOOL appendToPathVar(const char* path) {
+ char chBuf[MAX_VAR_SIZE] = {0};
+
+ const int pathSize = GetEnvironmentVariable("Path", chBuf, MAX_VAR_SIZE);
+ if (MAX_VAR_SIZE - pathSize - 1 < strlen(path)) {
+ return FALSE;
+ }
+ strcat(chBuf, ";");
+ strcat(chBuf, path);
+ return SetEnvironmentVariable("Path", chBuf);
+}
+
+DWORD execute(const BOOL wait) {
+ STARTUPINFO si;
+ memset(&pi, 0, sizeof(pi));
+ memset(&si, 0, sizeof(si));
+ si.cb = sizeof(si);
+
+ DWORD dwExitCode = -1;
+ char cmdline[MAX_ARGS];
+ strcpy(cmdline, "\"");
+ strcat(cmdline, cmd);
+ strcat(cmdline, "\" ");
+ strcat(cmdline, args);
+ if (CreateProcess(NULL, cmdline, NULL, NULL,
+ TRUE, priority, NULL, NULL, &si, &pi)) {
+ if (wait) {
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ GetExitCodeProcess(pi.hProcess, &dwExitCode);
+ debug("Exit code:\t%d\n", dwExitCode);
+ closeHandles();
+ } else {
+ dwExitCode = 0;
+ }
+ }
+ return dwExitCode;
+}
diff --git a/win/launch4j/head_src/head.h b/win/launch4j/head_src/head.h
new file mode 100755
index 0000000..2e3bdb1
--- /dev/null
+++ b/win/launch4j/head_src/head.h
@@ -0,0 +1,113 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2008 Grzegorz Kowal,
+ Ian Roberts (jdk preference patch)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ Except as contained in this notice, the name(s) of the above copyright holders
+ shall not be used in advertising or otherwise to promote the sale, use or other
+ dealings in this Software without prior written authorization.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+#ifndef _LAUNCH4J_HEAD__INCLUDED_
+#define _LAUNCH4J_HEAD__INCLUDED_
+
+#define WIN32_LEAN_AND_MEAN // VC - Exclude rarely-used stuff from Windows headers
+
+// Windows Header Files:
+#include
+
+// C RunTime Header Files
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define NO_JAVA_FOUND 0
+#define FOUND_JRE 1
+#define FOUND_SDK 2
+
+#define JRE_ONLY 0
+#define PREFER_JRE 1
+#define PREFER_JDK 2
+#define JDK_ONLY 3
+
+#define LAUNCH4J_TMP_DIR "\\launch4j-tmp\\"
+#define MANIFEST ".manifest"
+
+#define KEY_WOW64_64KEY 0x0100
+
+#define HKEY_STR "HKEY"
+#define HKEY_CLASSES_ROOT_STR "HKEY_CLASSES_ROOT"
+#define HKEY_CURRENT_USER_STR "HKEY_CURRENT_USER"
+#define HKEY_LOCAL_MACHINE_STR "HKEY_LOCAL_MACHINE"
+#define HKEY_USERS_STR "HKEY_USERS"
+#define HKEY_CURRENT_CONFIG_STR "HKEY_CURRENT_CONFIG"
+
+#define STR 128
+#define BIG_STR 1024
+#define MAX_VAR_SIZE 32767
+#define MAX_ARGS 32768
+
+#define TRUE_STR "true"
+#define FALSE_STR "false"
+
+#define debug(args...) if (hLog != NULL) fprintf(hLog, ## args);
+
+typedef void (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
+
+FILE* openLogFile(const char* exePath, const int pathLen);
+void closeLogFile();
+void msgBox(const char* text);
+void signalError();
+BOOL loadString(const int resID, char* buffer);
+BOOL loadBool(const int resID);
+int loadInt(const int resID);
+BOOL regQueryValue(const char* regPath, unsigned char* buffer,
+ unsigned long bufferLength);
+void regSearch(const HKEY hKey, const char* keyName, const int searchType);
+void regSearchWow(const char* keyName, const int searchType);
+void regSearchJreSdk(const char* jreKeyName, const char* sdkKeyName,
+ const int jdkPreference);
+BOOL findJavaHome(char* path, const int jdkPreference);
+int getExePath(char* exePath);
+void appendPath(char* basepath, const char* path);
+void appendJavaw(char* jrePath);
+void appendAppClasspath(char* dst, const char* src, const char* classpath);
+BOOL isJrePathOk(const char* path);
+BOOL expandVars(char *dst, const char *src, const char *exePath, const int pathLen);
+void appendHeapSizes(char *dst);
+void appendHeapSize(char *dst, const int absID, const int percentID,
+ const DWORD freeMemory, const char *option);
+int prepare(const char *lpCmdLine);
+void closeHandles();
+BOOL appendToPathVar(const char* path);
+DWORD execute(const BOOL wait);
+
+#endif // _LAUNCH4J_HEAD__INCLUDED_
diff --git a/win/launch4j/head_src/resource.h b/win/launch4j/head_src/resource.h
new file mode 100755
index 0000000..3c0f73c
--- /dev/null
+++ b/win/launch4j/head_src/resource.h
@@ -0,0 +1,71 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2008 Grzegorz Kowal
+ Ian Roberts (jdk preference patch)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ Except as contained in this notice, the name(s) of the above copyright holders
+ shall not be used in advertising or otherwise to promote the sale, use or other
+ dealings in this Software without prior written authorization.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+// ICON
+#define APP_ICON 1
+
+// BITMAP
+#define SPLASH_BITMAP 1
+
+// RCDATA
+#define JRE_PATH 1
+#define JAVA_MIN_VER 2
+#define JAVA_MAX_VER 3
+#define SHOW_SPLASH 4
+#define SPLASH_WAITS_FOR_WINDOW 5
+#define SPLASH_TIMEOUT 6
+#define SPLASH_TIMEOUT_ERR 7
+#define CHDIR 8
+#define SET_PROC_NAME 9
+#define ERR_TITLE 10
+#define GUI_HEADER_STAYS_ALIVE 11
+#define JVM_OPTIONS 12
+#define CMD_LINE 13
+#define JAR 14
+#define MAIN_CLASS 15
+#define CLASSPATH 16
+#define WRAPPER 17
+#define JDK_PREFERENCE 18
+#define ENV_VARIABLES 19
+#define PRIORITY_CLASS 20
+#define DOWNLOAD_URL 21
+#define SUPPORT_URL 22
+#define MUTEX_NAME 23
+#define INSTANCE_WINDOW_TITLE 24
+#define INITIAL_HEAP_SIZE 25
+#define INITIAL_HEAP_PERCENT 26
+#define MAX_HEAP_SIZE 27
+#define MAX_HEAP_PERCENT 28
+
+#define STARTUP_ERR 101
+#define BUNDLED_JRE_ERR 102
+#define JRE_VERSION_ERR 103
+#define LAUNCHER_ERR 104
+#define INSTANCE_ALREADY_EXISTS_MSG 105
diff --git a/win/launch4j/launch4j.exe b/win/launch4j/launch4j.exe
new file mode 100755
index 0000000..37aa2ce
Binary files /dev/null and b/win/launch4j/launch4j.exe differ
diff --git a/win/launch4j/launch4j.jar b/win/launch4j/launch4j.jar
new file mode 100755
index 0000000..9fee391
Binary files /dev/null and b/win/launch4j/launch4j.jar differ
diff --git a/win/launch4j/launch4j.jfpr b/win/launch4j/launch4j.jfpr
new file mode 100755
index 0000000..a2e63eb
Binary files /dev/null and b/win/launch4j/launch4j.jfpr differ
diff --git a/win/launch4j/launch4jc.exe b/win/launch4j/launch4jc.exe
new file mode 100755
index 0000000..b3a4fd3
Binary files /dev/null and b/win/launch4j/launch4jc.exe differ
diff --git a/win/launch4j/lib/JGoodies.Forms.LICENSE.txt b/win/launch4j/lib/JGoodies.Forms.LICENSE.txt
new file mode 100755
index 0000000..9ba2419
--- /dev/null
+++ b/win/launch4j/lib/JGoodies.Forms.LICENSE.txt
@@ -0,0 +1,31 @@
+
+ The BSD License for the JGoodies Forms
+ ======================================
+
+Copyright (c) 2002-2004 JGoodies Karsten Lentzsch. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o 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.
+
+ o Neither the name of JGoodies Karsten Lentzsch 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.
diff --git a/win/launch4j/lib/JGoodies.Looks.LICENSE.txt b/win/launch4j/lib/JGoodies.Looks.LICENSE.txt
new file mode 100755
index 0000000..8bbefa2
--- /dev/null
+++ b/win/launch4j/lib/JGoodies.Looks.LICENSE.txt
@@ -0,0 +1,31 @@
+
+ The BSD License for the JGoodies Looks
+ ======================================
+
+Copyright (c) 2001-2007 JGoodies Karsten Lentzsch. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o 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.
+
+ o Neither the name of JGoodies Karsten Lentzsch 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.
diff --git a/win/launch4j/lib/Nuvola.Icon.Theme.LICENSE.txt b/win/launch4j/lib/Nuvola.Icon.Theme.LICENSE.txt
new file mode 100755
index 0000000..cbee875
--- /dev/null
+++ b/win/launch4j/lib/Nuvola.Icon.Theme.LICENSE.txt
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/win/launch4j/lib/XStream.LICENSE.txt b/win/launch4j/lib/XStream.LICENSE.txt
new file mode 100755
index 0000000..5ccad86
--- /dev/null
+++ b/win/launch4j/lib/XStream.LICENSE.txt
@@ -0,0 +1,27 @@
+(BSD Style License)
+
+Copyright (c) 2003-2004, Joe Walnes
+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 XStream 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.
diff --git a/win/launch4j/lib/ant.LICENSE.txt b/win/launch4j/lib/ant.LICENSE.txt
new file mode 100755
index 0000000..29f81d8
--- /dev/null
+++ b/win/launch4j/lib/ant.LICENSE.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/win/launch4j/lib/ant.jar b/win/launch4j/lib/ant.jar
new file mode 100755
index 0000000..4f70c07
Binary files /dev/null and b/win/launch4j/lib/ant.jar differ
diff --git a/win/launch4j/lib/commons-beanutils.jar b/win/launch4j/lib/commons-beanutils.jar
new file mode 100755
index 0000000..b1b89c9
Binary files /dev/null and b/win/launch4j/lib/commons-beanutils.jar differ
diff --git a/win/launch4j/lib/commons-logging.jar b/win/launch4j/lib/commons-logging.jar
new file mode 100755
index 0000000..b73a80f
Binary files /dev/null and b/win/launch4j/lib/commons-logging.jar differ
diff --git a/win/launch4j/lib/commons.LICENSE.txt b/win/launch4j/lib/commons.LICENSE.txt
new file mode 100755
index 0000000..fdb6475
--- /dev/null
+++ b/win/launch4j/lib/commons.LICENSE.txt
@@ -0,0 +1,50 @@
+/*
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) @year@ The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, 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. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be
+ used to endorse or promote products derived from this software without
+ prior written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, 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.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ Stefano Mazzocchi . For more information on the Apache
+ Software Foundation, please see .
+
+*/
diff --git a/win/launch4j/lib/forms.jar b/win/launch4j/lib/forms.jar
new file mode 100755
index 0000000..aed060a
Binary files /dev/null and b/win/launch4j/lib/forms.jar differ
diff --git a/win/launch4j/lib/formsrt.jar b/win/launch4j/lib/formsrt.jar
new file mode 100755
index 0000000..e0de6ec
Binary files /dev/null and b/win/launch4j/lib/formsrt.jar differ
diff --git a/win/launch4j/lib/foxtrot.LICENSE.txt b/win/launch4j/lib/foxtrot.LICENSE.txt
new file mode 100755
index 0000000..5fa4019
--- /dev/null
+++ b/win/launch4j/lib/foxtrot.LICENSE.txt
@@ -0,0 +1,25 @@
+Copyright (c) 2002, Simone Bordet & Marco Cravero
+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 Foxtrot nor the names of the 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 REGENTS 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.
diff --git a/win/launch4j/lib/foxtrot.jar b/win/launch4j/lib/foxtrot.jar
new file mode 100755
index 0000000..f39103a
Binary files /dev/null and b/win/launch4j/lib/foxtrot.jar differ
diff --git a/win/launch4j/lib/looks.jar b/win/launch4j/lib/looks.jar
new file mode 100755
index 0000000..d2c47c7
Binary files /dev/null and b/win/launch4j/lib/looks.jar differ
diff --git a/win/launch4j/lib/xstream.jar b/win/launch4j/lib/xstream.jar
new file mode 100755
index 0000000..392e1c9
Binary files /dev/null and b/win/launch4j/lib/xstream.jar differ
diff --git a/win/launch4j/manifest/uac.exe.manifest b/win/launch4j/manifest/uac.exe.manifest
new file mode 100755
index 0000000..7b29e98
--- /dev/null
+++ b/win/launch4j/manifest/uac.exe.manifest
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/win/launch4j/manifest/xp-themes.exe.manifest b/win/launch4j/manifest/xp-themes.exe.manifest
new file mode 100755
index 0000000..fb5c878
--- /dev/null
+++ b/win/launch4j/manifest/xp-themes.exe.manifest
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/win/launch4j/sign4j/README.txt b/win/launch4j/sign4j/README.txt
new file mode 100755
index 0000000..64229f1
--- /dev/null
+++ b/win/launch4j/sign4j/README.txt
@@ -0,0 +1,18 @@
+sign4j version 3.0
+------------------
+
+sign4j is a very simple utility to digitally sign executables containing an appended jar file, like those created by launch4j.
+
+It works by first signing a temporary file to detect the size of the applied signature, and by then adding that size to a counter in the ZIP_END_HEADER of the embedded jar, so as to pretend that the signature is a comment belonging to it. That way the jar remains formally correct, and java accepts it.
+
+This manipulation must be done atomically with the signing process, because doing it before would invalidate the jar file, while doing it later would break the signature. That's why the whole command line of your signing tool must be passed to sign4j, which will do the job.
+
+Any signing tool can be used, as long as the name of the output file can be recognized among its parameters. This is currently done by either using an -out option if present, or taking the last filename with an exe suffix after all supplied options.
+
+If the involved tool is able to remove a previous signature before adding the new one (as is normally the case) the initial test can be performed on the target executable itself, avoiding the creation of a temporary file. You can use the option --onthespot to signal that to sign4j.
+
+The option --strict can be used to suppress the use of double quotes around parameters that strictly don't need them. The option --verbose shows diagnostics about intermediary steps of the process.
+
+This utility can also be used to sign normal executables, but then it will remember you that the file can be signed directly.
+
+Please send comments to bramfeld@diogen.de
diff --git a/win/launch4j/sign4j/sign4j.c b/win/launch4j/sign4j/sign4j.c
new file mode 100755
index 0000000..7f4b9cf
--- /dev/null
+++ b/win/launch4j/sign4j/sign4j.c
@@ -0,0 +1,223 @@
+/*
+ sign4j.c: a simple utility to sign executables created by Launch4j
+
+ Copyright (c) 2012 [TODO]
+
+ 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.
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define ZIP_END_HEADER "\x50\x4B\x05\x06"
+#define END_HEADER_SIZE 22
+#define MAX_COMMENT_SIZE 0xFFFF
+#define SWAP_BLOCK_SIZE (4 * 1024 * 1024)
+#define TEST_FILE_NAME "sign4j_temporary.exe"
+#define SIGN4J_VERSION "3.0"
+
+typedef unsigned char byte;
+
+char command[4096];
+byte* image = 0;
+
+void usage (void);
+void quit (int rsn);
+void clear (void);
+
+int main (int argc, char* argv[])
+{
+ char bfr[2];
+ char* inf;
+ char* outf;
+ char* trg;
+ byte* lmt;
+ long lng, ext, off, blck, sgm;
+ int fd, td;
+ int fnd, spt, unq, vrb, qts, cmn;
+ int i, j, n;
+ byte* p;
+
+ inf = outf = 0, fnd = spt = unq = vrb = 0;
+ for (i = 1; i < argc && argv[i][0] == '-'; i++)
+ if (! strcmp (argv[i], "--onthespot"))
+ spt = 1;
+ else if (! strcmp (argv[i], "--strict"))
+ unq = 1;
+ else if (! strcmp (argv[i], "--verbose"))
+ vrb = 1;
+ j = i;
+ for (i = j + 1; i < argc; i++)
+ if (! strcmp (argv[i], "-in") && i < argc - 1)
+ inf = argv[++i], fnd = 1;
+ else if (! strcmp (argv[i], "-out") && i < argc - 1)
+ outf = argv[++i], fnd = 1;
+ else if (argv[i][0] == '-' || (argv[i][0] == '/' && strlen (argv[i]) < 5))
+ (! fnd ? (inf = outf = 0) : 0);
+ else if (! fnd && (n = strlen (argv[i])) > 4 && ! stricmp (argv[i] + n - 4, ".exe"))
+ inf = outf = argv[i];
+ if (! inf || ! outf)
+ usage ();
+ atexit (clear);
+
+ if ((fd = open (inf, O_RDONLY | O_BINARY)) < 0)
+ quit (1);
+ if ((lng = lseek (fd, 0, SEEK_END)) < 0)
+ quit (2);
+ blck = (lng > SWAP_BLOCK_SIZE ? SWAP_BLOCK_SIZE : lng);
+ if (! (image = (byte*) malloc (blck)))
+ quit (4);
+ sgm = (blck > END_HEADER_SIZE + MAX_COMMENT_SIZE ? END_HEADER_SIZE + MAX_COMMENT_SIZE : blck);
+ if (lseek (fd, -sgm, SEEK_END) < 0 || read (fd, image, sgm) != sgm)
+ quit (2);
+ for (p = image + sgm - END_HEADER_SIZE; p > image; p--)
+ if (! memcmp (p, ZIP_END_HEADER, 4) && ((p[END_HEADER_SIZE - 1] << 8) | p[END_HEADER_SIZE - 2]) == (image + sgm) - (p + END_HEADER_SIZE))
+ break;
+ if (p > image)
+ {
+ off = lng - ((image + sgm) - (p + END_HEADER_SIZE - 2));
+ cmn = (p[END_HEADER_SIZE - 1] << 8) | p[END_HEADER_SIZE - 2];
+
+ if (! spt && (inf == outf || ! strcmp (inf, outf)))
+ {
+ printf ("Making temporary file\n");
+ if ((td = open (TEST_FILE_NAME, O_CREAT | _O_SHORT_LIVED | O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE)) < 0)
+ quit (5);
+ if (lseek (fd, 0, SEEK_SET) < 0)
+ quit (2);
+ for (ext = lng; ext > 0; ext -= blck)
+ {
+ sgm = (ext > blck ? blck : ext);
+ if (read (fd, image, sgm) != sgm || write (td, image, sgm) != sgm)
+ quit (6);
+ }
+ close (td);
+ trg = TEST_FILE_NAME;
+ }
+ else
+ trg = outf;
+ close (fd);
+
+ strcpy (command, "\" ");
+ for (i = j; i < argc; i++)
+ {
+ p = (argv[i] == outf ? trg : argv[i]);
+ qts = (! unq || strchr (p, 32));
+ if (qts)
+ strcat (command, "\"");
+ strcat (command, p);
+ if (qts)
+ strcat (command, "\"");
+ strcat (command, " ");
+ }
+ strcat (command, "\"");
+ if (! vrb)
+ strcat (command, " > NUL");
+ system (command);
+
+ if ((td = open (trg, O_RDONLY | O_BINARY)) < 0)
+ quit (7);
+ if ((ext = lseek (td, 0, SEEK_END)) < 0)
+ quit (7);
+ close (td);
+ if ((cmn += ext - lng) < 0 || cmn > MAX_COMMENT_SIZE)
+ quit (8);
+
+ if ((fd = open (inf, O_WRONLY | O_BINARY)) < 0)
+ quit (1);
+ if (lseek (fd, off, SEEK_SET) < 0)
+ quit (3);
+ bfr[0] = cmn & 0xFF;
+ bfr[1] = (cmn >> 8) & 0xFF;
+ if (write (fd, bfr, 2) != 2)
+ quit (3);
+ close (fd);
+ }
+ else
+ {
+ close (fd);
+ printf ("You don't need sign4j to sign this file\n");
+ }
+
+ strcpy (command, "\" ");
+ for (i = j; i < argc; i++)
+ {
+ p = argv[i];
+ qts = (! unq || strchr (p, 32));
+ if (qts)
+ strcat (command, "\"");
+ strcat (command, p);
+ if (qts)
+ strcat (command, "\"");
+ strcat (command, " ");
+ }
+ strcat (command, "\"");
+ return system (command);
+}
+
+
+void usage ()
+{
+ printf ("\nThis is sign4j version " SIGN4J_VERSION "\n\n");
+ printf ("Usage: sign4j [options] \n\n");
+ printf (" * options:\n");
+ printf (" --onthespot avoid the creation of a temporary file (your tool must be able to sign twice)\n");
+ printf (" --strict supress the use of double quotes around parameters that strictly don't need them\n");
+ printf (" --verbose show diagnostics about intermediary steps of the process\n");
+ printf (" * arguments must specify verbatim the command line for your signing tool\n");
+ printf (" * only one file can be signed on each invocation\n");
+ exit (-1);
+}
+
+void quit (int rsn)
+{
+ switch (rsn)
+ {
+ case 1: puts ("Could not open file\n"); break;
+ case 2: puts ("Could not read file\n"); break;
+ case 3: puts ("Could not write file\n"); break;
+ case 4: puts ("Not enough memory\n"); break;
+ case 5: puts ("Could not open temporary\n"); break;
+ case 6: puts ("Could not write temporary\n"); break;
+ case 7: puts ("Could not read target\n"); break;
+ case 8: puts ("Unsupported operation\n"); break;
+ }
+ exit (-1);
+}
+
+void clear ()
+{
+ if (access (TEST_FILE_NAME, 0) == 0)
+ remove (TEST_FILE_NAME);
+ if (image)
+ free (image);
+}
diff --git a/win/launch4j/sign4j/sign4j.exe b/win/launch4j/sign4j/sign4j.exe
new file mode 100755
index 0000000..84ff6ba
Binary files /dev/null and b/win/launch4j/sign4j/sign4j.exe differ
diff --git a/win/launch4j/src/images/asterix-o.gif b/win/launch4j/src/images/asterix-o.gif
new file mode 100755
index 0000000..f5cf3b3
Binary files /dev/null and b/win/launch4j/src/images/asterix-o.gif differ
diff --git a/win/launch4j/src/images/asterix.gif b/win/launch4j/src/images/asterix.gif
new file mode 100755
index 0000000..ba80167
Binary files /dev/null and b/win/launch4j/src/images/asterix.gif differ
diff --git a/win/launch4j/src/images/build.png b/win/launch4j/src/images/build.png
new file mode 100755
index 0000000..625285f
Binary files /dev/null and b/win/launch4j/src/images/build.png differ
diff --git a/win/launch4j/src/images/button_ok.png b/win/launch4j/src/images/button_ok.png
new file mode 100755
index 0000000..5b0f6a6
Binary files /dev/null and b/win/launch4j/src/images/button_ok.png differ
diff --git a/win/launch4j/src/images/cancel16.png b/win/launch4j/src/images/cancel16.png
new file mode 100755
index 0000000..a432b49
Binary files /dev/null and b/win/launch4j/src/images/cancel16.png differ
diff --git a/win/launch4j/src/images/down16.png b/win/launch4j/src/images/down16.png
new file mode 100755
index 0000000..f3bc4cd
Binary files /dev/null and b/win/launch4j/src/images/down16.png differ
diff --git a/win/launch4j/src/images/edit_add16.png b/win/launch4j/src/images/edit_add16.png
new file mode 100755
index 0000000..e948508
Binary files /dev/null and b/win/launch4j/src/images/edit_add16.png differ
diff --git a/win/launch4j/src/images/info.png b/win/launch4j/src/images/info.png
new file mode 100755
index 0000000..eb37d9a
Binary files /dev/null and b/win/launch4j/src/images/info.png differ
diff --git a/win/launch4j/src/images/new.png b/win/launch4j/src/images/new.png
new file mode 100755
index 0000000..6e2700a
Binary files /dev/null and b/win/launch4j/src/images/new.png differ
diff --git a/win/launch4j/src/images/new16.png b/win/launch4j/src/images/new16.png
new file mode 100755
index 0000000..f38d02e
Binary files /dev/null and b/win/launch4j/src/images/new16.png differ
diff --git a/win/launch4j/src/images/ok16.png b/win/launch4j/src/images/ok16.png
new file mode 100755
index 0000000..5b0f6a6
Binary files /dev/null and b/win/launch4j/src/images/ok16.png differ
diff --git a/win/launch4j/src/images/open.png b/win/launch4j/src/images/open.png
new file mode 100755
index 0000000..a801665
Binary files /dev/null and b/win/launch4j/src/images/open.png differ
diff --git a/win/launch4j/src/images/open16.png b/win/launch4j/src/images/open16.png
new file mode 100755
index 0000000..5321c17
Binary files /dev/null and b/win/launch4j/src/images/open16.png differ
diff --git a/win/launch4j/src/images/run.png b/win/launch4j/src/images/run.png
new file mode 100755
index 0000000..b41fa2b
Binary files /dev/null and b/win/launch4j/src/images/run.png differ
diff --git a/win/launch4j/src/images/save.png b/win/launch4j/src/images/save.png
new file mode 100755
index 0000000..74b37b0
Binary files /dev/null and b/win/launch4j/src/images/save.png differ
diff --git a/win/launch4j/src/images/up16.png b/win/launch4j/src/images/up16.png
new file mode 100755
index 0000000..184c118
Binary files /dev/null and b/win/launch4j/src/images/up16.png differ
diff --git a/win/launch4j/src/launch4j.properties b/win/launch4j/src/launch4j.properties
new file mode 100755
index 0000000..7e43bae
--- /dev/null
+++ b/win/launch4j/src/launch4j.properties
@@ -0,0 +1,2 @@
+versionNumber=3.1.0.0
+version=3.1.0-beta1
diff --git a/win/launch4j/src/net/sf/launch4j/Builder.java b/win/launch4j/src/net/sf/launch4j/Builder.java
new file mode 100755
index 0000000..2da6d15
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/Builder.java
@@ -0,0 +1,214 @@
+/*
+ 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.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("--dynamicbase")
+ .add("--nxcompat")
+ .add("--no-seh")
+ .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 (String f : files) {
+ addFile(f);
+ }
+
+ return this;
+ }
+
+ public void exec(Log log) throws ExecException {
+ String[] cmd = (String[]) _cmd.toArray(new String[_cmd.size()]);
+ Util.exec(cmd, log);
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/BuilderException.java b/win/launch4j/src/net/sf/launch4j/BuilderException.java
new file mode 100755
index 0000000..a84c2e2
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/BuilderException.java
@@ -0,0 +1,52 @@
+/*
+ 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 May 13, 2005
+ */
+package net.sf.launch4j;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class BuilderException extends Exception {
+ public BuilderException() {}
+
+ public BuilderException(Throwable t) {
+ super(t);
+ }
+
+ public BuilderException(String msg) {
+ super(msg);
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ExecException.java b/win/launch4j/src/net/sf/launch4j/ExecException.java
new file mode 100755
index 0000000..236ae78
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ExecException.java
@@ -0,0 +1,66 @@
+/*
+ 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 May 14, 2005
+ */
+package net.sf.launch4j;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class ExecException extends Exception {
+ private final int _errLine;
+
+ public ExecException(Throwable t, int errLine) {
+ super(t);
+ _errLine = errLine;
+ }
+
+ public ExecException(Throwable t) {
+ this(t, -1);
+ }
+
+ public ExecException(String msg, int errLine) {
+ super(msg);
+ _errLine = errLine;
+ }
+
+ public ExecException(String msg) {
+ this(msg, -1);
+ }
+
+ public int getErrLine() {
+ return _errLine;
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/FileChooserFilter.java b/win/launch4j/src/net/sf/launch4j/FileChooserFilter.java
new file mode 100755
index 0000000..5199a6d
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/FileChooserFilter.java
@@ -0,0 +1,76 @@
+/*
+ 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 2004-01-15
+ */
+package net.sf.launch4j;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+/**
+ * @author Copyright (C) 2004 Grzegorz Kowal
+ */
+public class FileChooserFilter extends FileFilter {
+ String _description;
+ String[] _extensions;
+
+ public FileChooserFilter(String description, String extension) {
+ _description = description;
+ _extensions = new String[] {extension};
+ }
+
+ public FileChooserFilter(String description, String[] extensions) {
+ _description = description;
+ _extensions = extensions;
+ }
+
+ public boolean accept(File f) {
+ if (f.isDirectory()) {
+ return true;
+ }
+ String ext = Util.getExtension(f);
+ for (int i = 0; i < _extensions.length; i++) {
+ if (ext.toLowerCase().equals(_extensions[i].toLowerCase())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String getDescription() {
+ return _description;
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/Log.java b/win/launch4j/src/net/sf/launch4j/Log.java
new file mode 100755
index 0000000..c4d591b
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/Log.java
@@ -0,0 +1,105 @@
+/*
+ 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 May 12, 2005
+ */
+package net.sf.launch4j;
+
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public abstract class Log {
+ private static final Log _consoleLog = new ConsoleLog();
+ private static final Log _antLog = new AntLog();
+
+ public abstract void clear();
+ public abstract void append(String line);
+
+ public static Log getConsoleLog() {
+ return _consoleLog;
+ }
+
+ public static Log getAntLog() {
+ return _antLog;
+ }
+
+ public static Log getSwingLog(JTextArea textArea) {
+ return new SwingLog(textArea);
+ }
+}
+
+class ConsoleLog extends Log {
+ public void clear() {
+ System.out.println("\n");
+ }
+
+ public void append(String line) {
+ System.out.println("launch4j: " + line);
+ }
+}
+
+class AntLog extends Log {
+ public void clear() {
+ System.out.println("\n");
+ }
+
+ public void append(String line) {
+ System.out.println(line);
+ }
+}
+
+class SwingLog extends Log {
+ private final JTextArea _textArea;
+
+ public SwingLog(JTextArea textArea) {
+ _textArea = textArea;
+ }
+
+ public void clear() {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ _textArea.setText("");
+ }});
+ }
+
+ public void append(final String line) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ _textArea.append(line + "\n");
+ }});
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/Main.java b/win/launch4j/src/net/sf/launch4j/Main.java
new file mode 100755
index 0000000..46972aa
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/Main.java
@@ -0,0 +1,94 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2004, 2011 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 Apr 21, 2005
+ */
+package net.sf.launch4j;
+
+import java.io.File;
+import java.util.Properties;
+
+import net.sf.launch4j.config.ConfigPersister;
+import net.sf.launch4j.formimpl.MainFrame;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class Main {
+ private static String _name;
+ private static String _description;
+
+ public static void main(String[] args) {
+ try {
+ Properties props = Util.getProperties();
+ setDescription(props);
+
+ if (args.length == 0) {
+ ConfigPersister.getInstance().createBlank();
+ MainFrame.createInstance();
+ } else if (args.length == 1 && !args[0].startsWith("-")) {
+ ConfigPersister.getInstance().load(new File(args[0]));
+ Builder b = new Builder(Log.getConsoleLog());
+ b.build();
+ } else {
+ System.out.println(_description
+ + Messages.getString("Main.usage")
+ + ": launch4j config.xml");
+ }
+ } catch (Exception e) {
+ Log.getConsoleLog().append(e.getMessage());
+ }
+ }
+
+ public static String getName() {
+ return _name;
+ }
+
+ public static String getDescription() {
+ return _description;
+ }
+
+ private static void setDescription(Properties props) {
+ _name = "Launch4j " + props.getProperty("version");
+ _description = _name +
+ " (http://launch4j.sourceforge.net/)\n" +
+ "Cross-platform Java application wrapper" +
+ " for creating Windows native executables.\n\n" +
+ "Copyright (C) 2004, 2011 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" +
+ " (http://www.apache.org/).";
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/Messages.java b/win/launch4j/src/net/sf/launch4j/Messages.java
new file mode 100755
index 0000000..35d4c89
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/Messages.java
@@ -0,0 +1,78 @@
+/*
+ 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.
+*/
+
+package net.sf.launch4j;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "net.sf.launch4j.messages";
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+ private static final MessageFormat FORMATTER = new MessageFormat("");
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ public static String getString(String key, String arg0) {
+ return getString(key, new Object[] {arg0});
+ }
+
+ public static String getString(String key, String arg0, String arg1) {
+ return getString(key, new Object[] {arg0, arg1});
+ }
+
+ public static String getString(String key, String arg0, String arg1, String arg2) {
+ return getString(key, new Object[] {arg0, arg1, arg2});
+ }
+
+ public static String getString(String key, Object[] args) {
+ try {
+ FORMATTER.applyPattern(RESOURCE_BUNDLE.getString(key));
+ return FORMATTER.format(args);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/OptionParser.java b/win/launch4j/src/net/sf/launch4j/OptionParser.java
new file mode 100755
index 0000000..bb2432c
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/OptionParser.java
@@ -0,0 +1,71 @@
+/*
+ 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 net.sf.launch4j.config.Config;
+
+//import org.apache.commons.cli.CommandLine;
+//import org.apache.commons.cli.CommandLineParser;
+//import org.apache.commons.cli.HelpFormatter;
+//import org.apache.commons.cli.Options;
+//import org.apache.commons.cli.ParseException;
+//import org.apache.commons.cli.PosixParser;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class OptionParser {
+
+// private final Options _options;
+//
+// public OptionParser() {
+// _options = new Options();
+// _options.addOption("h", "header", true, "header");
+// }
+//
+// public Config parse(Config c, String[] args) throws ParseException {
+// CommandLineParser parser = new PosixParser();
+// CommandLine cl = parser.parse(_options, args);
+// c.setJar(getFile(props, Config.JAR));
+// c.setOutfile(getFile(props, Config.OUTFILE));
+// }
+//
+// public void printHelp() {
+// HelpFormatter formatter = new HelpFormatter();
+// formatter.printHelp("launch4j", _options);
+// }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/RcBuilder.java b/win/launch4j/src/net/sf/launch4j/RcBuilder.java
new file mode 100755
index 0000000..d08d992
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/RcBuilder.java
@@ -0,0 +1,359 @@
+/*
+ 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.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.List;
+
+import net.sf.launch4j.config.Config;
+import net.sf.launch4j.config.ConfigPersister;
+import net.sf.launch4j.config.Jre;
+import net.sf.launch4j.config.Msg;
+import net.sf.launch4j.config.Splash;
+import net.sf.launch4j.config.VersionInfo;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class RcBuilder {
+
+ // winnt.h
+ public static final int LANG_NEUTRAL = 0;
+ public static final int SUBLANG_NEUTRAL = 0;
+ public static final int SUBLANG_DEFAULT = 1;
+ public static final int SUBLANG_SYS_DEFAULT = 2;
+
+ // MANIFEST
+ public static final int MANIFEST = 1;
+
+ // ICON
+ public static final int APP_ICON = 1;
+
+ // BITMAP
+ public static final int SPLASH_BITMAP = 1;
+
+ // RCDATA
+ public static final int JRE_PATH = 1;
+ public static final int JAVA_MIN_VER = 2;
+ public static final int JAVA_MAX_VER = 3;
+ public static final int SHOW_SPLASH = 4;
+ public static final int SPLASH_WAITS_FOR_WINDOW = 5;
+ public static final int SPLASH_TIMEOUT = 6;
+ public static final int SPLASH_TIMEOUT_ERR = 7;
+ public static final int CHDIR = 8;
+ public static final int SET_PROC_NAME = 9;
+ public static final int ERR_TITLE = 10;
+ public static final int GUI_HEADER_STAYS_ALIVE = 11;
+ public static final int JVM_OPTIONS = 12;
+ public static final int CMD_LINE = 13;
+ public static final int JAR = 14;
+ public static final int MAIN_CLASS = 15;
+ public static final int CLASSPATH = 16;
+ public static final int WRAPPER = 17;
+ public static final int JDK_PREFERENCE = 18;
+ public static final int ENV_VARIABLES = 19;
+ public static final int PRIORITY_CLASS = 20;
+ public static final int DOWNLOAD_URL = 21;
+ public static final int SUPPORT_URL = 22;
+ public static final int MUTEX_NAME = 23;
+ public static final int INSTANCE_WINDOW_TITLE = 24;
+ public static final int INITIAL_HEAP_SIZE = 25;
+ public static final int INITIAL_HEAP_PERCENT = 26;
+ public static final int MAX_HEAP_SIZE = 27;
+ public static final int MAX_HEAP_PERCENT = 28;
+
+ public static final int STARTUP_ERR = 101;
+ public static final int BUNDLED_JRE_ERR = 102;
+ public static final int JRE_VERSION_ERR = 103;
+ public static final int LAUNCHER_ERR = 104;
+ public static final int INSTANCE_ALREADY_EXISTS_MSG = 105;
+
+ private final StringBuffer _sb = new StringBuffer();
+
+ public String getContent() {
+ return _sb.toString();
+ }
+
+ public String getLine(int line) {
+ return _sb.toString().split("\n")[line - 1];
+ }
+
+ public File build(Config c) throws IOException {
+ _sb.append("LANGUAGE ");
+ _sb.append(LANG_NEUTRAL);
+ _sb.append(", ");
+ _sb.append(SUBLANG_DEFAULT);
+ _sb.append('\n');
+ addVersionInfo(c.getVersionInfo());
+ addJre(c.getJre());
+ addManifest(MANIFEST, c.getManifest());
+ addIcon(APP_ICON, c.getIcon());
+ addText(ERR_TITLE, c.getErrTitle());
+ addText(DOWNLOAD_URL, c.getDownloadUrl());
+ addText(SUPPORT_URL, c.getSupportUrl());
+ addText(CMD_LINE, c.getCmdLine());
+ addWindowsPath(CHDIR, c.getChdir());
+ addText(PRIORITY_CLASS, String.valueOf(c.getPriorityClass()));
+ addTrue(SET_PROC_NAME, c.isCustomProcName());
+ addTrue(GUI_HEADER_STAYS_ALIVE, c.isStayAlive());
+ addSplash(c.getSplash());
+ addMessages(c);
+
+ if (c.getSingleInstance() != null) {
+ addText(MUTEX_NAME, c.getSingleInstance().getMutexName());
+ addText(INSTANCE_WINDOW_TITLE, c.getSingleInstance().getWindowTitle());
+ }
+
+ if (c.getVariables() != null && !c.getVariables().isEmpty()) {
+ StringBuffer vars = new StringBuffer();
+ append(vars, c.getVariables(), "\t");
+ addText(ENV_VARIABLES, vars.toString());
+ }
+
+ // MAIN_CLASS / JAR
+ addTrue(WRAPPER, !c.isDontWrapJar());
+
+ if (c.getClassPath() != null) {
+ addText(MAIN_CLASS, c.getClassPath().getMainClass());
+ addWindowsPath(CLASSPATH, c.getClassPath().getPathsString());
+ }
+
+ if (c.isDontWrapJar() && c.getJar() != null) {
+ addWindowsPath(JAR, c.getJar().getPath());
+ }
+
+ File f = Util.createTempFile("rc");
+ BufferedWriter w = new BufferedWriter(new FileWriter(f));
+ w.write(_sb.toString());
+ w.close();
+ return f;
+ }
+
+ private void addVersionInfo(VersionInfo v) {
+ if (v == null) {
+ return;
+ }
+
+ _sb.append("1 VERSIONINFO\n");
+ _sb.append("FILEVERSION ");
+ _sb.append(v.getFileVersion().replaceAll("\\.", ", "));
+ _sb.append("\nPRODUCTVERSION ");
+ _sb.append(v.getProductVersion().replaceAll("\\.", ", "));
+ _sb.append("\nFILEFLAGSMASK 0\n" +
+ "FILEOS 0x40000\n" +
+ "FILETYPE 1\n" +
+ "{\n" +
+ " BLOCK \"StringFileInfo\"\n" +
+ " {\n" +
+ " BLOCK \"040904E4\"\n" + // English
+ " {\n");
+
+ addVerBlockValue("CompanyName", v.getCompanyName());
+ addVerBlockValue("FileDescription", v.getFileDescription());
+ addVerBlockValue("FileVersion", v.getTxtFileVersion());
+ addVerBlockValue("InternalName", v.getInternalName());
+ addVerBlockValue("LegalCopyright", v.getCopyright());
+ addVerBlockValue("OriginalFilename", v.getOriginalFilename());
+ addVerBlockValue("ProductName", v.getProductName());
+ addVerBlockValue("ProductVersion", v.getTxtProductVersion());
+ _sb.append(" }\n }\nBLOCK \"VarFileInfo\"\n{\nVALUE \"Translation\", 0x0409, 0x04E4\n}\n}");
+ }
+
+ private void addJre(Jre jre) {
+ addWindowsPath(JRE_PATH, jre.getPath());
+ addText(JAVA_MIN_VER, jre.getMinVersion());
+ addText(JAVA_MAX_VER, jre.getMaxVersion());
+ addText(JDK_PREFERENCE, String.valueOf(jre.getJdkPreferenceIndex()));
+ addInteger(INITIAL_HEAP_SIZE, jre.getInitialHeapSize());
+ addInteger(INITIAL_HEAP_PERCENT, jre.getInitialHeapPercent());
+ addInteger(MAX_HEAP_SIZE, jre.getMaxHeapSize());
+ addInteger(MAX_HEAP_PERCENT, jre.getMaxHeapPercent());
+
+ StringBuffer options = new StringBuffer();
+
+ if (jre.getOptions() != null && !jre.getOptions().isEmpty()) {
+ addSpace(options);
+ append(options, jre.getOptions(), " ");
+ }
+
+ addText(JVM_OPTIONS, options.toString());
+ }
+
+ private void addSplash(Splash splash) {
+ if (splash == null) {
+ return;
+ }
+
+ addTrue(SHOW_SPLASH, true);
+ addTrue(SPLASH_WAITS_FOR_WINDOW, splash.getWaitForWindow());
+ addText(SPLASH_TIMEOUT, String.valueOf(splash.getTimeout()));
+ addTrue(SPLASH_TIMEOUT_ERR, splash.isTimeoutErr());
+ addBitmap(SPLASH_BITMAP, splash.getFile());
+ }
+
+ private void addMessages(Config c) {
+ Msg msg = c.getMessages();
+
+ if (msg == null) {
+ msg = new Msg();
+ }
+
+ addText(STARTUP_ERR, msg.getStartupErr());
+ addText(BUNDLED_JRE_ERR, msg.getBundledJreErr());
+ addText(JRE_VERSION_ERR, msg.getJreVersionErr());
+ addText(LAUNCHER_ERR, msg.getLauncherErr());
+
+ if (c.getSingleInstance() != null) {
+ addText(INSTANCE_ALREADY_EXISTS_MSG, msg.getInstanceAlreadyExistsMsg());
+ }
+ }
+
+ private void append(StringBuffer sb, List list, String separator) {
+ for (int i = 0; i < list.size(); i++) {
+ sb.append(list.get(i));
+
+ if (i < list.size() - 1) {
+ sb.append(separator);
+ }
+ }
+ }
+
+ private void addText(int id, String text) {
+ if (text == null || text.equals("")) {
+ return;
+ }
+
+ _sb.append(id);
+ _sb.append(" RCDATA BEGIN \"");
+ _sb.append(escape(text));
+ _sb.append("\\0\" END\n");
+ }
+
+ private void addTrue(int id, boolean value) {
+ if (value) {
+ addText(id, "true");
+ }
+ }
+
+ private void addInteger(int id, Integer value) {
+ if (value != null) {
+ addText(id, value.toString());
+ }
+ }
+
+ /**
+ * Stores path in Windows format with '\' separators.
+ */
+ private void addWindowsPath(int id, String path) {
+ if (path == null || path.equals("")) {
+ return;
+ }
+
+ _sb.append(id);
+ _sb.append(" RCDATA BEGIN \"");
+ _sb.append(path.replaceAll("\\\\", "\\\\\\\\")
+ .replaceAll("/", "\\\\\\\\"));
+ _sb.append("\\0\" END\n");
+ }
+
+ private void addManifest(int id, File manifest) {
+ if (manifest == null || manifest.getPath().equals("")) {
+ return;
+ }
+
+ _sb.append(id);
+ _sb.append(" 24 \"");
+ _sb.append(getPath(Util.getAbsoluteFile(
+ ConfigPersister.getInstance().getConfigPath(), manifest)));
+ _sb.append("\"\n");
+ }
+
+ private void addIcon(int id, File icon) {
+ if (icon == null || icon.getPath().equals("")) {
+ return;
+ }
+
+ _sb.append(id);
+ _sb.append(" ICON DISCARDABLE \"");
+ _sb.append(getPath(Util.getAbsoluteFile(
+ ConfigPersister.getInstance().getConfigPath(), icon)));
+ _sb.append("\"\n");
+ }
+
+ private void addBitmap(int id, File bitmap) {
+ if (bitmap == null) {
+ return;
+ }
+
+ _sb.append(id);
+ _sb.append(" BITMAP \"");
+ _sb.append(getPath(Util.getAbsoluteFile(
+ ConfigPersister.getInstance().getConfigPath(), bitmap)));
+ _sb.append("\"\n");
+ }
+
+ private String getPath(File f) {
+ return f.getPath().replaceAll("\\\\", "\\\\\\\\");
+ }
+
+ private void addSpace(StringBuffer sb) {
+ int len = sb.length();
+
+ if (len-- > 0 && sb.charAt(len) != ' ') {
+ sb.append(' ');
+ }
+ }
+
+ private void addVerBlockValue(String key, String value) {
+ _sb.append(" VALUE \"");
+ _sb.append(key);
+ _sb.append("\", \"");
+
+ if (value != null) {
+ _sb.append(escape(value));
+ }
+
+ _sb.append("\"\n");
+ }
+
+ private String escape(String text) {
+ return text.replaceAll("\"", "\"\"");
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/Util.java b/win/launch4j/src/net/sf/launch4j/Util.java
new file mode 100755
index 0000000..ad34f41
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/Util.java
@@ -0,0 +1,227 @@
+/*
+ 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.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class Util {
+ public static final boolean WINDOWS_OS = System.getProperty("os.name")
+ .toLowerCase().startsWith("windows");
+
+ private static final String Launch4jProperties = "launch4j.properties";
+
+ private Util() {}
+
+ public static Properties getProperties() throws IOException {
+ Properties props = new Properties();
+ InputStream in = Main.class.getClassLoader().getResourceAsStream(Launch4jProperties);
+ props.load(in);
+ in.close();
+ return props;
+ }
+
+ public static File createTempFile(String suffix) throws IOException {
+ String tmpdir = System.getProperty("launch4j.tmpdir");
+ if (tmpdir != null) {
+ if (tmpdir.indexOf(' ') != -1) {
+ throw new IOException(Messages.getString("Util.tmpdir"));
+ }
+ return File.createTempFile("launch4j", suffix, new File(tmpdir));
+ } else {
+ return File.createTempFile("launch4j", suffix);
+ }
+ }
+
+ public static File getJarBasedir() {
+ try {
+ URI uri = new URI(Util.class.getClassLoader()
+ .getResource(Launch4jProperties)
+ .getFile());
+
+ String path = uri.getPath();
+
+ if (path.startsWith("file:")) {
+ String jarPath = path.substring(5, path.lastIndexOf('!'));
+ int x = jarPath.lastIndexOf('/');
+
+ if (x == -1) {
+ x = jarPath.lastIndexOf('\\');
+ }
+
+ String basedir = jarPath.substring(0, x + 1);
+ return new File(basedir);
+ } else {
+ return new File(".");
+ }
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static File getAbsoluteFile(File basepath, File f) {
+ return f.isAbsolute() ? f : new File(basepath, f.getPath());
+ }
+
+ public static String getExtension(File f) {
+ String name = f.getName();
+ int x = name.lastIndexOf('.');
+ if (x != -1) {
+ return name.substring(x);
+ } else {
+ return "";
+ }
+ }
+
+ public static void exec(String[] cmd, Log log) throws ExecException {
+ BufferedReader is = null;
+ try {
+ if (WINDOWS_OS) {
+ for (int i = 0; i < cmd.length; i++) {
+ cmd[i] = cmd[i].replaceAll("/", "\\\\");
+ }
+ }
+ Process p = Runtime.getRuntime().exec(cmd);
+ is = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+ String line;
+ int errLine = -1;
+ Pattern pattern = Pattern.compile(":\\d+:");
+ while ((line = is.readLine()) != null) {
+ log.append(line);
+ Matcher matcher = pattern.matcher(line);
+ if (matcher.find()) {
+ errLine = Integer.valueOf(
+ line.substring(matcher.start() + 1, matcher.end() - 1))
+ .intValue();
+ if (line.matches("(?i).*unrecognized escape sequence")) {
+ log.append(Messages.getString("Util.use.double.backslash"));
+ }
+ break;
+ }
+ }
+ is.close();
+ p.waitFor();
+ if (errLine != -1) {
+ StringBuffer sb = new StringBuffer(Messages.getString("Util.exec.failed"));
+ AppendCommandLine(sb, cmd);
+ throw new ExecException(sb.toString(), errLine);
+ }
+ if (p.exitValue() != 0) {
+ StringBuffer sb = new StringBuffer(Messages.getString("Util.exec.failed"));
+ sb.append(" (");
+ sb.append(p.exitValue());
+ sb.append(')');
+ AppendCommandLine(sb, cmd);
+ throw new ExecException(sb.toString());
+ }
+ } catch (IOException e) {
+ close(is);
+ throw new ExecException(e);
+ } catch (InterruptedException e) {
+ close(is);
+ throw new ExecException(e);
+ }
+ }
+
+ private static void AppendCommandLine(StringBuffer sb, String[] cmd) {
+ sb.append(": ");
+ for (int i = 0; i < cmd.length; i++) {
+ sb.append(cmd[i]);
+ if (i < cmd.length - 1) {
+ sb.append(' ');
+ }
+ }
+ }
+
+ public static void close(final InputStream o) {
+ if (o != null) {
+ try {
+ o.close();
+ } catch (IOException e) {
+ System.err.println(e); // XXX log
+ }
+ }
+ }
+
+ public static void close(final OutputStream o) {
+ if (o != null) {
+ try {
+ o.close();
+ } catch (IOException e) {
+ System.err.println(e); // XXX log
+ }
+ }
+ }
+
+ public static void close(final Reader o) {
+ if (o != null) {
+ try {
+ o.close();
+ } catch (IOException e) {
+ System.err.println(e); // XXX log
+ }
+ }
+ }
+
+ public static void close(final Writer o) {
+ if (o != null) {
+ try {
+ o.close();
+ } catch (IOException e) {
+ System.err.println(e); // XXX log
+ }
+ }
+ }
+
+ public static boolean delete(File f) {
+ return (f != null) ? f.delete() : false;
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/AntClassPath.java b/win/launch4j/src/net/sf/launch4j/ant/AntClassPath.java
new file mode 100755
index 0000000..03d7fa0
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/AntClassPath.java
@@ -0,0 +1,63 @@
+/*
+ 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 Jul 19, 2006
+ */
+package net.sf.launch4j.ant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.launch4j.config.ClassPath;
+
+/**
+ * @author Copyright (C) 2006 Grzegorz Kowal
+ */
+public class AntClassPath extends ClassPath {
+ private final List wrappedPaths = new ArrayList();
+
+ public void setCp(String cp){
+ StringWrapper wrapper = new StringWrapper();
+ wrapper.addText(cp);
+ wrappedPaths.add(wrapper);
+ }
+
+ public void addCp(StringWrapper cp) {
+ wrappedPaths.add(cp);
+ }
+
+ public void unwrap() {
+ setPaths(StringWrapper.unwrap(wrappedPaths));
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/AntConfig.java b/win/launch4j/src/net/sf/launch4j/ant/AntConfig.java
new file mode 100755
index 0000000..207db2f
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/AntConfig.java
@@ -0,0 +1,131 @@
+/*
+ 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 May 24, 2005
+ */
+package net.sf.launch4j.ant;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+
+import net.sf.launch4j.config.Config;
+import net.sf.launch4j.config.Msg;
+import net.sf.launch4j.config.SingleInstance;
+import net.sf.launch4j.config.Splash;
+import net.sf.launch4j.config.VersionInfo;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class AntConfig extends Config {
+ private final List wrappedHeaderObjects = new ArrayList();
+ private final List wrappedLibs = new ArrayList();
+ private final List wrappedVariables = new ArrayList();
+
+ public void setJarPath(String path) {
+ setJar(new File(path));
+ }
+
+ public void addObj(StringWrapper obj) {
+ wrappedHeaderObjects.add(obj);
+ }
+
+ public void addLib(StringWrapper lib) {
+ wrappedLibs.add(lib);
+ }
+
+ public void addVar(StringWrapper var) {
+ wrappedVariables.add(var);
+ }
+
+ // __________________________________________________________________________________
+
+ public void addSingleInstance(SingleInstance singleInstance) {
+ checkNull(getSingleInstance(), "singleInstance");
+ setSingleInstance(singleInstance);
+ }
+
+ public void addClassPath(AntClassPath classPath) {
+ checkNull(getClassPath(), "classPath");
+ setClassPath(classPath);
+ }
+
+ public void addJre(AntJre jre) {
+ checkNull(getJre(), "jre");
+ setJre(jre);
+ }
+
+ public void addSplash(Splash splash) {
+ checkNull(getSplash(), "splash");
+ setSplash(splash);
+ }
+
+ public void addVersionInfo(VersionInfo versionInfo) {
+ checkNull(getVersionInfo(), "versionInfo");
+ setVersionInfo(versionInfo);
+ }
+
+ public void addMessages(Msg messages) {
+ checkNull(getMessages(), "messages");
+ setMessages(messages);
+ }
+
+ // __________________________________________________________________________________
+
+ public void unwrap() {
+ setHeaderObjects(StringWrapper.unwrap(wrappedHeaderObjects));
+ setLibs(StringWrapper.unwrap(wrappedLibs));
+ setVariables(StringWrapper.unwrap(wrappedVariables));
+
+ if (getClassPath() != null) {
+ ((AntClassPath) getClassPath()).unwrap();
+ }
+
+ if (getJre() != null) {
+ ((AntJre) getJre()).unwrap();
+ }
+ }
+
+ private void checkNull(Object o, String name) {
+ if (o != null) {
+ throw new BuildException(
+ Messages.getString("AntConfig.duplicate.element")
+ + ": "
+ + name);
+ }
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/AntJre.java b/win/launch4j/src/net/sf/launch4j/ant/AntJre.java
new file mode 100755
index 0000000..a502bbe
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/AntJre.java
@@ -0,0 +1,69 @@
+/*
+ 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 Jul 18, 2006
+ */
+package net.sf.launch4j.ant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.launch4j.config.Jre;
+
+/**
+ * @author Copyright (C) 2006 Grzegorz Kowal
+ */
+public class AntJre extends Jre {
+ private final List wrappedOptions = new ArrayList();
+
+ public void addOpt(StringWrapper opt) {
+ wrappedOptions.add(opt);
+ }
+
+ public void unwrap() {
+ setOptions(StringWrapper.unwrap(wrappedOptions));
+ }
+
+ /**
+ * For backwards compatibility.
+ */
+ public void setDontUsePrivateJres(boolean dontUse) {
+ if (dontUse) {
+ setJdkPreference(JDK_PREFERENCE_JRE_ONLY);
+ }
+ else {
+ setJdkPreference(JDK_PREFERENCE_PREFER_JRE);
+ }
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/Launch4jTask.java b/win/launch4j/src/net/sf/launch4j/ant/Launch4jTask.java
new file mode 100755
index 0000000..a282876
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/Launch4jTask.java
@@ -0,0 +1,162 @@
+/*
+ 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 May 24, 2005
+ */
+package net.sf.launch4j.ant;
+
+import java.io.File;
+
+import net.sf.launch4j.Builder;
+import net.sf.launch4j.BuilderException;
+import net.sf.launch4j.Log;
+import net.sf.launch4j.config.Config;
+import net.sf.launch4j.config.ConfigPersister;
+import net.sf.launch4j.config.ConfigPersisterException;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class Launch4jTask extends Task {
+ private File _configFile;
+ private AntConfig _config;
+
+ // System properties
+ private File tmpdir; // launch4j.tmpdir
+ private File bindir; // launch4j.bindir
+
+ // Override configFile settings
+ private File jar;
+ private File outfile;
+ private String fileVersion;
+ private String txtFileVersion;
+ private String productVersion;
+ private String txtProductVersion;
+
+ public void execute() throws BuildException {
+ try {
+ if (tmpdir != null) {
+ System.setProperty("launch4j.tmpdir", tmpdir.getPath());
+ }
+ if (bindir != null) {
+ System.setProperty("launch4j.bindir", bindir.getPath());
+ }
+ if (_configFile != null && _config != null) {
+ throw new BuildException(
+ Messages.getString("Launch4jTask.specify.config"));
+ } else if (_configFile != null) {
+ ConfigPersister.getInstance().load(_configFile);
+ Config c = ConfigPersister.getInstance().getConfig();
+ if (jar != null) {
+ c.setJar(jar);
+ }
+ if (outfile != null) {
+ c.setOutfile(outfile);
+ }
+ if (fileVersion != null) {
+ c.getVersionInfo().setFileVersion(fileVersion);
+ }
+ if (txtFileVersion != null) {
+ c.getVersionInfo().setTxtFileVersion(txtFileVersion);
+ }
+ if (productVersion != null) {
+ c.getVersionInfo().setProductVersion(productVersion);
+ }
+ if (txtProductVersion != null) {
+ c.getVersionInfo().setTxtProductVersion(txtProductVersion);
+ }
+ } else if (_config != null) {
+ _config.unwrap();
+ ConfigPersister.getInstance().setAntConfig(_config,
+ getProject().getBaseDir());
+ } else {
+ throw new BuildException(
+ Messages.getString("Launch4jTask.specify.config"));
+ }
+ final Builder b = new Builder(Log.getAntLog());
+ b.build();
+ } catch (ConfigPersisterException e) {
+ throw new BuildException(e);
+ } catch (BuilderException e) {
+ throw new BuildException(e);
+ }
+ }
+
+ public void setConfigFile(File configFile) {
+ _configFile = configFile;
+ }
+
+ public void addConfig(AntConfig config) {
+ _config = config;
+ }
+
+ public void setBindir(File bindir) {
+ this.bindir = bindir;
+ }
+
+ public void setTmpdir(File tmpdir) {
+ this.tmpdir = tmpdir;
+ }
+
+ public void setFileVersion(String fileVersion) {
+ this.fileVersion = fileVersion;
+ }
+
+ public void setJar(File jar) {
+ this.jar = jar;
+ }
+
+ public void setJarPath(String path) {
+ this.jar = new File(path);
+ }
+
+ public void setOutfile(File outfile) {
+ this.outfile = outfile;
+ }
+
+ public void setProductVersion(String productVersion) {
+ this.productVersion = productVersion;
+ }
+
+ public void setTxtFileVersion(String txtFileVersion) {
+ this.txtFileVersion = txtFileVersion;
+ }
+
+ public void setTxtProductVersion(String txtProductVersion) {
+ this.txtProductVersion = txtProductVersion;
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/Messages.java b/win/launch4j/src/net/sf/launch4j/ant/Messages.java
new file mode 100755
index 0000000..0f823f7
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/Messages.java
@@ -0,0 +1,55 @@
+/*
+ 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.
+*/
+
+package net.sf.launch4j.ant;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "net.sf.launch4j.ant.messages";
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/StringWrapper.java b/win/launch4j/src/net/sf/launch4j/ant/StringWrapper.java
new file mode 100755
index 0000000..b57db57
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/StringWrapper.java
@@ -0,0 +1,69 @@
+/*
+ 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 Jul 18, 2006
+ */
+package net.sf.launch4j.ant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Copyright (C) 2006 Grzegorz Kowal
+ */
+public class StringWrapper {
+ private String text;
+
+ public static List unwrap(List wrappers) {
+ if (wrappers.isEmpty()) {
+ return null;
+ }
+
+ List strings = new ArrayList(wrappers.size());
+
+ for (StringWrapper w : wrappers) {
+ strings.add(w.toString());
+ }
+
+ return strings;
+ }
+
+ public void addText(String text) {
+ this.text = text;
+ }
+
+ public String toString() {
+ return text;
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/ant/messages.properties b/win/launch4j/src/net/sf/launch4j/ant/messages.properties
new file mode 100755
index 0000000..9666633
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/messages.properties
@@ -0,0 +1,35 @@
+#
+# 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.
+#
+
+Launch4jTask.specify.config=Specify configFile or config
+AntConfig.duplicate.element=Duplicate element
diff --git a/win/launch4j/src/net/sf/launch4j/ant/messages_es.properties b/win/launch4j/src/net/sf/launch4j/ant/messages_es.properties
new file mode 100755
index 0000000..9211e8e
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/ant/messages_es.properties
@@ -0,0 +1,35 @@
+#
+# Launch4j (http://launch4j.sourceforge.net/)
+# Cross-platform Java application wrapper for creating Windows native executables.
+#
+# Copyright (c) 2004, 2007 Grzegorz Kowal, Patricio Martínez Ros
+#
+# 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.
+#
+
+Launch4jTask.specify.config=Specify configFile or config
+AntConfig.duplicate.element=Duplicate element
diff --git a/win/launch4j/src/net/sf/launch4j/binding/Binding.java b/win/launch4j/src/net/sf/launch4j/binding/Binding.java
new file mode 100755
index 0000000..49c9b45
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/Binding.java
@@ -0,0 +1,62 @@
+/*
+ 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 Apr 30, 2005
+ */
+package net.sf.launch4j.binding;
+
+import java.awt.Color;
+
+/**
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public interface Binding {
+ /** Used to mark components with invalid data. */
+ public final static Color INVALID_COLOR = Color.PINK;
+
+ /** Java Bean property bound to a component */
+ public String getProperty();
+ /** Clear component, set it to the default value */
+ public void clear(IValidatable bean);
+ /** Java Bean property -> Component */
+ public void put(IValidatable bean);
+ /** Component -> Java Bean property */
+ public void get(IValidatable bean);
+ /** Mark component as valid */
+ public void markValid();
+ /** Mark component as invalid */
+ public void markInvalid();
+ /** Enable or disable the component */
+ public void setEnabled(boolean enabled);
+}
diff --git a/win/launch4j/src/net/sf/launch4j/binding/BindingException.java b/win/launch4j/src/net/sf/launch4j/binding/BindingException.java
new file mode 100755
index 0000000..15dc10c
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/BindingException.java
@@ -0,0 +1,52 @@
+/*
+ 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 Apr 30, 2005
+ */
+package net.sf.launch4j.binding;
+
+/**
+ * Signals a runtime error, a missing property in a Java Bean for example.
+ *
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class BindingException extends RuntimeException {
+ public BindingException(Throwable t) {
+ super(t);
+ }
+
+ public BindingException(String msg) {
+ super(msg);
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/binding/Bindings.java b/win/launch4j/src/net/sf/launch4j/binding/Bindings.java
new file mode 100755
index 0000000..f2427b1
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/Bindings.java
@@ -0,0 +1,324 @@
+/*
+ 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 Apr 30, 2005
+ */
+package net.sf.launch4j.binding;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.JRadioButton;
+import javax.swing.JTextArea;
+import javax.swing.JToggleButton;
+import javax.swing.text.JTextComponent;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+/**
+ * Creates and handles bindings.
+ *
+ * @author Copyright (C) 2005 Grzegorz Kowal
+ */
+public class Bindings implements PropertyChangeListener {
+ private final Map _bindings = new HashMap();
+ private final Map _optComponents = new HashMap();
+ private boolean _modified = false;
+
+ /**
+ * Used to track component modifications.
+ */
+ public void propertyChange(PropertyChangeEvent evt) {
+ String prop = evt.getPropertyName();
+ if ("AccessibleValue".equals(prop)
+ || "AccessibleText".equals(prop)
+ || "AccessibleVisibleData".equals(prop)) {
+ _modified = true;
+ }
+ }
+
+ /**
+ * Any of the components modified?
+ */
+ public boolean isModified() {
+ return _modified;
+ }
+
+ public Binding getBinding(String property) {
+ return _bindings.get(property);
+ }
+
+ private void registerPropertyChangeListener(JComponent c) {
+ c.getAccessibleContext().addPropertyChangeListener(this);
+ }
+
+ private void registerPropertyChangeListener(JComponent[] components) {
+ for (JComponent c : components) {
+ c.getAccessibleContext().addPropertyChangeListener(this);
+ }
+ }
+
+ private boolean isPropertyNull(IValidatable bean, Binding b) {
+ try {
+ for (String property : _optComponents.keySet()) {
+ if (b.getProperty().startsWith(property)) {
+ return PropertyUtils.getProperty(bean, property) == null;
+ }
+ }
+
+ return false;
+ } catch (Exception e) {
+ throw new BindingException(e);
+ }
+ }
+
+ /**
+ * Enables or disables all components bound to properties that begin with given prefix.
+ */
+ public void setComponentsEnabled(String prefix, boolean enabled) {
+ for (Binding b : _bindings.values()) {
+ if (b.getProperty().startsWith(prefix)) {
+ b.setEnabled(enabled);
+ }
+ }
+ }
+
+ /**
+ * Clear all components, set them to their default values.
+ * Clears the _modified flag.
+ */
+ public void clear(IValidatable bean) {
+ for (Binding b : _optComponents.values()) {
+ b.clear(bean);
+ }
+
+ for (Binding b : _bindings.values()) {
+ b.clear(bean);
+ }
+
+ _modified = false;
+ }
+
+ /**
+ * Copies data from the Java Bean to the UI components.
+ * Clears the _modified flag.
+ */
+ public void put(IValidatable bean) {
+ for (Binding b : _optComponents.values()) {
+ b.put(bean);
+ }
+
+ for (Binding b : _bindings.values()) {
+ if (isPropertyNull(bean, b)) {
+ b.clear(null);
+ } else {
+ b.put(bean);
+ }
+ }
+
+ _modified = false;
+ }
+
+ /**
+ * Copies data from UI components to the Java Bean and checks it's class invariants.
+ * Clears the _modified flag.
+ * @throws InvariantViolationException
+ * @throws BindingException
+ */
+ public void get(IValidatable bean) {
+ try {
+ for (Binding b : _optComponents.values()) {
+ b.get(bean);
+ }
+
+ for (Binding b : _bindings.values()) {
+ if (!isPropertyNull(bean, b)) {
+ b.get(bean);
+ }
+ }
+
+ bean.checkInvariants();
+
+ for (String property : _optComponents.keySet()) {
+ IValidatable component = (IValidatable) PropertyUtils.getProperty(bean,
+ property);
+
+ if (component != null) {
+ component.checkInvariants();
+ }
+ }
+
+ _modified = false; // XXX
+ } catch (InvariantViolationException e) {
+ e.setBinding(getBinding(e.getProperty()));
+ throw e;
+ } catch (Exception e) {
+ throw new BindingException(e);
+ }
+ }
+
+ private Bindings add(Binding b) {
+ if (_bindings.containsKey(b.getProperty())) {
+ throw new BindingException(Messages.getString("Bindings.duplicate.binding"));
+ }
+
+ _bindings.put(b.getProperty(), b);
+ return this;
+ }
+
+ /**
+ * Add an optional (nullable) Java Bean component of type clazz.
+ */
+ public Bindings addOptComponent(String property, Class extends IValidatable> clazz, JToggleButton c,
+ boolean enabledByDefault) {
+ Binding b = new OptComponentBinding(this, property, clazz, c, enabledByDefault);
+
+ if (_optComponents.containsKey(property)) {
+ throw new BindingException(Messages.getString("Bindings.duplicate.binding"));
+ }
+
+ _optComponents.put(property, b);
+ return this;
+ }
+
+ /**
+ * Add an optional (nullable) Java Bean component of type clazz.
+ */
+ public Bindings addOptComponent(String property, Class extends IValidatable> clazz, JToggleButton c) {
+ return addOptComponent(property, clazz, c, false);
+ }
+
+ /**
+ * Handles JEditorPane, JTextArea, JTextField
+ */
+ public Bindings add(String property, JTextComponent c, String defaultValue) {
+ registerPropertyChangeListener(c);
+ return add(new JTextComponentBinding(property, c, defaultValue));
+ }
+
+ /**
+ * Handles JEditorPane, JTextArea, JTextField
+ */
+ public Bindings add(String property, JTextComponent c) {
+ registerPropertyChangeListener(c);
+ return add(new JTextComponentBinding(property, c, ""));
+ }
+
+ /**
+ * Handles JToggleButton, JCheckBox
+ */
+ public Bindings add(String property, JToggleButton c, boolean defaultValue) {
+ registerPropertyChangeListener(c);
+ return add(new JToggleButtonBinding(property, c, defaultValue));
+ }
+
+ /**
+ * Handles JToggleButton, JCheckBox
+ */
+ public Bindings add(String property, JToggleButton c) {
+ registerPropertyChangeListener(c);
+ return add(new JToggleButtonBinding(property, c, false));
+ }
+
+ /**
+ * Handles JRadioButton
+ */
+ public Bindings add(String property, JRadioButton[] cs, int defaultValue) {
+ registerPropertyChangeListener(cs);
+ return add(new JRadioButtonBinding(property, cs, defaultValue));
+ }
+
+ /**
+ * Handles JRadioButton
+ */
+ public Bindings add(String property, JRadioButton[] cs) {
+ registerPropertyChangeListener(cs);
+ return add(new JRadioButtonBinding(property, cs, 0));
+ }
+
+ /**
+ * Handles JTextArea
+ */
+ public Bindings add(String property, JTextArea textArea, String defaultValue) {
+ registerPropertyChangeListener(textArea);
+ return add(new JTextComponentBinding(property, textArea, defaultValue));
+ }
+
+ /**
+ * Handles JTextArea lists
+ */
+ public Bindings add(String property, JTextArea textArea) {
+ registerPropertyChangeListener(textArea);
+ return add(new JTextAreaBinding(property, textArea));
+ }
+
+ /**
+ * Handles Optional JTextArea lists
+ */
+ public Bindings add(String property, String stateProperty,
+ JToggleButton button, JTextArea textArea) {
+ registerPropertyChangeListener(button);
+ registerPropertyChangeListener(textArea);
+ return add(new OptJTextAreaBinding(property, stateProperty, button, textArea));
+ }
+
+ /**
+ * Handles JList
+ */
+ public Bindings add(String property, JList list) {
+ registerPropertyChangeListener(list);
+ return add(new JListBinding(property, list));
+ }
+
+ /**
+ * Handles JComboBox
+ */
+ public Bindings add(String property, JComboBox combo, int defaultValue) {
+ registerPropertyChangeListener(combo);
+ return add(new JComboBoxBinding(property, combo, defaultValue));
+ }
+
+ /**
+ * Handles JComboBox
+ */
+ public Bindings add(String property, JComboBox combo) {
+ registerPropertyChangeListener(combo);
+ return add(new JComboBoxBinding(property, combo, 0));
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/binding/IValidatable.java b/win/launch4j/src/net/sf/launch4j/binding/IValidatable.java
new file mode 100755
index 0000000..fe0dd48
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/IValidatable.java
@@ -0,0 +1,44 @@
+/*
+ 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 2004-01-30
+ */
+package net.sf.launch4j.binding;
+
+/**
+ * @author Copyright (C) 2004 Grzegorz Kowal
+ */
+public interface IValidatable {
+ public void checkInvariants();
+}
diff --git a/win/launch4j/src/net/sf/launch4j/binding/InvariantViolationException.java b/win/launch4j/src/net/sf/launch4j/binding/InvariantViolationException.java
new file mode 100755
index 0000000..2f7f88b
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/InvariantViolationException.java
@@ -0,0 +1,67 @@
+/*
+ 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 Jun 23, 2003
+ */
+package net.sf.launch4j.binding;
+
+/**
+ * @author Copyright (C) 2003 Grzegorz Kowal
+ */
+public class InvariantViolationException extends RuntimeException {
+ private final String _property;
+ private Binding _binding;
+
+ public InvariantViolationException(String msg) {
+ super(msg);
+ _property = null;
+ }
+
+ public InvariantViolationException(String property, String msg) {
+ super(msg);
+ _property = property;
+ }
+
+ public String getProperty() {
+ return _property;
+ }
+
+ public Binding getBinding() {
+ return _binding;
+ }
+
+ public void setBinding(Binding binding) {
+ _binding = binding;
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/binding/JComboBoxBinding.java b/win/launch4j/src/net/sf/launch4j/binding/JComboBoxBinding.java
new file mode 100755
index 0000000..61b5d6d
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/JComboBoxBinding.java
@@ -0,0 +1,119 @@
+/*
+ Launch4j (http://launch4j.sourceforge.net/)
+ Cross-platform Java application wrapper for creating Windows native executables.
+
+ Copyright (c) 2007 Ian Roberts
+
+ 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 May 10, 2005
+ */
+package net.sf.launch4j.binding;
+
+import java.awt.Color;
+
+import javax.swing.JComboBox;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+/**
+ * @author Copyright (C) 2007 Ian Roberts
+ */
+public class JComboBoxBinding implements Binding {
+ private final String _property;
+ private final JComboBox _combo;
+ private final int _defaultValue;
+ private final Color _validColor;
+
+ public JComboBoxBinding(String property, JComboBox combo, int defaultValue) {
+ if (property == null || combo == null) {
+ throw new NullPointerException();
+ }
+ if (property.equals("")
+ || combo.getItemCount() == 0
+ || defaultValue < 0 || defaultValue >= combo.getItemCount()) {
+ throw new IllegalArgumentException();
+ }
+ _property = property;
+ _combo = combo;
+ _defaultValue = defaultValue;
+ _validColor = combo.getBackground();
+ }
+
+ public String getProperty() {
+ return _property;
+ }
+
+ public void clear(IValidatable bean) {
+ select(_defaultValue);
+ }
+
+ public void put(IValidatable bean) {
+ try {
+ Integer i = (Integer) PropertyUtils.getProperty(bean, _property);
+ if (i == null) {
+ throw new BindingException(
+ Messages.getString("JComboBoxBinding.property.null"));
+ }
+ select(i.intValue());
+ } catch (Exception e) {
+ throw new BindingException(e);
+ }
+ }
+
+ public void get(IValidatable bean) {
+ try {
+ PropertyUtils.setProperty(bean, _property, new Integer(_combo.getSelectedIndex()));
+ return;
+ } catch (Exception e) {
+ throw new BindingException(e);
+ }
+ }
+
+ private void select(int index) {
+ if (index < 0 || index >= _combo.getItemCount()) {
+ throw new BindingException(
+ Messages.getString("JComboBoxBinding.index.out.of.bounds"));
+ }
+ _combo.setSelectedIndex(index);
+ }
+
+ public void markValid() {
+ _combo.setBackground(_validColor);
+ _combo.requestFocusInWindow();
+ }
+
+ public void markInvalid() {
+ _combo.setBackground(Binding.INVALID_COLOR);
+ }
+
+ public void setEnabled(boolean enabled) {
+ _combo.setEnabled(enabled);
+ }
+}
diff --git a/win/launch4j/src/net/sf/launch4j/binding/JListBinding.java b/win/launch4j/src/net/sf/launch4j/binding/JListBinding.java
new file mode 100755
index 0000000..a3fa6f5
--- /dev/null
+++ b/win/launch4j/src/net/sf/launch4j/binding/JListBinding.java
@@ -0,0 +1,121 @@
+/*
+ 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 May 1, 2006
+ */
+package net.sf.launch4j.binding;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JList;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+/**
+ * @author Copyright (C) 2006 Grzegorz Kowal
+ */
+public class JListBinding implements Binding {
+ private final String _property;
+ private final JList _list;
+ private final Color _validColor;
+
+ public JListBinding(String property, JList list) {
+ if (property == null || list == null) {
+ throw new NullPointerException();
+ }
+ if (property.equals("")) {
+ throw new IllegalArgumentException();
+ }
+ _property = property;
+ _list = list;
+ _validColor = _list.getBackground();
+ }
+
+ public String getProperty() {
+ return _property;
+ }
+
+ public void clear(IValidatable bean) {
+ _list.setModel(new DefaultListModel());
+ }
+
+ public void put(IValidatable bean) {
+ try {
+ DefaultListModel model = new DefaultListModel();
+ List> list = (List>) PropertyUtils.getProperty(bean, _property);
+
+ if (list != null) {
+ for (Object o : list) {
+ model.addElement(o);
+ }
+ }
+
+ _list.setModel(model);
+ } catch (Exception e) {
+ throw new BindingException(e);
+ }
+ }
+
+ public void get(IValidatable bean) {
+ try {
+ DefaultListModel model = (DefaultListModel) _list.getModel();
+ final int size = model.getSize();
+ List