Compare commits

..

39 Commits

Author SHA1 Message Date
87832c4469 Set default fallback export profile 2025-11-05 16:51:00 +00:00
64059731cd Fixed missing book data on new book 2024-04-09 15:52:41 +01:00
bce4f70fd2 Added whisper to readme 2024-04-07 16:16:23 +01:00
5eaf884b88 Updated launch4j 2024-04-07 16:04:02 +01:00
19c17ae81d Removed sample length debugging message 2024-04-07 15:56:18 +01:00
a61a13397a Removing effect stderr noise 2024-04-07 15:55:49 +01:00
89e83f978b Fixed exception on empty gainpoints after recording 2024-04-07 15:50:58 +01:00
09436a17d8 Removed chain update message 2024-04-07 14:47:04 +01:00
3e84798d88 Clean up stdout noise 2024-04-07 13:04:16 +01:00
c64b17467d Fix System folder name in exports 2024-04-06 22:29:14 +01:00
c12187cae9 Implemented export profiles 2024-04-06 21:21:23 +01:00
81d436dcf5 Improved filename tokens and added LibriVox export option 2024-04-06 14:13:42 +01:00
091a62be2f Fix exception on first normalize 2023-07-28 16:23:57 +01:00
da197c64c7 Fix speech to text command execution 2023-07-28 14:25:52 +01:00
6b4ddbe5b4 Calculate 50% memory in linux stub 2021-06-10 01:22:04 +01:00
0c357fe959 Added Audiobooks Unleashed support 2021-06-10 01:17:45 +01:00
2064184093 Release 0.4.4 2021-06-03 10:40:34 +01:00
2e6ea5eecc Fixes to effect and tree synchronisation 2021-04-17 14:46:36 +01:00
0dde64e5fc Merge branch 'master' of github.com:MajenkoProjects/AudiobookRecorder 2021-01-22 14:13:38 +00:00
28a3326a35 Improved archive routine 2021-01-22 14:13:27 +00:00
df6b893171 Merge pull request #27 from MajenkoProjects/dependabot/maven/launch4j/maven/com.thoughtworks.xstream-xstream-1.4.15
Bump xstream from 1.4.14-java7 to 1.4.15 in /launch4j/maven
2021-01-22 04:22:43 -08:00
ead577521d Normalized all file paths 2021-01-22 11:55:38 +00:00
dependabot[bot]
cc1c76bd47 Bump xstream from 1.4.14-java7 to 1.4.15 in /launch4j/maven
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.14-java7 to 1.4.15.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 17:03:20 +00:00
b74f1aedb4 Bump xtream version 2020-11-16 20:58:51 +00:00
67d1e787ee Merge pull request #26 from MajenkoProjects/dependabot/maven/launch4j/maven/com.thoughtworks.xstream-xstream-1.4.13-java7
Bump xstream from 1.4.10-java7 to 1.4.13-java7 in /launch4j/maven
2020-11-16 20:56:19 +00:00
11ca88ee38 Merge pull request #25 from MajenkoProjects/dependabot/maven/launch4j/maven/org.apache.ant-ant-1.9.15
Bump ant from 1.8.2 to 1.9.15 in /launch4j/maven
2020-11-16 20:56:09 +00:00
dependabot[bot]
ae4e3db0d7 Bump xstream from 1.4.10-java7 to 1.4.13-java7 in /launch4j/maven
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.10-java7 to 1.4.13-java7.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 20:41:30 +00:00
dependabot[bot]
4314790271 Bump ant from 1.8.2 to 1.9.15 in /launch4j/maven
Bumps ant from 1.8.2 to 1.9.15.

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-14 18:42:19 +00:00
9c58276119 More improvements to gain curve 2020-09-01 19:02:43 +01:00
16380a9752 Some improvements to gain curve calculations 2020-08-31 17:09:03 +01:00
b523d80c25 Move normalize chapter to queue system 2020-08-25 17:10:39 +01:00
34d1f504c0 Released 0.4.3 2020-07-06 19:44:21 +01:00
d4a64d4e72 Automate gain profile generation 2020-07-06 18:17:49 +01:00
44201a0bbb Merge pull request #24 from MajenkoProjects/dependabot/maven/launch4j/maven/commons-beanutils-commons-beanutils-1.9.4
Bump commons-beanutils from 1.7.0 to 1.9.4 in /launch4j/maven
2020-07-01 11:23:38 +01:00
dependabot[bot]
1d19cd4c98 Bump commons-beanutils from 1.7.0 to 1.9.4 in /launch4j/maven
Bumps commons-beanutils from 1.7.0 to 1.9.4.

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-01 10:22:57 +00:00
4c89c70b05 Merge pull request #23 from MajenkoProjects/dependabot/maven/launch4j/maven/com.thoughtworks.xstream-xstream-1.4.10-java7
Bump xstream from 1.4.8 to 1.4.10-java7 in /launch4j/maven
2020-07-01 11:22:36 +01:00
dependabot[bot]
33eb219904 Bump xstream from 1.4.8 to 1.4.10-java7 in /launch4j/maven
Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.8 to 1.4.10-java7.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-30 23:31:32 +00:00
37c44ca462 Removed focus from upgrade button 2020-05-23 20:21:55 +01:00
19bf57143c Added RMS and clipping alert in tree view 2020-05-23 20:18:49 +01:00
225 changed files with 17462 additions and 14033 deletions

View File

@@ -0,0 +1,21 @@
<profile>
<code>librivox-noinit</code>
<name>LibriVox.org (Without initials)</name>
<export>
<bitrate>128000</bitrate>
<channels>1</channels>
<samples>44100</samples>
<format>{chapter.name:lower}_{book.author.short:lower}_{file.bitrate.kb}kb</format>
</export>
<gaps>
<pre-chapter>500</pre-chapter>
<post-chapter>5000</post-chapter>
<post-sentence>400</post-sentence>
<followon>100</followon>
<post-paragraph>1000</post-paragraph>
<post-section>1200</post-section>
</gaps>
<audio>
<rms>-19</rms>
</audio>
</profile>

View File

@@ -0,0 +1,21 @@
<profile>
<code>librivox-spc</code>
<name>LibriVox.org Short Poetry Collection</name>
<export>
<bitrate>128000</bitrate>
<channels>1</channels>
<samples>44100</samples>
<format>{book.title:lower}_{chapter.name:lower}_{narrator.initials:lower}_{file.bitrate.kb}kb</format>
</export>
<gaps>
<pre-chapter>500</pre-chapter>
<post-chapter>5000</post-chapter>
<post-sentence>400</post-sentence>
<followon>100</followon>
<post-paragraph>1000</post-paragraph>
<post-section>1200</post-section>
</gaps>
<audio>
<rms>-19</rms>
</audio>
</profile>

View File

@@ -0,0 +1,21 @@
<profile>
<code>librivox</code>
<name>LibriVox.org</name>
<export>
<bitrate>128000</bitrate>
<channels>1</channels>
<samples>44100</samples>
<format>{chapter.name:lower}_{book.author.short:lower}_{narrator.initials:lower}_{file.bitrate.kb}kb</format>
</export>
<gaps>
<pre-chapter>500</pre-chapter>
<post-chapter>5000</post-chapter>
<post-sentence>400</post-sentence>
<followon>100</followon>
<post-paragraph>1000</post-paragraph>
<post-section>1200</post-section>
</gaps>
<audio>
<rms>-19</rms>
</audio>
</profile>

View File

