Skip to content

Commit b9fc564

Browse files
committed
Fix Windows executable generation with launch4j
1 parent 5c404ed commit b9fc564

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44

55
nbproject/private
66
build
7+
dist
8+
win/launch4j
9+
win/ColorOracle.exe
10+
win/ColorOracle.zip

build.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,31 @@
6767
6868
-->
6969

70-
<target name="-post-jar">
70+
<!-- test whether launch4j directory exists -->
71+
<target name="launch4j.dir.check">
72+
<condition property="launch4j.dir.exists">
73+
<available file="win/launch4j" type="dir" />
74+
</condition>
75+
</target>
76+
77+
<!-- build Windows exe if launch4j is installed -->
78+
<target name="run.launch4j" depends="launch4j.dir.check" if="launch4j.dir.exists">
79+
<!-- Create a Windows exe file for Windows -->
7180
<property name="launch4j.dir" location="win/launch4j" />
7281
<taskdef name="launch4j"
7382
classname="net.sf.launch4j.ant.Launch4jTask"
7483
classpath="${launch4j.dir}/launch4j.jar
7584
:${launch4j.dir}/lib/xstream.jar" />
7685
<launch4j configFile="win/launch4j_config.xml" />
86+
87+
<!-- Zip the generated exe file -->
88+
<zip destfile="win/ColorOracle.zip">
89+
<fileset dir="win/" includes="ColorOracle.exe"/>
90+
</zip>
91+
</target>
92+
93+
<target name="-post-jar">
94+
<antcall target="run.launch4j"/>
7795
</target>
7896

7997
</project>

win/launch4j info.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
To create a Windows executable file, place a copy of launch4j here. Name it "launch4j".
2+
http://launch4j.sourceforge.net

win/launch4j_config.xml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<launch4jConfig>
23
<dontWrapJar>false</dontWrapJar>
34
<headerType>gui</headerType>
4-
<jar>..\dist\ColorOracle.jar</jar>
5+
<jar>../dist/ColorOracle.jar</jar>
56
<outfile>ColorOracle.exe</outfile>
67
<errTitle>Color Oracle</errTitle>
78
<cmdLine></cmdLine>
89
<chdir></chdir>
910
<priority>normal</priority>
1011
<downloadUrl>http://java.com/download</downloadUrl>
1112
<supportUrl>http://colororacle.org/</supportUrl>
12-
<customProcName>false</customProcName>
1313
<stayAlive>false</stayAlive>
14+
<restartOnCrash>true</restartOnCrash>
1415
<manifest></manifest>
1516
<icon>icons.ico</icon>
1617
<singleInstance>
@@ -19,21 +20,26 @@
1920
</singleInstance>
2021
<jre>
2122
<path></path>
23+
<bundledJre64Bit>false</bundledJre64Bit>
24+
<bundledJreAsFallback>false</bundledJreAsFallback>
2225
<minVersion>1.6.0</minVersion>
2326
<maxVersion></maxVersion>
2427
<jdkPreference>preferJre</jdkPreference>
28+
<runtimeBits>64/32</runtimeBits>
2529
</jre>
2630
<versionInfo>
27-
<fileVersion>1.2.1.0</fileVersion>
28-
<txtFileVersion>1.2.1 for Java 6 or higher</txtFileVersion>
31+
<fileVersion>1.3.0.0</fileVersion>
32+
<txtFileVersion>1.3.0 for Java 6 or higher</txtFileVersion>
2933
<fileDescription>Color Oracle</fileDescription>
30-
<copyright>Bernhard Jenny, Oregon State University</copyright>
31-
<productVersion>1.2.1.0</productVersion>
32-
<txtProductVersion>1.2.1 for Java 6 or higher</txtProductVersion>
34+
<copyright>B. Jenny &amp; N.V. Kelso</copyright>
35+
<productVersion>1.3.0.0</productVersion>
36+
<txtProductVersion>1.3.0 for Java 6 or higher</txtProductVersion>
3337
<productName>Color Oracle</productName>
3438
<companyName></companyName>
3539
<internalName>Color Oracle</internalName>
3640
<originalFilename>ColorOracle.exe</originalFilename>
41+
<trademarks></trademarks>
42+
<language>ENGLISH_US</language>
3743
</versionInfo>
3844
<messages>
3945
<startupErr>An error occurred while starting Color Oracle.</startupErr>

0 commit comments

Comments
 (0)