Fix Windows executable generation with launch4j

This commit is contained in:
Bernie Jenny 2018-04-02 22:22:42 +10:00
parent 5c404eda62
commit b9fc5645c9
4 changed files with 38 additions and 8 deletions

4
.gitignore vendored
View File

@ -4,3 +4,7 @@
nbproject/private
build
dist
win/launch4j
win/ColorOracle.exe
win/ColorOracle.zip

View File

@ -67,13 +67,31 @@
-->
<target name="-post-jar">
<!-- test whether launch4j directory exists -->
<target name="launch4j.dir.check">
<condition property="launch4j.dir.exists">
<available file="win/launch4j" type="dir" />
</condition>
</target>
<!-- build Windows exe if launch4j is installed -->
<target name="run.launch4j" depends="launch4j.dir.check" if="launch4j.dir.exists">
<!-- Create a Windows exe file for Windows -->
<property name="launch4j.dir" location="win/launch4j" />
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="win/launch4j_config.xml" />
<!-- Zip the generated exe file -->
<zip destfile="win/ColorOracle.zip">
<fileset dir="win/" includes="ColorOracle.exe"/>
</zip>
</target>
<target name="-post-jar">
<antcall target="run.launch4j"/>
</target>
</project>

2
win/launch4j info.txt Normal file
View File

@ -0,0 +1,2 @@
To create a Windows executable file, place a copy of launch4j here. Name it "launch4j".
http://launch4j.sourceforge.net

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>..\dist\ColorOracle.jar</jar>
<jar>../dist/ColorOracle.jar</jar>
<outfile>ColorOracle.exe</outfile>
<errTitle>Color Oracle</errTitle>
<cmdLine></cmdLine>
@ -9,8 +10,8 @@
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl>http://colororacle.org/</supportUrl>
<customProcName>false</customProcName>
<stayAlive>false</stayAlive>
<restartOnCrash>true</restartOnCrash>
<manifest></manifest>
<icon>icons.ico</icon>
<singleInstance>
@ -19,21 +20,26 @@
</singleInstance>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.6.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
<versionInfo>
<fileVersion>1.2.1.0</fileVersion>
<txtFileVersion>1.2.1 for Java 6 or higher</txtFileVersion>
<fileVersion>1.3.0.0</fileVersion>
<txtFileVersion>1.3.0 for Java 6 or higher</txtFileVersion>
<fileDescription>Color Oracle</fileDescription>
<copyright>Bernhard Jenny, Oregon State University</copyright>
<productVersion>1.2.1.0</productVersion>
<txtProductVersion>1.2.1 for Java 6 or higher</txtProductVersion>
<copyright>B. Jenny &amp; N.V. Kelso</copyright>
<productVersion>1.3.0.0</productVersion>
<txtProductVersion>1.3.0 for Java 6 or higher</txtProductVersion>
<productName>Color Oracle</productName>
<companyName></companyName>
<internalName>Color Oracle</internalName>
<originalFilename>ColorOracle.exe</originalFilename>
<trademarks></trademarks>
<language>ENGLISH_US</language>
</versionInfo>
<messages>
<startupErr>An error occurred while starting Color Oracle.</startupErr>