@@ -103,3 +103,20 @@ sox "$FILE" -r 16000 -c 1 -b 16 "/tmp/ds-${ID}.wav"
${BINPATH}/deepspeech --model ${MODELS}/output_graph.pbmm --lm ${MODELS}/lm.binary --trie ${MODELS}/trie --audio "/tmp/ds-${ID}.wav" 2>/dev/null
rm /tmp/ds-${ID}.wav
```
----
* Whisper wrapper script
This small script will use Whisper to do the same job as DeepSpeech but considerably faster and better.
```
#!/bin/bash
whisper --output_format txt --model small --fp16 False --output_dir /tmp --device cuda --language English "$1" > /dev/null
BASE=$(basename "$1" .wav)
TXT=${BASE}.txt
cat "/tmp/${TXT}" | tr '
' ' '
echo ""
```

3
dist/linux/stub vendored
View File

@@ -5,6 +5,7 @@ java=java
if test -n "$JAVA_HOME"; then
java="$JAVA_HOME/bin/java"
fi
java_args=-Xmx1g
MEM=`grep MemTotal: /proc/meminfo | awk '{printf "%.0f", ($2 / 1024 / 1024 /2)}'`
java_args=-Xmx${MEM}g
exec "$java" $java_args -jar $MYSELF "$@"
exit 1

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="demo/SimpleApp/build" path="demo/SimpleApp/src"/>
<classpathentry kind="src" output="demo/ConsoleApp/build" path="demo/ConsoleApp/src"/>
<classpathentry kind="lib" path="lib/formsrt.jar"/>
<classpathentry kind="lib" path="lib/xstream.jar"/>
<classpathentry kind="lib" path="lib/commons-beanutils.jar"/>
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
<classpathentry kind="lib" path="lib/foxtrot.jar"/>
<classpathentry kind="lib" path="lib/ant.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6"/>
<classpathentry kind="lib" path="lib/jgoodies-common.jar"/>
<classpathentry kind="lib" path="lib/jgoodies-forms.jar"/>
<classpathentry kind="lib" path="lib/jgoodies-looks.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="demo/ExitCodeApp/build" path="demo/ExitCodeApp/src"/>
<classpathentry kind="src" output="demo/SimpleApp/build" path="demo/SimpleApp/src"/>
<classpathentry kind="src" output="demo/ConsoleApp/build" path="demo/ConsoleApp/src"/>
<classpathentry kind="lib" path="lib/formsrt.jar"/>
<classpathentry kind="lib" path="lib/xstream.jar"/>
<classpathentry kind="lib" path="lib/commons-beanutils.jar"/>
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
<classpathentry kind="lib" path="lib/ant.jar"/>
<classpathentry kind="lib" path="lib/jgoodies-common.jar"/>
<classpathentry kind="lib" path="lib/jgoodies-forms.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/flatlaf.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>

1
launch4j/.gitignore vendored
View File

@@ -1 +0,0 @@
/build

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>launch4j</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>launch4j</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -1,2 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@@ -1,2 +1,2 @@
eclipse.preferences.version=1
line.separator=\n
eclipse.preferences.version=1
line.separator=\n

View File

@@ -1,81 +1,117 @@
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
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
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.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
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.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
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.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
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.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=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.reportPreviewFeatures=warning
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.suppressWarningsNotFullyAnalysed=info
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
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.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
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.unstableAutoModuleName=warning
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.unusedExceptionParameter=ignore
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.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

21
launch4j/.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"c:\\Program Files (x86)\\Dev-Cpp\\MinGW32\\include\\**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"cStandard": "gnu89",
"cppStandard": "gnu++98",
"intelliSenseMode": "windows-gcc-x86",
"compilerPath": "c:\\Program Files (x86)\\Dev-Cpp\\MinGW32\\bin\\gcc.exe"
}
],
"version": 4
}

17
launch4j/.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "make",
"targetName": "all",
"makeFileRelativePath": "head_src\\makefile",
"problemMatcher": [],
"label": "make: all",
"detail": "./head_src\\makefile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@@ -1,30 +1,30 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2021 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,62 +1,77 @@
<project name="launch4j" default="compile" basedir=".">
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="jar" location="./${ant.project.name}.jar" />
<property name="launch4j.dir" location="." />
<path id="dist.classpath">
<pathelement path="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.6" debug="on" includeantruntime="false" />
<copy todir="${build}/images">
<fileset dir="${src}/images">
<include name="**/*" />
</fileset>
</copy>
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="jar" depends="compile" description="create jar">
<fileset dir="${lib}" id="lib.dist.fileset">
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
<map from="${lib}" to="./lib" />
</pathconvert>
<!-- Put everything in ${build} into a jar file -->
<jar jarfile="${jar}">
<fileset dir="${build}" excludes="**/messages_es.properties" />
<manifest>
<attribute name="Main-Class" value="net.sf.launch4j.Main" />
<attribute name="Class-Path" value=". ${dist.classpath}" />
</manifest>
</jar>
</target>
<target name="demo" depends="jar" description="build the demos">
<ant dir="./demo/ConsoleApp" inheritAll="false" />
<ant dir="./demo/SimpleApp" inheritAll="false" />
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete file="${jar}" />
<ant dir="./demo/ConsoleApp" target="clean" inheritAll="false" />
<ant dir="./demo/SimpleApp" target="clean" inheritAll="false" />
</target>
</project>
<project name="launch4j" default="compile" basedir=".">
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="jar" location="./${ant.project.name}.jar" />
<property name="launch4j.dir" location="." />
<property name="maven" location="maven" />
<property file="${src}/launch4j.properties"/>
<path id="dist.classpath">
<pathelement path="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.8" debug="on" includeantruntime="false" />
<copy todir="${build}/images">
<fileset dir="${src}/images">
<include name="**/*" />
</fileset>
</copy>
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="jar" depends="compile" description="create jar">
<fileset dir="${lib}" id="lib.dist.fileset">
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
<map from="${lib}" to="./lib" />
</pathconvert>
<!-- Put everything in ${build} into a jar file -->
<jar jarfile="${jar}">
<fileset dir="${build}" excludes="**/messages_es.properties" />
<manifest>
<attribute name="Main-Class" value="net.sf.launch4j.Main" />
<attribute name="Class-Path" value=". ${dist.classpath}" />
</manifest>
</jar>
</target>
<target name="demo" depends="jar" description="build the demos">
<ant dir="./demo/ConsoleApp" inheritAll="false" />
<ant dir="./demo/SimpleApp" inheritAll="false" />
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete file="${jar}" />
<ant dir="./demo/ConsoleApp" target="clean" inheritAll="false" />
<ant dir="./demo/SimpleApp" target="clean" inheritAll="false" />
</target>
<target name="switch-to-maven" description="switch project to maven">
<copy todir="." overwrite="true">
<fileset dir="${maven}">
<include name="**/*" />
</fileset>
</copy>
<replace file="./pom.xml">
<replacefilter token="$${launch4j.version}" value="${version}"/>
</replace>
<delete dir="${lib}" />
<mkdir dir="./target" />
</target>
</project>

View File

@@ -1 +0,0 @@
/build

Binary file not shown.

View File

@@ -1,57 +1,57 @@
<project name="ConsoleApp" default="exe" basedir=".">
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="launch4j.dir" location="../.." />
<path id="dist.classpath">
<pathelement path="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.6" debug="on" includeantruntime="false" />
</target>
<target name="jar" depends="compile" description="create the jar">
<fileset dir="${lib}" id="lib.dist.fileset">
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
<map from="${lib}" to=".\lib" />
</pathconvert>
<!-- Put everything in ${build} into a jar file -->
<jar jarfile="${ant.project.name}.jar">
<fileset dir="${build}" includes="**/*" />
<manifest>
<!-- SET YOUR MAIN CLASS HERE -->
<attribute name="Main-Class" value="net.sf.launch4j.example.ConsoleApp" />
<attribute name="Class-Path" value=". ${dist.classpath}" />
</manifest>
</jar>
</target>
<target name="exe" depends="jar">
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<launch4j>
<config headerType="console" jar="ConsoleApp.jar" outfile="ConsoleApp.exe" errTitle="ConsoleApp" chdir="." icon="l4j/ConsoleApp.ico">
<singleInstance mutexName="net.sf.launch4j.example.ConsoleApp" />
<jre minVersion="1.6.0" />
</config>
</launch4j>
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete file="${ant.project.name}.jar" />
<delete file="${ant.project.name}.exe" />
</target>
</project>
<project name="ConsoleApp" default="exe" basedir=".">
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="launch4j.dir" location="../.." />
<path id="dist.classpath">
<pathelement path="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.8" debug="on" includeantruntime="false" />
</target>
<target name="jar" depends="compile" description="create the jar">
<fileset dir="${lib}" id="lib.dist.fileset">
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
<map from="${lib}" to=".\lib" />
</pathconvert>
<!-- Put everything in ${build} into a jar file -->
<jar jarfile="${ant.project.name}.jar">
<fileset dir="${build}" includes="**/*" />
<manifest>
<!-- SET YOUR MAIN CLASS HERE -->
<attribute name="Main-Class" value="net.sf.launch4j.example.ConsoleApp" />
<attribute name="Class-Path" value=". ${dist.classpath}" />
</manifest>
</jar>
</target>
<target name="exe" depends="jar">
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<launch4j>
<config headerType="console" jarPath="ConsoleApp.jar" dontWrapJar="true" outfile="ConsoleApp.exe" errTitle="ConsoleApp" chdir="." icon="l4j/ConsoleApp.ico">
<singleInstance mutexName="net.sf.launch4j.example.ConsoleApp" />
<jre path="%JAVA_HOME%;%PATH%" minVersion="1.8.0" />
</config>
</launch4j>
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete file="${ant.project.name}.jar" />
<delete file="${ant.project.name}.exe" />
</target>
</project>

View File

@@ -1,72 +1,72 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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, 'quit' or 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);
}
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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, 'quit' or 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);
}
}
}

View File

@@ -0,0 +1,75 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sf.launch4j.example</groupId>
<artifactId>ExitCodeApp</artifactId>
<version>1.0</version>
<name>ExitCodeApp</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.22</version>
<executions>
<execution>
<id>l4j</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>console</headerType>
<outfile>target/ExitCodeApp.exe</outfile>
<jar>target/ExitCodeApp-1.0.jar</jar>
<errTitle>ExitCodeApp</errTitle>
<classPath>
<mainClass>net.sf.launch4j.example.ExitCodeApp</mainClass>
<addDependencies>false</addDependencies>
<preCp>anything</preCp>
</classPath>
<jre>
<path>%JAVA_HOME%;%PATH%</path>
<minVersion>1.8.0</minVersion>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>1.0</txtFileVersion>
<fileDescription>Simple app for testing exit code.</fileDescription>
<copyright>Copyright (C) 2022 GK</copyright>
<productVersion>3.9.0.0</productVersion>
<txtProductVersion>3.9</txtProductVersion>
<productName>ExitCodeApp</productName>
<internalName>ExitCodeApp</internalName>
<originalFilename>ExitCodeApp.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,47 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.sf.launch4j.example;
public class ExitCodeApp {
public static void main(String[] args) {
int exitCode = 0;
if (args.length > 0) {
exitCode = Integer.parseInt(args[0]);
}
System.out.println("Exit code: " + String.valueOf(exitCode));
System.exit(exitCode);
}
}

View File

@@ -1,30 +1,30 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1 +0,0 @@
/build

Binary file not shown.

View File

@@ -1,52 +1,52 @@
<project name="SimpleApp" default="exe" basedir=".">
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="launch4j.dir" location="../.." />
<path id="dist.classpath">
<pathelement path="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.6" debug="on" includeantruntime="false" />
</target>
<target name="jar" depends="compile" description="create the jar">
<fileset dir="${lib}" id="lib.dist.fileset">
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
<map from="${lib}" to=".\lib" />
</pathconvert>
<!-- Put everything in ${build} into a jar file -->
<jar jarfile="${ant.project.name}.jar">
<fileset dir="${build}" includes="**/*" />
<manifest>
<!-- SET YOUR MAIN CLASS HERE -->
<attribute name="Main-Class" value="net.sf.launch4j.example.SimpleApp" />
<attribute name="Class-Path" value=". ${dist.classpath}" />
</manifest>
</jar>
</target>
<target name="exe" depends="jar">
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="./l4j/SimpleApp.xml" />
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete file="${ant.project.name}.jar" />
<delete file="${ant.project.name}.exe" />
</target>
</project>
<project name="SimpleApp" default="exe" basedir=".">
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="launch4j.dir" location="../.." />
<path id="dist.classpath">
<pathelement path="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.8" debug="on" includeantruntime="false" />
</target>
<target name="jar" depends="compile" description="create the jar">
<fileset dir="${lib}" id="lib.dist.fileset">
<include name="**/*.jar" />
</fileset>
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
<map from="${lib}" to=".\lib" />
</pathconvert>
<!-- Put everything in ${build} into a jar file -->
<jar jarfile="${ant.project.name}.jar">
<fileset dir="${build}" includes="**/*" />
<manifest>
<!-- SET YOUR MAIN CLASS HERE -->
<attribute name="Main-Class" value="net.sf.launch4j.example.SimpleApp" />
<attribute name="Class-Path" value=". ${dist.classpath}" />
</manifest>
</jar>
</target>
<target name="exe" depends="jar">
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="./l4j/SimpleApp.xml" />
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete file="${ant.project.name}.jar" />
<delete file="${ant.project.name}.exe" />
</target>
</project>

View File

@@ -1,18 +1,20 @@
<launch4jConfig>
<headerType>gui</headerType>
<jar>../SimpleApp.jar</jar>
<outfile>../SimpleApp.exe</outfile>
<errTitle>SimpleApp</errTitle>
<chdir>.</chdir>
<icon>SimpleApp.ico</icon>
<restartOnCrash>true</restartOnCrash>
<jre>
<minVersion>1.6.0</minVersion>
</jre>
<splash>
<file>splash.bmp</file>
<waitForWindow>true</waitForWindow>
<timeout>60</timeout>
<timeoutErr>true</timeoutErr>
</splash>
<launch4jConfig>
<headerType>gui</headerType>
<jar>SimpleApp.jar</jar>
<dontWrapJar>true</dontWrapJar>
<outfile>../SimpleApp.exe</outfile>
<errTitle>SimpleApp</errTitle>
<chdir>.</chdir>
<icon>SimpleApp.ico</icon>
<restartOnCrash>true</restartOnCrash>
<jre>
<path>%JAVA_HOME%;%PATH%</path>
<minVersion>1.8.0</minVersion>
</jre>
<splash>
<file>splash.bmp</file>
<waitForWindow>true</waitForWindow>
<timeout>60</timeout>
<timeoutErr>true</timeoutErr>
</splash>
</launch4jConfig>

View File

@@ -1,122 +1,195 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.sf.launch4j.example;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.AbstractAction;
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");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds (screenSize.width / 4, screenSize.height / 4, screenSize.width / 2, screenSize.height / 2);
JMenu menu = new JMenu("File");
menu.add(new JMenuItem("Open"));
menu.add(new JMenuItem("Save"));
menu.addSeparator();
menu.add(new JMenuItem(new AbstractAction("Exit with code 0") {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}));
menu.add(new JMenuItem(new AbstractAction("Exit with code 100 and restart the application") {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(100);
}
}));
JMenuBar mb = new JMenuBar();
mb.setOpaque(true);
mb.add(menu);
setJMenuBar(mb);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}});
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);
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.sf.launch4j.example;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
public class SimpleApp extends JFrame {
public SimpleApp(String[] args) {
super("Java Application");
if (args.length == 1 && "throw".equals(args[0])) {
throw new IllegalStateException("Exception thrown from SimpleApp.");
}
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds (screenSize.width / 4, screenSize.height / 4, screenSize.width / 2, screenSize.height / 2);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}});
initializeMenu();
initializeTextArea(args);
setVisible(true);
}
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);
}
private final void initializeMenu() {
JMenu menu = new JMenu("Exit with code");
menu.add(new JMenuItem(new AbstractAction("Exit with code 0") {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}));
menu.add(new JMenuItem(new AbstractAction("Exit with code 100 and restart the application") {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(100);
}
}));
JMenuBar mb = new JMenuBar();
mb.setOpaque(true);
mb.add(menu);
setJMenuBar(mb);
}
private final void initializeTextArea(String[] args) {
JTextArea textArea = new JTextArea();
textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
textArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(textArea);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
getContentPane().add(scrollPane);
textArea.setText(getMainProperties(args));
textArea.append(getAllProperties());
textArea.append(getEnvironmentVariables());
}
private final String getMainProperties(String[] args) {
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"));
sb.append("\nCommand line args: {");
for (int i = 0; i < args.length; i++) {
if (i > 0)
{
sb.append(' ');
}
sb.append(args[i]);
}
sb.append("}\n");
final int mb = 1024 * 1024;
sb.append("Free memory (MB): ");
sb.append(Runtime.getRuntime().freeMemory() / mb);
sb.append("\nTotal memory (MB): ");
sb.append(Runtime.getRuntime().totalMemory() / mb);
sb.append("\nMax memory (MB): ");
sb.append(Runtime.getRuntime().maxMemory() / mb);
sb.append("\n");
return sb.toString();
}
private final String getAllProperties() {
StringBuffer sb = new StringBuffer("\n========== All properties ==========\n");
List<String> keys = new ArrayList<String>();
keys.addAll(System.getProperties().stringPropertyNames());
Collections.sort(keys);
for (String key : keys) {
sb.append(key);
sb.append(": ");
sb.append(System.getProperty(key));
sb.append("\n");
}
return sb.toString();
}
private final String getEnvironmentVariables() {
StringBuffer sb = new StringBuffer("\n========== Environment variables ==========\n");
List<String> keys = new ArrayList<String>();
keys.addAll(System.getenv().keySet());
Collections.sort(keys);
for (String key : keys) {
sb.append(key);
sb.append(": ");
sb.append(System.getenv(key));
sb.append("\n");
}
return sb.toString();
}
}

View File

@@ -1,26 +1,26 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,26 +1,26 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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.
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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.

View File

@@ -1,2 +0,0 @@
/consolehead.exe
/consolehead.layout

View File

@@ -1,30 +1,28 @@
# Project: consolehead
# Makefile created by Dev-C++ 4.9.9.2
# Makefile created by Dev-C++ 5.7.1
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
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = ../../head/consolehead.o ../../head/head.o
LINKOBJ = ../../head/consolehead.o ../../head/head.o
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/lib" -static-libstdc++ -static-libgcc -n -s
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include/c++"
BIN = consolehead.exe
CXXFLAGS = $(CXXINCS) -Os
CFLAGS = $(INCS) -Os
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before consolehead.exe all-after
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
# $(CC) $(LINKOBJ) -o "consolehead.exe" $(LIBS)
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
../../head/consolehead.o: consolehead.c
$(CC) -c consolehead.c -o ../../head/consolehead.o $(CFLAGS)

View File

@@ -1,97 +1,97 @@
/*
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"
extern FILE* hLog;
BOOL restartOnCrash = FALSE;
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;
}
restartOnCrash = loadBool(RESTART_ON_CRASH);
DWORD dwExitCode;
do
{
dwExitCode = 0;
if (!execute(TRUE, &dwExitCode))
{
signalError();
break;
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return (int) dwExitCode;
}
/*
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"
extern FILE* hLog;
BOOL restartOnCrash = FALSE;
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, FALSE);
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;
}
restartOnCrash = loadBool(RESTART_ON_CRASH);
DWORD dwExitCode;
do
{
dwExitCode = 0;
if (!execute(TRUE, &dwExitCode))
{
signalError();
break;
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return (int) dwExitCode;
}

View File

@@ -3,7 +3,7 @@ FileName=consolehead.dev
Name=consolehead
UnitCount=4
Type=1
Ver=1
Ver=2
ObjFiles=
Includes=
Libs=
@@ -22,12 +22,14 @@ OverrideOutputName=consolehead.exe
HostApplication=
Folders=
CommandLine=
UseCustomMakefile=1
UseCustomMakefile=0
CustomMakefile=Makefile.win
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=0000000001001000000100
CompilerSettings=000000d000000000000001000
LogOutput=
LogOutputEnabled=0
[Unit1]
FileName=consolehead.c
@@ -47,7 +49,7 @@ Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileVersion=0.1.1.1
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
@@ -56,6 +58,7 @@ OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
SyncProduct=0
[Unit2]
FileName=..\resource.h

View File

@@ -1,2 +0,0 @@
/guihead.exe
/guihead.layout

View File

@@ -1,30 +1,28 @@
# Project: guihead
# Makefile created by Dev-C++ 4.9.9.2
# Makefile created by Dev-C++ 5.7.1
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
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = ../../head/guihead.o ../../head/head.o
LINKOBJ = ../../head/guihead.o ../../head/head.o
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/lib" -static-libstdc++ -static-libgcc -mwindows -n -s
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include/c++"
BIN = guihead.exe
CXXFLAGS = $(CXXINCS) -Os
CFLAGS = $(INCS) -Os
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before guihead.exe all-after
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
# $(CC) $(LINKOBJ) -o "guihead.exe" $(LIBS)
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
../../head/guihead.o: guihead.c
$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)

View File

@@ -1,240 +1,241 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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 processInformation;
HWND hWnd;
DWORD dwExitCode = 0;
BOOL stayAlive = FALSE;
BOOL splash = FALSE;
BOOL splashTimeoutErr;
BOOL waitForWindow;
BOOL restartOnCrash = FALSE;
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;
restartOnCrash = loadBool(RESTART_ON_CRASH);
// if we should restart on crash, we must also stay alive to check for crashes
stayAlive = restartOnCrash ||
(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);
}
}
do
{
if (splash || stayAlive)
{
if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc))
{
signalError();
return 1;
}
}
if (!execute(FALSE, &dwExitCode))
{
signalError();
return 1;
}
if (!(splash || stayAlive))
{
debug("Exit code:\t0\n");
closeProcessHandles();
closeLogFile();
return 0;
}
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
closeProcessHandles();
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
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 (processInformation.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(processInformation.hProcess, &dwExitCode);
if (dwExitCode != STILL_ACTIVE
|| !(splash || stayAlive))
{
KillTimer(hWnd, ID_TIMER);
PostQuitMessage(0);
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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 processInformation;
HWND hWnd;
DWORD dwExitCode = 0;
BOOL stayAlive = FALSE;
BOOL splash = FALSE;
BOOL splashTimeoutErr;
BOOL waitForWindow;
BOOL restartOnCrash = FALSE;
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int result = prepare(lpCmdLine, FALSE);
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;
restartOnCrash = loadBool(RESTART_ON_CRASH);
// if we should restart on crash, we must also stay alive to check for crashes
stayAlive = restartOnCrash ||
(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;
}
}
splashTimeout = splashTimeout * 1000; // to millis
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);
}
}
do
{
if (splash || stayAlive)
{
if (!SetTimer (hWnd, ID_TIMER, TIMER_PROC_INTERVAL, TimerProc))
{
signalError();
return 1;
}
}
if (!execute(FALSE, &dwExitCode))
{
signalError();
return 1;
}
if (!(splash || stayAlive))
{
debug("Exit code:\t0\n");
closeProcessHandles();
closeLogFile();
return 0;
}
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
closeProcessHandles();
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
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 (processInformation.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 -= TIMER_PROC_INTERVAL;
if (waitForWindow)
{
EnumWindows(enumwndfn, 0);
}
}
}
GetExitCodeProcess(processInformation.hProcess, &dwExitCode);
if (dwExitCode != STILL_ACTIVE
|| !(splash || stayAlive))
{
KillTimer(hWnd, ID_TIMER);
PostQuitMessage(0);
}
}

View File

@@ -3,7 +3,7 @@ FileName=guihead.dev
Name=guihead
UnitCount=5
Type=0
Ver=1
Ver=2
ObjFiles=
Includes=
Libs=
@@ -22,12 +22,14 @@ OverrideOutputName=guihead.exe
HostApplication=
Folders=
CommandLine=
UseCustomMakefile=1
UseCustomMakefile=0
CustomMakefile=Makefile.win
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=0000000001001000000100
CompilerSettings=000000d000000000000001000
LogOutput=
LogOutputEnabled=0
[Unit1]
FileName=guihead.c
@@ -66,6 +68,7 @@ OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
SyncProduct=0
[Unit4]
FileName=..\head.h
@@ -95,7 +98,7 @@ Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
BuildCmd=$(CC) -c head.c -o ../../head/head.o $(CFLAGS)
[Unit5]
FileName=..\resource.h

View File

@@ -1,43 +1,44 @@
/*
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
);
/*
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 */
#define TIMER_PROC_INTERVAL 100 /* interval in ms between calls to EnumWindows */
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
);

View File

@@ -2,7 +2,7 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal,
Copyright (c) 2004, 2019 Grzegorz Kowal,
Ian Roberts (jdk preference patch)
Sylvain Mina (single instance patch)
@@ -37,6 +37,7 @@ FILE* hLog;
BOOL debugAll = FALSE;
BOOL console = FALSE;
BOOL wow64 = FALSE;
BOOL jniHeader = FALSE;
char oldPwd[_MAX_PATH];
PROCESS_INFORMATION processInformation;
@@ -51,25 +52,28 @@ struct
struct
{
int runtimeBits;
int foundJava;
BOOL bundledJreAsFallback;
BOOL requiresJdk;
BOOL requires64Bit;
BOOL corruptedJreFound;
char originalJavaMinVer[STR];
char originalJavaMaxVer[STR];
char javaMinVer[STR];
char javaMaxVer[STR];
char foundJavaVer[STR];
char foundJavaKey[_MAX_PATH];
char foundJavaHome[_MAX_PATH];
} search;
struct
{
char mainClass[_MAX_PATH];
char cmd[_MAX_PATH];
char args[MAX_ARGS];
} launcher;
BOOL initGlobals()
BOOL initGlobals(BOOL jni)
{
jniHeader = jni;
hModule = GetModuleHandle(NULL);
if (hModule == NULL)
@@ -79,9 +83,9 @@ BOOL initGlobals()
strcpy(error.title, LAUNCH4j);
search.runtimeBits = INIT_RUNTIME_BITS;
search.foundJava = NO_JAVA_FOUND;
search.bundledJreAsFallback = FALSE;
search.foundJava = JAVA_NOT_FOUND;
search.requiresJdk = FALSE;
search.requires64Bit = FALSE;
search.corruptedJreFound = FALSE;
return TRUE;
@@ -138,7 +142,7 @@ void setWow64Flag()
fnIsWow64Process(GetCurrentProcess(), &wow64);
}
debug("WOW64:\t\t%s\n", wow64 ? "yes" : "no");
debug("WOW64:\t\t%s\n", wow64 ? "Yes" : "No");
}
void setConsoleFlag()
@@ -150,7 +154,14 @@ void msgBox(const char* text)
{
if (console)
{
printf("%s: %s\n", error.title, text);
if (*error.title)
{
printf("%s: %s\n", error.title, text);
}
else
{
printf("%s\n", text);
}
}
else
{
@@ -197,6 +208,7 @@ BOOL loadString(const int resID, char* buffer)
HRSRC hResource;
HGLOBAL hResourceLoaded;
LPBYTE lpBuffer;
debugAll("Resource %d:\t", resID);
hResource = FindResourceEx(hModule, RT_RCDATA, MAKEINTRESOURCE(resID),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT));
@@ -214,10 +226,7 @@ BOOL loadString(const int resID, char* buffer)
buffer[x] = (char) lpBuffer[x];
} while (buffer[x++] != 0);
if (debugAll)
{
debug("Resource %d:\t%s\n", resID, buffer);
}
debugAll("%s\n", buffer);
return TRUE;
}
}
@@ -227,6 +236,8 @@ BOOL loadString(const int resID, char* buffer)
SetLastError(0);
buffer[0] = 0;
}
debugAll("<NULL>\n");
return FALSE;
}
@@ -302,6 +313,120 @@ BOOL regQueryValue(const char* regPath, unsigned char* buffer,
return result;
}
int findNextVersionPart(const char* startAt)
{
if (startAt == NULL || strlen(startAt) == 0)
{
return 0;
}
char* firstSeparatorA = strchr(startAt, '.');
char* firstSeparatorB = strchr(startAt, '_');
char* firstSeparator;
if (firstSeparatorA == NULL)
{
firstSeparator = firstSeparatorB;
}
else if (firstSeparatorB == NULL)
{
firstSeparator = firstSeparatorA;
}
else
{
firstSeparator = min(firstSeparatorA, firstSeparatorB);
}
if (firstSeparator == NULL)
{
return strlen(startAt);
}
return firstSeparator - startAt;
}
/**
* This method will take java version from `originalVersion` string and convert/format it
* into `version` string that can be used for string comparison with other versions.
*
* Due to different version schemas <=8 vs. >=9 it will "normalize" versions to 1 format
* so we can directly compare old and new versions.
*/
void formatJavaVersion(char* version, const char* originalVersion)
{
strcpy(version, "");
if (originalVersion == NULL || strlen(originalVersion) == 0)
{
return;
}
int partsAdded = 0;
int i;
char* pos = (char*) originalVersion;
int curPartLen;
while ((curPartLen = findNextVersionPart(pos)) > 0)
{
char number[curPartLen + 1];
memset(number, 0, curPartLen + 1);
strncpy(number, pos, curPartLen);
if (partsAdded == 0 && (curPartLen != 1 || number[0] != '1'))
{
// NOTE: When it's java 9+ we'll add "1" as the first part of the version
strcpy(version, "1");
partsAdded++;
}
if (partsAdded < 3)
{
if (partsAdded > 0)
{
strcat(version, ".");
}
for (i = 0;
(partsAdded > 0)
&& (i < JRE_VER_MAX_DIGITS_PER_PART - strlen(number));
i++)
{
strcat(version, "0");
}
strcat(version, number);
}
else if (partsAdded == 3)
{
// add as an update
strcat(version, "_");
for (i = 0; i < JRE_VER_MAX_DIGITS_PER_PART - strlen(number); i++)
{
strcat(version, "0");
}
strcat(version, number);
}
else if (partsAdded >= 4)
{
debug("Warning:\tformatJavaVersion() too many parts added.\n");
break;
}
partsAdded++;
pos += curPartLen + 1;
if (pos >= originalVersion + strlen(originalVersion))
{
break;
}
}
for (i = partsAdded; i < 3; i++)
{
strcat(version, ".");
int j;
for (j = 0; j < JRE_VER_MAX_DIGITS_PER_PART; j++)
{
strcat(version, "0");
}
}
}
void regSearch(const char* keyName, const int searchType)
{
HKEY hKey;
@@ -322,12 +447,13 @@ void regSearch(const char* keyName, const int searchType)
unsigned long versionSize = _MAX_PATH;
FILETIME time;
char fullKeyName[_MAX_PATH] = {0};
char originalVersion[_MAX_PATH] = {0};
char version[_MAX_PATH] = {0};
while (RegEnumKeyEx(
hKey, // handle to key to enumerate
x++, // index of subkey to enumerate
version, // address of buffer for subkey name
originalVersion,// address of buffer for subkey name
&versionSize, // address for size of subkey buffer
NULL, // reserved
NULL, // address of buffer for class string
@@ -335,31 +461,27 @@ void regSearch(const char* keyName, const int searchType)
&time) == ERROR_SUCCESS)
{
strcpy(fullKeyName, keyName);
appendPath(fullKeyName, version);
appendPath(fullKeyName, originalVersion);
debug("Check:\t\t%s\n", fullKeyName);
formatJavaVersion(version, originalVersion);
if (strcmp(version, search.javaMinVer) >= 0
&& (!*search.javaMaxVer || strcmp(version, search.javaMaxVer) <= 0)
&& strcmp(version, search.foundJavaVer) > 0
&& isJavaHomeValid(fullKeyName, searchType))
if (isJavaVersionGood(version, wow64KeyMask)
&& isRegistryJavaHomeValid(fullKeyName, searchType))
{
strcpy(search.foundJavaVer, version);
strcpy(search.foundJavaKey, fullKeyName);
search.foundJava = searchType;
debug("Match:\t\t%s\n", version);
}
else
{
debug("Ignore:\t\t%s\n", version);
break;
}
debug("Ignore:\t\t%s\n", version);
versionSize = _MAX_PATH;
}
RegCloseKey(hKey);
}
BOOL isJavaHomeValid(const char* keyName, const int searchType)
BOOL isRegistryJavaHomeValid(const char* keyName, const int searchType)
{
BOOL valid = FALSE;
HKEY hKey;
@@ -384,10 +506,6 @@ BOOL isJavaHomeValid(const char* keyName, const int searchType)
path[i] = buffer[i];
} while (path[i++] != 0);
if (searchType & FOUND_SDK)
{
appendPath(path, "jre");
}
valid = isLauncherPathValid(path);
}
RegCloseKey(hKey);
@@ -409,6 +527,7 @@ BOOL isLauncherPathValid(const char* path)
{
struct _stat statBuf;
char launcherPath[_MAX_PATH] = {0};
char javacPath[_MAX_PATH] = {0};
BOOL result = FALSE;
if (*path)
@@ -416,6 +535,15 @@ BOOL isLauncherPathValid(const char* path)
strcpy(launcherPath, path);
appendLauncher(launcherPath);
result = _stat(launcherPath, &statBuf) == 0;
debug("Check launcher:\t%s %s\n", launcherPath, result ? "(OK)" : "(not found)");
if (result && search.requiresJdk)
{
strcpy(javacPath, path);
appendPath(javacPath, "bin\\javac.exe");
result = _stat(javacPath, &statBuf) == 0;
debug("Check javac:\t%s %s\n", javacPath, result ? "(OK)" : "(not found)");
}
if (!result)
{
@@ -424,101 +552,73 @@ BOOL isLauncherPathValid(const char* path)
}
}
debug("Check launcher:\t%s %s\n", launcherPath, result ? "(OK)" : "(not found)");
return result;
}
void regSearchWow(const char* keyName, const int searchType)
void regSearchWow(const char* keyName)
{
if (search.runtimeBits == INIT_RUNTIME_BITS)
if (search.foundJava != JAVA_NOT_FOUND)
{
search.runtimeBits = loadInt(RUNTIME_BITS);
return;
}
switch (search.runtimeBits)
if (wow64 && !jniHeader)
{
case USE_64_BIT_RUNTIME:
if (wow64)
{
regSearch(keyName, searchType | KEY_WOW64_64KEY);
}
break;
case USE_64_AND_32_BIT_RUNTIME:
if (wow64)
{
regSearch(keyName, searchType | KEY_WOW64_64KEY);
regSearch(keyName, JAVA_FOUND | KEY_WOW64_64KEY);
if ((search.foundJava & KEY_WOW64_64KEY) != NO_JAVA_FOUND)
{
break;
}
}
if ((search.foundJava & KEY_WOW64_64KEY) != JAVA_NOT_FOUND)
{
return;
}
}
regSearch(keyName, searchType);
break;
case USE_32_AND_64_BIT_RUNTIME:
regSearch(keyName, searchType);
if (search.foundJava != NO_JAVA_FOUND
&& (search.foundJava & KEY_WOW64_64KEY) == NO_JAVA_FOUND)
{
break;
}
if (wow64)
{
regSearch(keyName, searchType | KEY_WOW64_64KEY);
}
break;
case USE_32_BIT_RUNTIME:
regSearch(keyName, searchType);
break;
if (!search.requires64Bit)
{
regSearch(keyName, JAVA_FOUND);
}
}
void regSearchJreSdk(const char* jreKeyName, const char* sdkKeyName,
const int jdkPreference)
BOOL findRegistryJavaHome(char* path)
{
if (jdkPreference == JDK_ONLY || jdkPreference == PREFER_JDK)
{
regSearchWow(sdkKeyName, FOUND_SDK);
if (jdkPreference != JDK_ONLY)
{
regSearchWow(jreKeyName, FOUND_JRE);
}
debugAll("findRegistryJavaHome()\n");
if (!search.requiresJdk)
{
regSearchWow("SOFTWARE\\JavaSoft\\Java Runtime Environment");
}
else
{
// jdkPreference == JRE_ONLY or PREFER_JRE
regSearchWow(jreKeyName, FOUND_JRE);
if (jdkPreference != JRE_ONLY)
{
regSearchWow(sdkKeyName, FOUND_SDK);
}
regSearchWow("SOFTWARE\\JavaSoft\\Java Development Kit");
// Java 9 support
if (!search.requiresJdk)
{
regSearchWow("SOFTWARE\\JavaSoft\\JRE");
}
}
regSearchWow("SOFTWARE\\JavaSoft\\JDK");
BOOL findJavaHome(char* path, const int jdkPreference)
{
regSearchJreSdk("SOFTWARE\\JavaSoft\\Java Runtime Environment",
"SOFTWARE\\JavaSoft\\Java Development Kit",
jdkPreference);
if (search.foundJava == NO_JAVA_FOUND)
// IBM Java 1.8
if (search.foundJava == JAVA_NOT_FOUND)
{
regSearchJreSdk("SOFTWARE\\IBM\\Java2 Runtime Environment",
"SOFTWARE\\IBM\\Java Development Kit",
jdkPreference);
if (!search.requiresJdk)
{
regSearchWow("SOFTWARE\\IBM\\Java Runtime Environment");
}
regSearchWow("SOFTWARE\\IBM\\Java Development Kit");
}
if (search.foundJava != NO_JAVA_FOUND)
// IBM Java 1.7 and earlier
if (search.foundJava == JAVA_NOT_FOUND)
{
if (!search.requiresJdk)
{
regSearchWow("SOFTWARE\\IBM\\Java2 Runtime Environment");
}
regSearchWow("SOFTWARE\\IBM\\Java Development Kit");
}
if (search.foundJava != JAVA_NOT_FOUND)
{
strcpy(path, search.foundJavaHome);
debug("Runtime used:\t%s (%s-bit)\n", search.foundJavaVer,
(search.foundJava & KEY_WOW64_64KEY) != NO_JAVA_FOUND ? "64" : "32");
(search.foundJava & KEY_WOW64_64KEY) != JAVA_NOT_FOUND ? "64" : "32");
return TRUE;
}
@@ -613,6 +713,10 @@ BOOL expandVars(char *dst, const char *src, const char *exePath, const int pathL
else if (strstr(varName, HKEY_STR) == varName)
{
regQueryValue(varName, dst + strlen(dst), BIG_STR);
}
else if (strcmp(varName, "") == 0)
{
strcat(dst, "%");
}
else if (GetEnvironmentVariable(varName, varValue, MAX_VAR_SIZE) > 0)
{
@@ -733,6 +837,7 @@ BOOL createMutex()
if (*mutexName)
{
debug("Create mutex:\t%s\n", mutexName);
SECURITY_ATTRIBUTES security;
security.nLength = sizeof(SECURITY_ATTRIBUTES);
security.bInheritHandle = TRUE;
@@ -765,44 +870,90 @@ void setWorkingDirectory(const char *exePath, const int pathLen)
}
}
BOOL bundledJreSearch(const char *exePath, const int pathLen)
void removeChar(char *src, const char toRemove)
{
char tmpPath[_MAX_PATH] = {0};
char* dst = src;
if (loadString(JRE_PATH, tmpPath))
do
{
if (*src != toRemove)
{
*dst++ = *src;
}
} while (*src++ != 0);
}
BOOL pathJreSearch(const char *exePath, const int pathLen)
{
debugAll("pathJreSearch()\n");
char jrePathSpec[_MAX_PATH] = {0};
if (!wow64 && search.requires64Bit)
{
debug("JRE:\t\tCannot use 64-bit runtime on 32-bit OS.\n");
return FALSE;
}
if (loadString(JRE_PATH, jrePathSpec))
{
char jrePath[MAX_ARGS] = {0};
expandVars(jrePath, tmpPath, exePath, pathLen);
debug("Bundled JRE:\t%s\n", jrePath);
expandVars(jrePath, jrePathSpec, exePath, pathLen);
debug("JRE paths:\t%s\n", jrePath);
char* path = strtok(jrePath, ";");
while (path != NULL)
{
char pathNoBin[_MAX_PATH] = {0};
char *lastBackslash = strrchr(path, '\\');
char *lastSlash = strrchr(path, '/');
if (jrePath[0] == '\\' || jrePath[1] == ':')
{
// Absolute
strcpy(launcher.cmd, jrePath);
}
else
{
// Relative
strncpy(launcher.cmd, exePath, pathLen);
appendPath(launcher.cmd, jrePath);
}
if (lastBackslash != NULL && strcasecmp(lastBackslash, "\\bin") == 0)
{
strncpy(pathNoBin, path, lastBackslash - path);
}
else if (lastSlash != NULL && strcasecmp(lastSlash, "/bin") == 0)
{
strncpy(pathNoBin, path, lastSlash - path);
}
else
{
strcpy(pathNoBin, path);
}
removeChar(pathNoBin, '"');
if (isLauncherPathValid(launcher.cmd))
{
search.foundJava = (wow64 && loadBool(BUNDLED_JRE_64_BIT))
? FOUND_BUNDLED | KEY_WOW64_64KEY
: FOUND_BUNDLED;
strcpy(search.foundJavaHome, launcher.cmd);
return TRUE;
}
if (*pathNoBin == '\\' || (*pathNoBin != '\0' && *(pathNoBin + 1) == ':'))
{
// Absolute
strcpy(launcher.cmd, pathNoBin);
}
else
{
// Relative
strncpy(launcher.cmd, exePath, pathLen);
launcher.cmd[pathLen] = 0;
appendPath(launcher.cmd, pathNoBin);
}
BOOL is64Bit;
if (isLauncherPathValid(launcher.cmd) && isPathJavaVersionGood(launcher.cmd, &is64Bit))
{
search.foundJava = is64Bit ? JAVA_FOUND | KEY_WOW64_64KEY : JAVA_FOUND;
strcpy(search.foundJavaHome, launcher.cmd);
return TRUE;
}
path = strtok(NULL, ";");
}
}
return FALSE;
}
BOOL installedJreSearch()
BOOL registryJreSearch()
{
return *search.javaMinVer && findJavaHome(launcher.cmd, loadInt(JDK_PREFERENCE));
debugAll("registryJreSearch()\n");
return *search.javaMinVer && findRegistryJavaHome(launcher.cmd);
}
void createJreSearchError()
@@ -811,20 +962,17 @@ void createJreSearchError()
{
loadString(JRE_VERSION_ERR, error.msg);
strcat(error.msg, " ");
strcat(error.msg, search.javaMinVer);
strcat(error.msg, search.originalJavaMinVer);
if (*search.javaMaxVer)
{
strcat(error.msg, " - ");
strcat(error.msg, search.javaMaxVer);
strcat(error.msg, search.originalJavaMaxVer);
}
if (search.runtimeBits == USE_64_BIT_RUNTIME
|| search.runtimeBits == USE_32_BIT_RUNTIME)
if (search.requires64Bit)
{
strcat(error.msg, " (");
strcat(error.msg, search.runtimeBits == USE_64_BIT_RUNTIME ? "64" : "32");
strcat(error.msg, "-bit)");
strcat(error.msg, " (64-bit)");
}
if (search.corruptedJreFound)
@@ -842,33 +990,31 @@ void createJreSearchError()
}
else
{
loadString(BUNDLED_JRE_ERR, error.msg);
loadString(JRE_NOT_FOUND_ERR, error.msg);
}
}
BOOL jreSearch(const char *exePath, const int pathLen)
{
debugAll("jreSearch()\n");
BOOL result = TRUE;
search.bundledJreAsFallback = loadBool(BUNDLED_JRE_AS_FALLBACK);
loadString(JAVA_MIN_VER, search.javaMinVer);
loadString(JAVA_MAX_VER, search.javaMaxVer);
search.requiresJdk = loadBool(REQUIRES_JDK);
debug("Requires JDK:\t%s\n", search.requiresJdk ? "Yes" : "No");
search.requires64Bit = loadBool(REQUIRES_64_BIT);
debug("Requires 64-Bit: %s\n", search.requires64Bit ? "Yes" : "No");
loadString(JAVA_MIN_VER, search.originalJavaMinVer);
formatJavaVersion(search.javaMinVer, search.originalJavaMinVer);
debug("Java min ver:\t%s\n", search.javaMinVer);
loadString(JAVA_MAX_VER, search.originalJavaMaxVer);
formatJavaVersion(search.javaMaxVer, search.originalJavaMaxVer);
debug("Java max ver:\t%s\n", search.javaMaxVer);
if (search.bundledJreAsFallback)
if (!pathJreSearch(exePath, pathLen))
{
if (!installedJreSearch())
{
result = bundledJreSearch(exePath, pathLen);
}
result = registryJreSearch();
}
else
{
if (!bundledJreSearch(exePath, pathLen))
{
result = installedJreSearch();
}
}
if (!result)
{
createJreSearchError();
@@ -934,14 +1080,15 @@ void setMainClassAndClassPath(const char *exePath, const int pathLen)
{
char classPath[MAX_ARGS] = {0};
char expandedClassPath[MAX_ARGS] = {0};
char mainClass[STR] = {0};
char jar[_MAX_PATH] = {0};
char fullFileName[_MAX_PATH] = {0};
const BOOL wrapper = loadBool(WRAPPER);
loadString(JAR, jar);
if (loadString(MAIN_CLASS, mainClass))
if (loadString(MAIN_CLASS, launcher.mainClass))
{
debug("Main class:\t%s\n", launcher.mainClass);
if (!loadString(CLASSPATH, classPath))
{
debug("Info:\t\tClasspath not defined.\n");
@@ -997,7 +1144,7 @@ void setMainClassAndClassPath(const char *exePath, const int pathLen)
*(launcher.args + strlen(launcher.args) - 1) = 0;
strcat(launcher.args, "\" ");
strcat(launcher.args, mainClass);
strcat(launcher.args, launcher.mainClass);
}
else if (wrapper)
{
@@ -1050,9 +1197,9 @@ void setCommandLineArgs(const char *lpCmdLine)
}
}
int prepare(const char *lpCmdLine)
int prepare(const char *lpCmdLine, BOOL jni)
{
if (!initGlobals())
if (!initGlobals(jni))
{
return FALSE;
}
@@ -1071,6 +1218,7 @@ int prepare(const char *lpCmdLine)
return FALSE;
}
debug("JNI:\t\t%s\n", jniHeader ? "Yes" : "No");
setWow64Flag();
// Set default error message, title and optional support web site url.
@@ -1158,3 +1306,147 @@ BOOL execute(const BOOL wait, DWORD *dwExitCode)
*dwExitCode = -1;
return FALSE;
}
const char* getJavaHome()
{
return search.foundJavaHome;
}
const char* getMainClass()
{
return launcher.mainClass;
}
const char* getLauncherArgs()
{
return launcher.args;
}
/* read java version output and save version string in version */
void getVersionFromOutput(HANDLE outputRd, char *version, int versionLen, BOOL *is64Bit)
{
CHAR chBuf[BIG_STR] = {0}, *bptr = chBuf;
DWORD dwRead, remain = sizeof(chBuf);
BOOL bSuccess = FALSE;
while (remain > 0) {
bSuccess = ReadFile(outputRd, bptr, remain, &dwRead, NULL);
if (! bSuccess || dwRead == 0) break;
bptr += dwRead;
remain -= dwRead;
}
debugAll("Java version output: %s\n", chBuf);
*version = '\0';
const char *verStartPtr = strchr(chBuf, '"');
if (verStartPtr == NULL)
{
debug("Cannot get version string: cannot find quote\n");
return;
}
const char *verEndPtr = strchr(++verStartPtr, '"');
if (verEndPtr == NULL)
{
debug("Cannot get version string: missing end quote\n");
return;
}
size_t len = verEndPtr - verStartPtr;
if (len >= versionLen) {
debug("Cannot get version string: data too large\n");
return;
}
memcpy(version, verStartPtr, len);
version[len] = '\0';
*is64Bit = strstr(chBuf, "64-Bit") != NULL || strstr(chBuf, "64-bit") != NULL;
}
/* create a child process with cmdline and set stderr/stdout to outputWr */
BOOL CreateChildProcess(char *cmdline, HANDLE outputWr)
{
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
BOOL bSuccess = FALSE;
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION));
ZeroMemory(&siStartInfo, sizeof(STARTUPINFO));
siStartInfo.cb = sizeof(STARTUPINFO);
siStartInfo.hStdError = outputWr;
siStartInfo.hStdOutput = outputWr;
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
debugAll("Create process: %s\n", cmdline);
bSuccess = CreateProcess(NULL, cmdline, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &siStartInfo, &piProcInfo);
if (!bSuccess)
{
debug("Cannot create process %s\n", cmdline);
}
else
{
CloseHandle(piProcInfo.hProcess);
CloseHandle(piProcInfo.hThread);
}
CloseHandle(outputWr);
return bSuccess;
}
BOOL isJavaVersionGood(const char *version, BOOL is64Bit)
{
BOOL result = (!*search.javaMinVer || strcmp(version, search.javaMinVer) >= 0)
&& (!*search.javaMaxVer || strcmp(version, search.javaMaxVer) <= 0)
&& (!search.requires64Bit || is64Bit)
&& (!jniHeader || !is64Bit);
debug("Version string: %s / %s-Bit (%s)\n", version, is64Bit ? "64" : "32", result ? "OK" : "Ignore");
return result;
}
/*
* Run <path>/bin/java(w) -version. Return TRUE if version is good.
*/
BOOL isPathJavaVersionGood(const char *path, BOOL *is64Bit)
{
SECURITY_ATTRIBUTES saAttr;
HANDLE outputRd = NULL;
HANDLE outputWr = NULL;
debugAll("Check Java Version: %s min=%s max=%s\n", path, search.javaMinVer, search.javaMaxVer);
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
// Create a pipe for the child process's STDOUT.
if (!CreatePipe(&outputRd, &outputWr, &saAttr, 0))
{
debug("Cannot create pipe\n");
return FALSE;
}
// Ensure the read handle to the pipe for STDOUT is not inherited.
if (!SetHandleInformation(outputRd, HANDLE_FLAG_INHERIT, 0))
{
debug("Cannot set handle information\n");
CloseHandle(outputRd);
CloseHandle(outputWr);
return FALSE;
}
// create child process
char cmdline[MAX_ARGS] = {0};
char launcherPath[_MAX_PATH] = {0};
strcpy(launcherPath, path);
appendLauncher(launcherPath);
snprintf(cmdline, MAX_ARGS, "\"%s\" -version", launcherPath);
if (!CreateChildProcess(cmdline, outputWr))
{
debug("Cannot run java(w) -version\n");
CloseHandle(outputRd);
return FALSE;
}
char version[STR] = {0}, formattedVersion[STR] = {0};
getVersionFromOutput(outputRd, version, sizeof(version), is64Bit);
CloseHandle(outputRd);
if (*version != '\0')
{
formatJavaVersion(formattedVersion, version);
return isJavaVersionGood(formattedVersion, *is64Bit);
}
return FALSE;
}

View File

@@ -28,10 +28,13 @@
THE SOFTWARE.
*/
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif // _WIN32_WINNT
#ifndef _LAUNCH4J_HEAD__INCLUDED_
#define _LAUNCH4J_HEAD__INCLUDED_
#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN // VC - Exclude rarely-used stuff from Windows headers
// Windows Header Files:
@@ -51,23 +54,12 @@
#include <process.h>
#define LAUNCH4j "Launch4j"
#define VERSION "3.7"
#define VERSION "3.50"
#define NO_JAVA_FOUND 0
#define FOUND_JRE 1
#define FOUND_SDK 2
#define FOUND_BUNDLED 4
#define JRE_VER_MAX_DIGITS_PER_PART 3
#define JRE_ONLY 0
#define PREFER_JRE 1
#define PREFER_JDK 2
#define JDK_ONLY 3
#define USE_64_BIT_RUNTIME 1
#define USE_64_AND_32_BIT_RUNTIME 2
#define USE_32_AND_64_BIT_RUNTIME 3
#define USE_32_BIT_RUNTIME 4
#define INIT_RUNTIME_BITS 9
#define JAVA_NOT_FOUND 0
#define JAVA_FOUND 1
#define KEY_WOW64_64KEY 0x0100
@@ -88,10 +80,11 @@
#define ERROR_FORMAT "Error:\t\t%s\n"
#define debug(args...) if (hLog != NULL) fprintf(hLog, ## args);
#define debugAll(args...) if (debugAll && hLog != NULL) fprintf(hLog, ## args);
typedef void (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
BOOL initGlobals();
BOOL initGlobals(BOOL jni);
FILE* openLogFile(const char* exePath, const int pathLen);
void closeLogFile();
BOOL initializeLogging(const char *lpCmdLine, const char* exePath, const int pathLen);
@@ -102,13 +95,12 @@ BOOL loadBool(const int resID);
int loadInt(const int resID);
BOOL regQueryValue(const char* regPath, unsigned char* buffer,
unsigned long bufferLength);
void formatJavaVersion(char* version, const char* originalVersion);
void regSearch(const char* keyName, const int searchType);
BOOL isJavaHomeValid(const char* keyName, const int searchType);
BOOL isRegistryJavaHomeValid(const char* keyName, const int searchType);
BOOL isLauncherPathValid(const char* path);
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);
void regSearchWow(const char* keyName);
BOOL findRegistryJavaHome(char* path);
int getExePath(char* exePath);
void appendPath(char* basepath, const char* path);
void appendLauncher(char* jrePath);
@@ -120,8 +112,9 @@ void appendHeapSize(char *dst, const int megabytesID, const int percentID,
void setJvmOptions(char *jvmOptions, const char *exePath);
BOOL createMutex();
void setWorkingDirectory(const char *exePath, const int pathLen);
BOOL bundledJreSearch(const char *exePath, const int pathLen);
BOOL installedJreSearch();
void removeChar(char *src, const char toRemove);
BOOL pathJreSearch(const char *exePath, const int pathLen);
BOOL registryJreSearch();
void createJreSearchError();
BOOL jreSearch(const char *exePath, const int pathLen);
BOOL appendToPathVar(const char* path);
@@ -129,8 +122,15 @@ BOOL appendJreBinToPathVar();
void setEnvironmentVariables(const char *exePath, const int pathLen);
void setMainClassAndClassPath(const char *exePath, const int pathLen);
void setCommandLineArgs(const char *lpCmdLine);
int prepare(const char *lpCmdLine);
int prepare(const char *lpCmdLine, BOOL jni);
void closeProcessHandles();
BOOL execute(const BOOL wait, DWORD *dwExitCode);
const char* getJavaHome();
const char* getMainClass();
const char* getLauncherArgs();
void getVersionFromOutput(HANDLE outputRd, char *version, int versionLen, BOOL *is64Bit);
BOOL CreateChildProcess(char *cmdline, HANDLE outputWr);
BOOL isJavaVersionGood(const char* version, BOOL is64Bit);
BOOL isJavaPathVersionGood(const char *path, BOOL *is64Bit);
#endif // _LAUNCH4J_HEAD__INCLUDED_

View File

@@ -0,0 +1,34 @@
# Project: jniconsolehead
# Makefile created by Dev-C++ 5.7.1
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = ../../head_jni_BETA/jniconsolehead.o ../../head_jni_BETA/head.o ../../head_jni_BETA/jnihead.o
LINKOBJ = ../../head_jni_BETA/jniconsolehead.o ../../head_jni_BETA/head.o ../../head_jni_BETA/jnihead.o
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/lib" -static-libstdc++ -static-libgcc -n -s
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include/win32"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include/c++" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include/win32"
BIN = jniconsolehead.exe
CXXFLAGS = $(CXXINCS) -Os
CFLAGS = $(INCS) -Os
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
../../head_jni_BETA/jniconsolehead.o: jniconsolehead.c
$(CC) -c jniconsolehead.c -o ../../head_jni_BETA/jniconsolehead.o $(CFLAGS)
../../head_jni_BETA/head.o: ../head.c
$(CC) -c ../head.c -o ../../head_jni_BETA/head.o $(CFLAGS)
../../head_jni_BETA/jnihead.o: ../jnihead.c
$(CC) -c ../jnihead.c -o ../../head_jni_BETA/jnihead.o $(CFLAGS)

View File

@@ -0,0 +1,99 @@
/*
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"
#include "../jnihead.h"
extern FILE* hLog;
BOOL restartOnCrash = FALSE;
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, TRUE);
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;
}
restartOnCrash = loadBool(RESTART_ON_CRASH);
DWORD dwExitCode;
do
{
dwExitCode = 0;
saveJvmOptions(getJavaHome(), getMainClass(), getLauncherArgs());
if (!executeVm(&dwExitCode))
{
signalError();
break;
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return (int) dwExitCode;
}

View File

@@ -0,0 +1,112 @@
[Project]
FileName=jniconsolehead.dev
Name=jniconsolehead
UnitCount=6
Type=1
Ver=2
ObjFiles=
Includes="c:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\include";"c:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\include\win32"
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=-n_@@_
IsCpp=0
Icon=
ExeOutput=
ObjectOutput=..\..\head_jni_BETA
OverrideOutput=0
OverrideOutputName=jniconsolehead.exe
HostApplication=
Folders=
CommandLine=
UseCustomMakefile=0
CustomMakefile=Makefile.win
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=000000d000000000000001000
LogOutput=
LogOutputEnabled=0
[Unit1]
FileName=jniconsolehead.c
CompileCpp=0
Folder=jniconsolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=0.1.1.1
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
SyncProduct=0
[Unit2]
FileName=..\resource.h
CompileCpp=0
Folder=jniconsolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit3]
FileName=..\head.c
CompileCpp=0
Folder=jniconsolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit4]
FileName=..\head.h
CompileCpp=0
Folder=jniconsolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit5]
FileName=..\jnihead.h
Folder=jniconsolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
CompileCpp=0
[Unit6]
FileName=..\jnihead.c
CompileCpp=0
Folder=jniconsolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

View File

@@ -0,0 +1,34 @@
# Project: jniguihead
# Makefile created by Dev-C++ 5.7.1
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = ../../head_jni_BETA/jniguihead.o ../../head_jni_BETA/head.o ../../head_jni_BETA/jnihead.o
LINKOBJ = ../../head_jni_BETA/jniguihead.o ../../head_jni_BETA/head.o ../../head_jni_BETA/jnihead.o
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/lib" -static-libstdc++ -static-libgcc -mwindows -n -s
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include/win32"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib/gcc/mingw32/4.8.1/include/c++" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include" -I"c:/Program Files/AdoptOpenJDK/jdk-8.0.282.8-hotspot/include/win32"
BIN = jniguihead.exe
CXXFLAGS = $(CXXINCS) -Os
CFLAGS = $(INCS) -Os
RM = rm.exe -f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
../../head_jni_BETA/jniguihead.o: jniguihead.c
$(CC) -c jniguihead.c -o ../../head_jni_BETA/jniguihead.o $(CFLAGS)
../../head_jni_BETA/head.o: ../head.c
$(CC) -c ../head.c -o ../../head_jni_BETA/head.o $(CFLAGS)
../../head_jni_BETA/jnihead.o: ../jnihead.c
$(CC) -c ../jnihead.c -o ../../head_jni_BETA/jnihead.o $(CFLAGS)

View File

@@ -0,0 +1,244 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 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 "../jnihead.h"
#include "jniguihead.h"
extern FILE* hLog;
extern PROCESS_INFORMATION processInformation;
HWND hWnd;
DWORD dwExitCode = 0;
BOOL stayAlive = FALSE;
BOOL splash = FALSE;
BOOL splashTimeoutErr;
BOOL waitForWindow;
BOOL restartOnCrash = FALSE;
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int result = prepare(lpCmdLine, TRUE);
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;
restartOnCrash = loadBool(RESTART_ON_CRASH);
// if we should restart on crash, we must also stay alive to check for crashes
stayAlive = restartOnCrash ||
(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);
}
}
do
{
if (splash || stayAlive)
{
if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc))
{
signalError();
return 1;
}
}
debug(getJavaHome());
saveJvmOptions(getJavaHome(), getMainClass(), getLauncherArgs());
if (!executeVm(&dwExitCode))
{
signalError();
return 1;
}
if (!(splash || stayAlive))
{
debug("Exit code:\t0\n");
closeProcessHandles();
closeLogFile();
return 0;
}
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
closeProcessHandles();
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
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 (processInformation.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(processInformation.hProcess, &dwExitCode);
if (dwExitCode != STILL_ACTIVE
|| !(splash || stayAlive))
{
KillTimer(hWnd, ID_TIMER);
PostQuitMessage(0);
}
}

View File

@@ -0,0 +1,122 @@
[Project]
FileName=jniguihead.dev
Name=jniguihead
UnitCount=7
Type=0
Ver=2
ObjFiles=
Includes="c:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\include";"c:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\include\win32"
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=-n_@@_
IsCpp=0
Icon=
ExeOutput=
ObjectOutput=..\..\head_jni_BETA
OverrideOutput=0
OverrideOutputName=jniguihead.exe
HostApplication=
Folders=
CommandLine=
UseCustomMakefile=0
CustomMakefile=Makefile.win
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=000000d000000000000001000
LogOutput=
LogOutputEnabled=0
[Unit1]
FileName=jniguihead.c
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c jniguihead.c -o ../../head_jni_BETA/jniguihead.o $(CFLAGS)
[Unit2]
FileName=jniguihead.h
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=0.1.1.1
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
SyncProduct=0
[Unit4]
FileName=..\head.h
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit6]
FileName=..\jnihead.c
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit3]
FileName=..\head.c
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c head.c -o ../../head/head.o $(CFLAGS)
[Unit5]
FileName=..\resource.h
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit7]
FileName=..\jnihead.h
CompileCpp=0
Folder=jniguihead_BETA
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

View File

@@ -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
);

284
launch4j/head_src/jnihead.c Normal file
View File

@@ -0,0 +1,284 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2007 Ryan Rusaw
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 "jnihead.h"
/* Java Invocation API stuff */
typedef jint (JNICALL CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
JavaVM* g_pJavaVM = NULL;
JNIEnv* g_pJNIEnv = NULL;
JavaVMInitArgs g_sJavaVMInitArgs;
char g_rgcMnClsArgs[MAX_ARGS] = {0};
char g_rgcMnCls[_MAX_PATH] = {0};
char g_rgcCurrJrePth[_MAX_PATH] = {0};
HINSTANCE g_hInstance;
const char* g_pcSep = " \t\f\r\n\v";
int getArgCount(const char* pcArgStr)
{
const char *pCopy;
int iArgCnt= 0;
int bInWtSpc = 1;
for(pCopy = pcArgStr; *pCopy; pCopy++)
{
if (!isspace(*pCopy) && bInWtSpc)
{
iArgCnt++;
}
bInWtSpc = isspace(*pCopy);
}
return iArgCnt;
}
void saveJvmOptions(const char *jrePath, const char *mainClass, const char *pcOpts)
{
strcpy(g_rgcCurrJrePth, jrePath);
strcpy(g_rgcMnCls, mainClass);
char rgcOptCpy[MAX_ARGS] = {0};
int iArgCnt = 0, iCurrArg = 0, iSkipArgCnt = 0;
char *pcCurrOpt;
char **prgcVmArgs = NULL;
strncpy(rgcOptCpy, pcOpts, MAX_ARGS - 1);
iArgCnt = getArgCount(rgcOptCpy);
if (iArgCnt > 0)
{
/* Allocate iArgCnt char pointers */
prgcVmArgs = malloc(iArgCnt * sizeof(char *));
for (pcCurrOpt = strtok(rgcOptCpy, g_pcSep); pcCurrOpt; pcCurrOpt = strtok(NULL, g_pcSep), iCurrArg++)
{
/* Use the allocated pointers to make an array of substrings */
prgcVmArgs[iCurrArg] = pcCurrOpt;
}
/* Allocat iArgCnt JavaVMOptions for the g_sJavaVMInitArgs struct */
g_sJavaVMInitArgs.options = malloc(iArgCnt * sizeof(JavaVMOption));
memset(g_sJavaVMInitArgs.options, 0, iArgCnt * sizeof(JavaVMOption));
char* rgcClsPth = 0;
/* Copy the tokenized array into the allocated JavaVMOption array,
* with some special handling for classpath related arguments */
for (iCurrArg = 0; iCurrArg < iArgCnt; iCurrArg++)
{
if ((strcmp(prgcVmArgs[iCurrArg], "-classpath") == 0) ||
(strcmp(prgcVmArgs[iCurrArg], "-jar") == 0))
{
iCurrArg++;
iSkipArgCnt++;
if (iCurrArg < iArgCnt)
{
int iOffset = *prgcVmArgs[iCurrArg] == '"' ? 1 : 0;
char rgcTmp[MAX_ARGS] = {0};
/* Remove leading and trailing "'s */\
strncpy(rgcTmp, prgcVmArgs[iCurrArg] + iOffset,
strlen(prgcVmArgs[iCurrArg]) - iOffset);
if (rgcTmp[strlen(rgcTmp)-1] == '"')
rgcTmp[strlen(rgcTmp)-1] = '\0';
/* If we haven't defined a classpath yet start one, otherwise
* we just append the this classpath to it */
if (!rgcClsPth)
{
rgcClsPth = malloc(MAX_ARGS * sizeof(char));
memset(rgcClsPth, 0, MAX_ARGS * sizeof(char));
sprintf(rgcClsPth,"-Djava.class.path=%s", rgcTmp);
g_sJavaVMInitArgs.options[iCurrArg - iSkipArgCnt].optionString = rgcClsPth;
}
else
{
iSkipArgCnt++;
strcat(rgcClsPth,";");
strcat(rgcClsPth,rgcTmp);
}
}
}
else
{
g_sJavaVMInitArgs.options[iCurrArg - iSkipArgCnt].optionString
= malloc(strlen(prgcVmArgs[iCurrArg]) + 1);
strcpy(g_sJavaVMInitArgs.options[iCurrArg - iSkipArgCnt].optionString,
prgcVmArgs[iCurrArg]);
}
}
g_sJavaVMInitArgs.nOptions = iArgCnt - iSkipArgCnt;
/* Free the malloc'd memory, we dont want to leak */
free(prgcVmArgs);
}
}
JNIEnv* createVm()
{
int iRetVal;
CreateJavaVM_t *pfnCreateJavaVM;
char rgcLibPth[_MAX_PATH + 18];
// sprintf(rgcLibPth, "%s\\bin\\client\\jvm.dll", g_rgcCurrJrePth); // TODO - could be client or server
sprintf(rgcLibPth, "%s\\bin\\client\\jvm.dll", g_rgcCurrJrePth);
/* Get a handle to the jvm dll */
if ((g_hInstance = LoadLibrary(rgcLibPth)) == NULL)
{
return NULL;
}
/* Get the CreateJavaVM() function */
pfnCreateJavaVM = (CreateJavaVM_t *)GetProcAddress(g_hInstance, "JNI_CreateJavaVM");
if (pfnCreateJavaVM == NULL)
{
return NULL;
}
g_sJavaVMInitArgs.version = JNI_VERSION_1_2;
g_sJavaVMInitArgs.ignoreUnrecognized = JNI_TRUE;
/* Start the VM */
iRetVal = pfnCreateJavaVM(&g_pJavaVM, (void **)&g_pJNIEnv, &g_sJavaVMInitArgs);
if (iRetVal != 0)
{
return NULL;
}
return g_pJNIEnv;
}
int invokeMainClass(JNIEnv* psJNIEnv)
{
jclass jcMnCls;
jmethodID jmMnMthd;
jobjectArray joAppArgs;
jstring jsAppArg;
jthrowable jtExcptn;
char *pcCurrArg;
int iArgCnt= 0, iOption = -1;
char rgcMnClsCpy[MAX_ARGS] = {0};
/* Ensure Java JNI Env is set up */
if(psJNIEnv == NULL)
{
return -1;
}
/* We need a class name */
if (g_rgcMnCls[0] == '\0')
{
return -1;
}
else
{
/* Replace . with / in fully qualified class name */
char *pClsNm;
for(pClsNm = g_rgcMnCls; *pClsNm; pClsNm++)
{
if(*pClsNm == '.')
*pClsNm = '/';
}
}
/* Find the class */
jcMnCls = (*psJNIEnv)->FindClass(psJNIEnv, g_rgcMnCls);
jtExcptn = (*psJNIEnv)->ExceptionOccurred(psJNIEnv);
if (jtExcptn != NULL)
{
(*psJNIEnv)->ExceptionDescribe(psJNIEnv);
return -1;
}
if (jcMnCls == NULL)
{
return -1;
}
/* Get the static main method */
jmMnMthd = (*psJNIEnv)->GetStaticMethodID(psJNIEnv, jcMnCls, "main", "([Ljava/lang/String;)V");
jtExcptn = (*psJNIEnv)->ExceptionOccurred(psJNIEnv);
if (jtExcptn != NULL)
{
(*psJNIEnv)->ExceptionDescribe(psJNIEnv);
}
if (jmMnMthd == NULL)
{
return -1;
}
/* Build the String[] array if we need one */
strncpy(rgcMnClsCpy, g_rgcMnClsArgs, MAX_ARGS);
iArgCnt = getArgCount(rgcMnClsCpy);
joAppArgs = (jobjectArray)(*psJNIEnv)->NewObjectArray(psJNIEnv, iArgCnt,
(*psJNIEnv)->FindClass(psJNIEnv, "java/lang/String"), NULL);
jtExcptn = (*psJNIEnv)->ExceptionOccurred(psJNIEnv);
if (jtExcptn != NULL)
{
(*psJNIEnv)->ExceptionDescribe(psJNIEnv);
return -1;
}
for (pcCurrArg = strtok(rgcMnClsCpy, g_pcSep); pcCurrArg; pcCurrArg = strtok(NULL, g_pcSep))
{
iOption++;
jsAppArg = (*psJNIEnv)->NewStringUTF(psJNIEnv, pcCurrArg);
(*psJNIEnv)->SetObjectArrayElement(psJNIEnv, joAppArgs, iOption, jsAppArg);
jtExcptn = (*psJNIEnv)->ExceptionOccurred(psJNIEnv);
if(jtExcptn != NULL)
{
(*psJNIEnv)->ExceptionDescribe(psJNIEnv);
return -1;
}
}
/* Execute the class */
(*psJNIEnv)->CallStaticVoidMethod(psJNIEnv, jcMnCls, jmMnMthd, joAppArgs);
return 0;
}
void cleanupVm()
{
/* Destroy the VM */
(*g_pJavaVM)->DestroyJavaVM(g_pJavaVM);
}
BOOL executeVm(DWORD *dwExitCode)
{
BOOL result = TRUE;
*dwExitCode = -1;
int iIdx;
/* Use Invocation API */
if (createVm())
{
*dwExitCode = invokeMainClass(g_pJNIEnv);
cleanupVm();
}
else
{
result = FALSE;
}
/* Free the allocated memory */
for (iIdx = 0; iIdx < g_sJavaVMInitArgs.nOptions; iIdx++)
{
free(g_sJavaVMInitArgs.options[iIdx].optionString);
}
free(g_sJavaVMInitArgs.options);
return result;
}

View File

@@ -0,0 +1,41 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2007 Ryan Rusaw
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 <jni.h>
#include <ctype.h>
#include "head.h"
int getArgCount(const char* pcArgStr);
void saveJvmOptions(const char *jrePath, const char *mainClass, const char *pcOpts);
JNIEnv* createVm();
int invokeMainClass(JNIEnv* psJNIEnv);
void cleanupVm();
BOOL executeVm(DWORD *dwExitCode);

View File

@@ -0,0 +1,13 @@
MAKE = mingw32-make.exe
all:
$(MAKE) -C guihead -f Makefile.win all
$(MAKE) -C consolehead -f Makefile.win all
$(MAKE) -C jniguihead_BETA -f Makefile.win all
$(MAKE) -C jniconsolehead_BETA -f Makefile.win all
clean:
$(MAKE) -C guihead -f Makefile.win clean
$(MAKE) -C consolehead -f Makefile.win clean
$(MAKE) -C jniguihead_BETA -f Makefile.win clean
$(MAKE) -C jniconsolehead_BETA -f Makefile.win clean

View File

@@ -1,75 +1,72 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2014 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 BUNDLED_JRE_64_BIT 29
#define RUNTIME_BITS 30
#define RESTART_ON_CRASH 31
#define BUNDLED_JRE_AS_FALLBACK 32
#define STARTUP_ERR 101
#define BUNDLED_JRE_ERR 102
#define JRE_VERSION_ERR 103
#define LAUNCHER_ERR 104
#define INSTANCE_ALREADY_EXISTS_MSG 105
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2014 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 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 REQUIRES_JDK 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 REQUIRES_64_BIT 29
#define RESTART_ON_CRASH 31
#define STARTUP_ERR 101
#define JRE_NOT_FOUND_ERR 102
#define JRE_VERSION_ERR 103
#define LAUNCHER_ERR 104
#define INSTANCE_ALREADY_EXISTS_MSG 105

View File

@@ -1,7 +1,7 @@
#!/bin/sh
LAUNCH4J="$(dirname "$0")"/launch4j.jar
if [ -n "$JAVA_HOME" ]; then
$JAVA_HOME/bin/java -jar "$LAUNCH4J" "$@"
else
java -jar "$LAUNCH4J" "$@"
fi
#!/bin/sh
LAUNCH4J="$(dirname "$0")"/launch4j.jar
if [ -n "$JAVA_HOME" ]; then
$JAVA_HOME/bin/java -jar "$LAUNCH4J" "$@"
else
java -jar "$LAUNCH4J" "$@"
fi

Binary file not shown.

8
launch4j/launch4jc Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
LAUNCH4J="$(dirname "$0")"/launch4j.jar
if [ -n "$JAVA_HOME" ]; then
$JAVA_HOME/bin/java -Djava.awt.headless=true -jar "$LAUNCH4J" "$@"
else
java -Djava.awt.headless=true -jar "$LAUNCH4J" "$@"
fi

View File

@@ -1,31 +0,0 @@
The BSD License for the JGoodies Looks
======================================
Copyright (c) 2001-2014 JGoodies Software GmbH. 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 Software GmbH 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.

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,28 @@
(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.
(BSD Style License)
Copyright (c) 2003-2006, Joe Walnes
Copyright (c) 2006-2019, XStream Committers
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.

View File

@@ -1,201 +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.
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,50 +1,202 @@
/*
============================================================================
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 <stefano@apache.org>. For more information on the Apache
Software Foundation, please see <http://www.apache.org/>.
*/
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.

View File

@@ -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.

BIN
launch4j/lib/flatlaf.jar LFS Normal file

Binary file not shown.

View File

@@ -1,25 +0,0 @@
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
<!-- <requestedExecutionLevel level="highestAvailable" uiAccess="false"/> -->
<!-- <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> -->
</requestedPrivileges>
</security>
</trustInfo>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
<!-- <requestedExecutionLevel level="highestAvailable" uiAccess="false"/> -->
<!-- <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> -->
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

24
launch4j/maven/.classpath Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="demo/SimpleApp/build" path="demo/SimpleApp/src"/>
<classpathentry kind="src" output="demo/ConsoleApp/build" path="demo/ConsoleApp/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

23
launch4j/maven/.project Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>launch4j</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@@ -0,0 +1,14 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>distribution-libs</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<includes></includes>
<useProjectArtifact>false</useProjectArtifact>
</dependencySet>
</dependencySets>
</assembly>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maven Launch4j Plugin
Copyright (c) 2006 Paul Jungwirth
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<assembly>
<id>workdir-linux</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>bin/bin-linux</directory>
<outputDirectory>${finalName}-workdir-linux/bin</outputDirectory>
</fileSet>
<fileSet>
<outputDirectory>${finalName}-workdir-linux</outputDirectory>
<includes>
<include>w32api/**/*</include>
<include>w32api_jni/**/*</include>
<include>head/**/*</include>
<include>head_jni_BETA/**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maven Launch4j Plugin
Copyright (c) 2006 Paul Jungwirth
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<assembly>
<id>workdir-linux64</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>bin/bin-linux64</directory>
<outputDirectory>${finalName}-workdir-linux64/bin</outputDirectory>
</fileSet>
<fileSet>
<outputDirectory>${finalName}-workdir-linux64</outputDirectory>
<includes>
<include>w32api/**/*</include>
<include>w32api_jni/**/*</include>
<include>head/**/*</include>
<include>head_jni_BETA/**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maven Launch4j Plugin
Copyright (c) 2006 Paul Jungwirth
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<assembly>
<id>workdir-mac</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>bin/bin-macosx-x86</directory>
<outputDirectory>${finalName}-workdir-mac/bin</outputDirectory>
</fileSet>
<fileSet>
<outputDirectory>${finalName}-workdir-mac</outputDirectory>
<includes>
<include>w32api/**/*</include>
<include>w32api_jni/**/*</include>
<include>head/**/*</include>
<include>head_jni_BETA/**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maven Launch4j Plugin
Copyright (c) 2006 Paul Jungwirth
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<assembly>
<id>workdir-win32</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>bin/bin-win32</directory>
<outputDirectory>${finalName}-workdir-win32/bin</outputDirectory>
</fileSet>
<fileSet>
<outputDirectory>${finalName}-workdir-win32</outputDirectory>
<includes>
<include>w32api/**/*</include>
<include>w32api_jni/**/*</include>
<include>head/**/*</include>
<include>head_jni_BETA/**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Maven Launch4j Plugin
Copyright (c) 2006 Paul Jungwirth
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<assembly>
<id>src</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
<include>TODO</include>
<include>pom.xml</include>
</includes>
</fileSet>
<fileSet>
<directory>src</directory>
<excludes>
<exclude>**/.*.swp</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,8 @@
Run once the Ant target switch-to-maven, it will reconfigure the project to use maven.
*** Creation of Distribution Release ***
Windows: mvn -P dist,win32 clean package
Linux: mvn -P dist,linux clean package
MacOsX: mvn -P dist,macosx-x86 clean package

511
launch4j/maven/pom.xml Normal file
View File

@@ -0,0 +1,511 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sf.launch4j</groupId>
<artifactId>launch4j</artifactId>
<version>${launch4j.version}</version>
<name>Launch4j</name>
<description>Cross-platform Java executable wrapper for creating lightweight Windows native EXEs. Provides advanced JRE search, application startup configuration and better user experience.</description>
<url>http://sourceforge.net/projects/launch4j/</url>
<licenses>
<license>
<name>BSD 3-Clause License</name>
<url>http://opensource.org/licenses/BSD-3-Clause</url>
<comments>Launch4j is licensed under the BSD 3-Clause License.</comments>
</license>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<comments>Launch4j code (head) which is attached to the wrapped jars is licensed under the MIT License.</comments>
</license>
</licenses>
<developers>
<developer>
<name>Grzegorz Kowal</name>
<url>http://sourceforge.net/u/grzegok/profile/</url>
</developer>
</developers>
<scm>
<connection>scm:git:http://git.code.sf.net/p/launch4j/git</connection>
<developerConnection>scm:git:http://git.code.sf.net/p/launch4j/git</developerConnection>
<url>http://sourceforge.net/p/launch4j/git/ci/master/tree/</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<versionNumber>${launch4j.version}.0.0</versionNumber>
<version>${launch4j.version}</version>
</properties>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-collections</artifactId>
<groupId>commons-collections</groupId>
</exclusion>
</exclusions>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>net.java.abeille</groupId>
<artifactId>abeille</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<artifactId>colt</artifactId>
<groupId>colt</groupId>
</exclusion>
<exclusion>
<artifactId>
com.springsource.org.apache.batik.ext.awt
</artifactId>
<groupId>org.apache.batik</groupId>
</exclusion>
<exclusion>
<artifactId>
com.springsource.org.apache.batik.util
</artifactId>
<groupId>org.apache.batik</groupId>
</exclusion>
<exclusion>
<artifactId>dom4j</artifactId>
<groupId>dom4j</groupId>
</exclusion>
<exclusion>
<artifactId>dsol-xml</artifactId>
<groupId>dsol</groupId>
</exclusion>
<exclusion>
<artifactId>javahelp</artifactId>
<groupId>javax.help</groupId>
</exclusion>
<exclusion>
<artifactId>jfreechart</artifactId>
<groupId>jfree</groupId>
</exclusion>
<exclusion>
<artifactId>jcommon</artifactId>
<groupId>jfree</groupId>
</exclusion>
<exclusion>
<artifactId>mahout-collections</artifactId>
<groupId>org.apache.mahout</groupId>
</exclusion>
<exclusion>
<artifactId>optimization</artifactId>
<groupId>com.github.rwl</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>jgoodies-common</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.15</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.9</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.github.taxone.plugins</groupId>
<artifactId>classpath-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>set-classpath-property</id>
<phase>prepare-package</phase>
<goals>
<goal>setClassPath</goal>
</goals>
<configuration>
<classpathPrefix>lib/</classpathPrefix>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>net.sf.launch4j.Main</mainClass>
</manifest>
<manifestEntries>
<Class-Path>. ${taxone.classpath.propertyName}</Class-Path>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>core-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<finalName>${project.build.finalName}</finalName>
<excludes>
<exclude>net/sf/launch4j/form/</exclude>
<exclude>net/sf/launch4j/formimpl</exclude>
</excludes>
<classifier>core</classifier>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>assemble-workdir</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/assemble-linux.xml</descriptor>
<descriptor>assembly/assemble-linux64.xml</descriptor>
<descriptor>assembly/assemble-win32.xml</descriptor>
<descriptor>assembly/assemble-mac.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>assemble-distrib</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>lib</finalName>
<outputDirectory>${basedir}</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly/assemble-dist.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<resources>
<resource>
<directory>target</directory>
<includes>
<include>${project.build.finalName}.jar</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6</version>
<configuration>
<filesets>
<fileset>
<directory>${basedir}</directory>
<includes>
<include>${project.build.finalName}.jar</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>full-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.2</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- Release has to be executed manually -->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Macosx-x86 Profile -->
<profile>
<id>macosx-x86</id>
<properties>
<bin.dir>bin-macosx-x86</bin.dir>
</properties>
</profile>
<!-- Linux Profile -->
<profile>
<id>linux</id>
<properties>
<bin.dir>bin-linux</bin.dir>
</properties>
</profile>
<!-- Windows Profile -->
<profile>
<id>win32</id>
<properties>
<bin.dir>bin-win32</bin.dir>
</properties>
<build>
<plugins>
<!-- Creates Launch4j executable -->
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.25</version>
<executions>
<execution>
<id>launch4j</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<dontWrapJar>true</dontWrapJar>
<jar>${project.build.finalName}.jar</jar>
<outfile>launch4j.exe</outfile>
<errTitle>launch4j</errTitle>
<chdir>.</chdir>
<stayAlive>false</stayAlive>
<jre>
<minVersion>1.8.0</minVersion>
</jre>
<versionInfo>
<fileVersion>${versionNumber}</fileVersion>
<txtFileVersion>${version}</txtFileVersion>
<productVersion>${versionNumber}</productVersion>
<txtProductVersion>${version}</txtProductVersion>
<fileDescription>Cross-platform Java application wrapper</fileDescription>
<copyright>Copyright (C) 2004, 2017 Grzegorz Kowal</copyright>
<productName>launch4j</productName>
<companyName>http://launch4j.sourceforge.net/</companyName>
<internalName>GUI launcher</internalName>
<originalFilename>launch4j.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Generic distribution profile -->
<profile>
<id>dist</id>
<build>
<plugins>
<!-- Clean -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6</version>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/bin</directory>
<includes>
<incude>*</incude>
</includes>
<excludes>
<exclude>COPYING</exclude>
</excludes>
</fileset>
<fileset>
<directory>${basedir}</directory>
<includes>
<incude>launch4j.exe</incude>
</includes>
</fileset>
<fileset>
<directory>${basedir}</directory>
<includes>
<incude>lib/</incude>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- Copies executables to "bin" directory -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-binutils</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/bin</outputDirectory>
<resources>
<resource>
<directory>${basedir}/bin/${bin.dir}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Change Permissions -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<chmod file="launch4j" perm="+x" />
<chmod file="bin/windres" perm="+x" />
<chmod file="bin/ld" perm="+x" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -1,18 +0,0 @@
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

View File

@@ -1,223 +0,0 @@
/*
sign4j.c: a simple utility to sign executables created by Launch4j
Copyright (c) 2012 Servoy
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#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] <arguments>\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);
}

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

@@ -0,0 +1,30 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2019 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,2 +1,2 @@
versionNumber=3.7.0.0
version=3.7
versionNumber=3.50.0.0
version=3.50

View File

@@ -1,214 +1,217 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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<String> _cmd = new ArrayList<String>();
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<String> 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);
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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 {
if (c.isJniApplication()) {
_log.append("WARNING: Some features are not implemented in JNI headers, see documentation.");
}
rc = rcb.build(c);
ro = Util.createTempFile("o");
outfile = ConfigPersister.getInstance().getOutputFile();
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.isGuiApplication() ? "--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<String> _cmd = new ArrayList<String>();
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<String> 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);
}
}

View File

@@ -1,52 +1,52 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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);
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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);
}
}

View File

@@ -1,66 +1,66 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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;
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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;
}
}

View File

@@ -1,76 +1,76 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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;
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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;
}
}

View File

@@ -1,86 +1,86 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2013 toshimm
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.sf.launch4j;
import java.io.OutputStream;
import java.io.IOException;
/**
* @author toshimm (2013)
*
* This class makes Japanese Kanji characters in MS932 charcode escaped
* in octal form.
*/
public class KanjiEscapeOutputStream extends OutputStream {
protected OutputStream parent;
public KanjiEscapeOutputStream(OutputStream out) {
this.parent = out;
}
private final int MASK = 0x000000FF;
private boolean state = true;
public void write(int b) throws IOException {
b = b & MASK;
if (state) {
if (0x00 <= b && b <= 0x7f) {
this.parent.write(b);
} else {
this.octprint(b);
if ((0x81 <= b && b <= 0x9f) || (0xe0 <= b && b <= 0xfc)) {
this.state = false;
}
}
} else {
if ((0x40 <= b && b <= 0x7e) || (0x80 <= b && b <= 0xfc)) {
this.octprint(b);
} else if (0x00 <= b && b <= 0x7f) {
this.parent.write(b);
} else {
this.octprint(b);
}
this.state = true;
}
}
private void octprint(int b) throws IOException {
String oct = "\\" + String.format("%o", b & MASK);
for (int i = 0; i < oct.length(); ++i) {
int bb = oct.charAt(i);
this.parent.write(bb);
}
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2013 toshimm
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.sf.launch4j;
import java.io.OutputStream;
import java.io.IOException;
/**
* @author toshimm (2013)
*
* This class makes Japanese Kanji characters in MS932 charcode escaped
* in octal form.
*/
public class KanjiEscapeOutputStream extends OutputStream {
protected OutputStream parent;
public KanjiEscapeOutputStream(OutputStream out) {
this.parent = out;
}
private final int MASK = 0x000000FF;
private boolean state = true;
public void write(int b) throws IOException {
b = b & MASK;
if (state) {
if (0x00 <= b && b <= 0x7f) {
this.parent.write(b);
} else {
this.octprint(b);
if ((0x81 <= b && b <= 0x9f) || (0xe0 <= b && b <= 0xfc)) {
this.state = false;
}
}
} else {
if ((0x40 <= b && b <= 0x7e) || (0x80 <= b && b <= 0xfc)) {
this.octprint(b);
} else if (0x00 <= b && b <= 0x7f) {
this.parent.write(b);
} else {
this.octprint(b);
}
this.state = true;
}
}
private void octprint(int b) throws IOException {
String oct = "\\" + String.format("%o", b & MASK);
for (int i = 0; i < oct.length(); ++i) {
int bb = oct.charAt(i);
this.parent.write(bb);
}
}
}

View File

@@ -1,105 +1,105 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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");
}});
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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");
}});
}
}

View File

@@ -1,94 +1,95 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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, 2015 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/).";
}
}
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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());
System.exit(1);
}
}
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, 2022 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/).";
}
}

Some files were not shown because too many files have changed in this diff Show More