Compare commits
219 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87832c4469 | |||
| 64059731cd | |||
| bce4f70fd2 | |||
| 5eaf884b88 | |||
| 19c17ae81d | |||
| a61a13397a | |||
| 89e83f978b | |||
| 09436a17d8 | |||
| 3e84798d88 | |||
| c64b17467d | |||
| c12187cae9 | |||
| 81d436dcf5 | |||
| 091a62be2f | |||
| da197c64c7 | |||
| 6b4ddbe5b4 | |||
| 0c357fe959 | |||
| 2064184093 | |||
| 2e6ea5eecc | |||
| 0dde64e5fc | |||
| 28a3326a35 | |||
| df6b893171 | |||
| ead577521d | |||
|
|
cc1c76bd47 | ||
| b74f1aedb4 | |||
| 67d1e787ee | |||
| 11ca88ee38 | |||
|
|
ae4e3db0d7 | ||
|
|
4314790271 | ||
| 9c58276119 | |||
| 16380a9752 | |||
| b523d80c25 | |||
| 34d1f504c0 | |||
| d4a64d4e72 | |||
| 44201a0bbb | |||
|
|
1d19cd4c98 | ||
| 4c89c70b05 | |||
|
|
33eb219904 | ||
| 37c44ca462 | |||
| 19bf57143c | |||
| 1005619211 | |||
| af31ba91a4 | |||
| 0e9ae7cc91 | |||
| 702160c1df | |||
| b57c1b5753 | |||
| e22a1ce84a | |||
| 83c728e7c8 | |||
| ed75718d34 | |||
| 75873b9e8c | |||
| 1416f6d632 | |||
| 8a7e070f46 | |||
| 1c953dbf1f | |||
| da3b88e083 | |||
| 13d8dc4612 | |||
| 785a4f1b7b | |||
| 43b0ccd96d | |||
| f6af5ce2e7 | |||
| 577ff9c1eb | |||
| f0ae69d610 | |||
| 7e6a08d64b | |||
| 5f34c57b23 | |||
| 356d95191b | |||
| 903f8eaa91 | |||
| 1b7dd7dfb1 | |||
| ca0a15ba09 | |||
| c52422247c | |||
| c9b65cb315 | |||
| fc3365af62 | |||
| 7c7cd58963 | |||
| aea5a58691 | |||
| fab7f1a91c | |||
| 9b23eb56ce | |||
| 450e80ad21 | |||
| 21d7d9d597 | |||
| 746f47a5fa | |||
| c67e6d6abc | |||
| 1f722f5df3 | |||
| df4eae1d66 | |||
| 4d435b4fc1 | |||
| f95ae10d03 | |||
| 423d840d83 | |||
| 1997b0bf9b | |||
| b206fb33aa | |||
| 11b26e396c | |||
| 94139e6ac6 | |||
| c0cc2432ff | |||
| f86aaa3782 | |||
| 690a8f0c3b | |||
| 1de0ca8d60 | |||
| de149c5d85 | |||
| 7d2b11473b | |||
| 4c25fccc86 | |||
| 5e310b0224 | |||
| 169802ccaf | |||
| 28257e00c0 | |||
| 38c6af7090 | |||
| bdbf4c604d | |||
| 73bcba2c9a | |||
| 90ca84cfbf | |||
| a18ca1ce21 | |||
| b92babb5cd | |||
| e3231ec495 | |||
| 4896ee7a65 | |||
| ce3eb7165a | |||
| 4de00b8fac | |||
| ebe777bdc5 | |||
| 3b5cacb8ad | |||
| db7d297dbc | |||
| 2f9abf7629 | |||
| b6063d2fed | |||
| e1f566f0c8 | |||
| 9fa892a6fd | |||
| 1572e163ef | |||
| 2791691057 | |||
| 575537ae66 | |||
| fde4a597c7 | |||
| e69ae52f50 | |||
| 8bdb06749f | |||
| 0cfd066f4f | |||
| 217ccb915a | |||
| 1dd3e9d86f | |||
| d3d81d71fe | |||
| 80c110afa9 | |||
| 1c08b9a51d | |||
| 4ad30106b6 | |||
| 9100d0e35a | |||
| b8dea19c30 | |||
| 671f2b9270 | |||
| d619fb2f4d | |||
| 3eb6704f2f | |||
| cd24beb8a6 | |||
| fa287305eb | |||
| 3fb656b693 | |||
| f514993525 | |||
| 81787260c9 | |||
| f9ad396228 | |||
| 8976f2e359 | |||
| 187c3edaf6 | |||
| 02e85fb354 | |||
| 289834021f | |||
| 04fea4acb2 | |||
| 54739b0a75 | |||
| ea5520a729 | |||
| 0a19d8d308 | |||
| 4dbe3e23b7 | |||
| c43cfc3b69 | |||
| babd3d2052 | |||
| 9464839b4d | |||
| bcf7875414 | |||
| 732894a0fb | |||
| 146bf5a3c2 | |||
| b05bfde094 | |||
| 37d372b8f5 | |||
| c01fee3b73 | |||
| c907e735c6 | |||
| 7545e33d2f | |||
| ebf961449a | |||
| 45d6882527 | |||
| 2ec370ad61 | |||
| 63d5c4af8e | |||
| 9619fd574e | |||
| adeb42070d | |||
| d207d246bf | |||
| 4dd3a3b874 | |||
| 52b04a754c | |||
| c0efd152e8 | |||
| 9bda80d40d | |||
| 0e12995063 | |||
| 424ebafab5 | |||
| 73d4feb679 | |||
| 887b2a9205 | |||
| 927eb3e1ff | |||
| fd19f5befe | |||
| 382775d6ab | |||
| c41ee27069 | |||
| e5b395ffa5 | |||
| b55f76c855 | |||
| 28a8bd3c51 | |||
| 9adcd89cd5 | |||
| 14e6709c29 | |||
| 024626019d | |||
| c0d86d5753 | |||
| 175281537c | |||
|
|
abb26288c6 | ||
| f5c0d5bbfc | |||
| ff08db3e44 | |||
| 7431550d61 | |||
| 448910b8d7 | |||
| 991c4fbf8e | |||
| ced0aaa597 | |||
| 498247c793 | |||
| ad5c3808cd | |||
| c658dc6a50 | |||
|
|
100adec397 | ||
|
|
f4b793574d | ||
| d8c52575fb | |||
| 1b2945d9c4 | |||
| 1244bd60ed | |||
| b566b9e89e | |||
| 4a4d7f2a38 | |||
| f7848228a2 | |||
| 8c22315b15 | |||
| 718c982578 | |||
| be0f6a9f56 | |||
| 35874f5ca2 | |||
| a7fdfce094 | |||
| 5947c9a020 | |||
| 05408915b1 | |||
| 4635b5af0f | |||
| b362217d75 | |||
| cc48d49b5c | |||
| 391e54b993 | |||
| 49b6a92865 | |||
| fbe05367fa | |||
| eaf3080859 | |||
| 6ceec9ef85 | |||
| ac73711122 | |||
| 3cb0471027 | |||
| 38e7434730 | |||
| d8cd72809c |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ AudiobookRecorder.jar
|
|||||||
AudiobookRecorder-linux
|
AudiobookRecorder-linux
|
||||||
AudiobookRecorder-osx.dmg
|
AudiobookRecorder-osx.dmg
|
||||||
AudiobookRecorder-win.exe
|
AudiobookRecorder-win.exe
|
||||||
|
.*.swp
|
||||||
|
|||||||
21
ExampleExportProfiles/librivox-noinit.abprof
Normal file
21
ExampleExportProfiles/librivox-noinit.abprof
Normal 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>
|
||||||
21
ExampleExportProfiles/librivox-spc.abprof
Normal file
21
ExampleExportProfiles/librivox-spc.abprof
Normal 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>
|
||||||
21
ExampleExportProfiles/librivox.abprof
Normal file
21
ExampleExportProfiles/librivox.abprof
Normal 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>
|
||||||
77
ExampleFilters/README.md
Normal file
77
ExampleFilters/README.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
Filters are simply XML files with the extension ".eff"
|
||||||
|
|
||||||
|
Place them in a folder called `System` within your recordings folder.
|
||||||
|
|
||||||
|
The format is:
|
||||||
|
|
||||||
|
<effect name="Filter Name">
|
||||||
|
<filter....>
|
||||||
|
[optional sub-components or filters]
|
||||||
|
</filter>
|
||||||
|
[<filter...>]
|
||||||
|
</effect>
|
||||||
|
|
||||||
|
Currently implemented filters:
|
||||||
|
|
||||||
|
<amplifier gain="1.0" />
|
||||||
|
|
||||||
|
Amplify (or attenuate) the sample by the given factor (1 = unity gain, 0 = silence, 2 = double, etc)
|
||||||
|
|
||||||
|
<lfo frequency="10" depth="0.2" />
|
||||||
|
|
||||||
|
Modulate the audio with a low-frequency oscillator. Specify the frequency and a factor of how much to modulate the audio signal. You can also specify an optional `phase="..."` (specified in radians) as an initial phase offset for the modulation.
|
||||||
|
|
||||||
|
<biquad type="..." fc="..." q="..." gain="..." />
|
||||||
|
|
||||||
|
A Biquad filter of the given type with a center frequency `fc` in Hz, a Q `q` and gain in Decibals of `gain`.
|
||||||
|
Valid types are:
|
||||||
|
|
||||||
|
* lowpass
|
||||||
|
* highpass
|
||||||
|
* bandpass
|
||||||
|
* notch
|
||||||
|
* peak
|
||||||
|
* lowshelf
|
||||||
|
* highshelf
|
||||||
|
|
||||||
|
<delay>
|
||||||
|
<delayline samples="..." gain="...">
|
||||||
|
[optional effects to apply to the delay line]
|
||||||
|
</delayline>
|
||||||
|
</delay>
|
||||||
|
|
||||||
|
A multi-tap delay line where each tap can have its own additional filters applied. The delay is given in samples and the gain as
|
||||||
|
a factor where 1.0 is unity gain.
|
||||||
|
|
||||||
|
<group name="Name">
|
||||||
|
effects in the group
|
||||||
|
</group>
|
||||||
|
|
||||||
|
Allows you to group effects together within a chain. Not of any real use yet (except that the outer wrapper of an effect chain is
|
||||||
|
actually an effect group) but may be used in the future.
|
||||||
|
|
||||||
|
|
||||||
|
An example: the "Ethereal Voice" - echoes starting off quiet and getting louder with a variable high-pass filter on the pre-echoes. Also
|
||||||
|
includes a notch filter at 140Hz to cut out a specific annoying hum generated by my computer fans.
|
||||||
|
|
||||||
|
<effect name="Ethereal Voice">
|
||||||
|
<biquad type="notch" fc="140" q="20" gain="-50" />
|
||||||
|
<amplifier gain="0.1" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="4000" gain="1.0">
|
||||||
|
<biquad type="highpass" fc="400" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="8000" gain="1.5">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="12000" gain="2.0">
|
||||||
|
<biquad type="highpass" fc="200" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="16000" gain="3.0">
|
||||||
|
<biquad type="highpass" fc="100" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="20000" gain="15.0" />
|
||||||
|
</delayline>
|
||||||
|
<biquad type="lowshelf" fc="1000" q="2.2" gain="-10" />
|
||||||
|
<amplifier gain="1.5" />
|
||||||
|
</effect>
|
||||||
4
ExampleFilters/alien.eff
Normal file
4
ExampleFilters/alien.eff
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<effect name="Alien">
|
||||||
|
<!--biquad type="lowpass" fc="10000" q="1" gain="-10" /-->
|
||||||
|
<lfo frequency="50" depth="1.0" waveform="triangle" mode="replace"/>
|
||||||
|
</effect>
|
||||||
10
ExampleFilters/bigecho.eff
Normal file
10
ExampleFilters/bigecho.eff
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<effect name="Big Echo">
|
||||||
|
<delayline>
|
||||||
|
<delay samples="22000" gain="0.2" pan="-0.3">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="44000" gain="0.05" pan="0.3">
|
||||||
|
<biquad type="highpass" fc="600" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
</delayline>
|
||||||
|
</effect>
|
||||||
6
ExampleFilters/cuthum.eff
Normal file
6
ExampleFilters/cuthum.eff
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<effect name="Cut Computer Hum">
|
||||||
|
<biquad type="notch" fc="28" q="20" gain="-50" />
|
||||||
|
<biquad type="notch" fc="91" q="20" gain="-50" />
|
||||||
|
<biquad type="notch" fc="120" q="20" gain="-50" />
|
||||||
|
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
|
||||||
|
</effect>
|
||||||
7
ExampleFilters/cuthumagc.eff
Normal file
7
ExampleFilters/cuthumagc.eff
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<effect name="Cut Computer Hum (with AGC)">
|
||||||
|
<biquad type="notch" fc="28" q="20" gain="-50" />
|
||||||
|
<biquad type="notch" fc="91" q="20" gain="-50" />
|
||||||
|
<biquad type="notch" fc="120" q="20" gain="-50" />
|
||||||
|
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
|
||||||
|
<agc ceiling="0.666" limit="1.5" attack="0.08" decay="0.01" />
|
||||||
|
</effect>
|
||||||
15
ExampleFilters/cuthumagcstereo.eff
Normal file
15
ExampleFilters/cuthumagcstereo.eff
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<effect name="Cut Computer Hum (with AGC and Stereo)">
|
||||||
|
<biquad type="notch" fc="28" q="20" gain="-50" />
|
||||||
|
<biquad type="notch" fc="91" q="20" gain="-50" />
|
||||||
|
<biquad type="notch" fc="120" q="20" gain="-50" />
|
||||||
|
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
|
||||||
|
<delayline wetonly="false">
|
||||||
|
<delay samples="-100" gain="0.1" pan="-1.0">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="100" gain="0.1" pan="1.0">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
</delayline>
|
||||||
|
<agc ceiling="0.666" limit="1.5" attack="0.1" decay="0.01" />
|
||||||
|
</effect>
|
||||||
20
ExampleFilters/ethereal.eff
Normal file
20
ExampleFilters/ethereal.eff
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<effect name="Ethereal Voice">
|
||||||
|
<amplifier gain="0.1" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="2000" gain="1.0" pan="-0.3">
|
||||||
|
<biquad type="highpass" fc="400" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="4000" gain="1.1" pan="0.3">
|
||||||
|
<biquad type="highpass" fc="800" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="8000" gain="1.2" pan="-0.5">
|
||||||
|
<biquad type="highpass" fc="1000" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="10000" gain="1.3" pan="0.5">
|
||||||
|
<biquad type="highpass" fc="1500" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="12000" gain="15.0" pan="0" />
|
||||||
|
</delayline>
|
||||||
|
<biquad type="lowshelf" fc="2000" q="2.2" gain="-10" />
|
||||||
|
<amplifier gain="1.5" />
|
||||||
|
</effect>
|
||||||
2
ExampleFilters/flat.eff
Normal file
2
ExampleFilters/flat.eff
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<effect name="Flat">
|
||||||
|
</effect>
|
||||||
15
ExampleFilters/largeroom.eff
Normal file
15
ExampleFilters/largeroom.eff
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<effect name="Large Room (quiet)">
|
||||||
|
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="5500" gain="0.2" pan="-0.3">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="11000" gain="0.05" pan="0.3">
|
||||||
|
<biquad type="highpass" fc="600" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="16500" gain="0.01" pan="0.0">
|
||||||
|
<biquad type="highpass" fc="600" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
</delayline>
|
||||||
|
<amplifier gain="0.3" />
|
||||||
|
</effect>
|
||||||
15
ExampleFilters/largeroomloud.eff
Normal file
15
ExampleFilters/largeroomloud.eff
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<effect name="Large Room (loud)">
|
||||||
|
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="5500" gain="0.2" pan="-0.3">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="11000" gain="0.05" pan="0.3">
|
||||||
|
<biquad type="highpass" fc="600" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="16500" gain="0.01" pan="0.0">
|
||||||
|
<biquad type="highpass" fc="600" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
</delayline>
|
||||||
|
<amplifier gain="0.9" />
|
||||||
|
</effect>
|
||||||
3
ExampleFilters/panleft.eff
Normal file
3
ExampleFilters/panleft.eff
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<effect name="Pan Left">
|
||||||
|
<pan pan="-0.4" />
|
||||||
|
</effect>
|
||||||
3
ExampleFilters/panright.eff
Normal file
3
ExampleFilters/panright.eff
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<effect name="Pan Right">
|
||||||
|
<pan pan="0.4" />
|
||||||
|
</effect>
|
||||||
8
ExampleFilters/phone.eff
Normal file
8
ExampleFilters/phone.eff
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<effect name="Telephone">
|
||||||
|
<biquad type="lowshelf" fc="400" q="10" gain="-20" />
|
||||||
|
<biquad type="highshelf" fc="8000" q="10" gain="-20" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="100" gain="0.5" />
|
||||||
|
</delayline>
|
||||||
|
<amplifier gain="1.4" />
|
||||||
|
</effect>
|
||||||
12
ExampleFilters/radio.eff
Normal file
12
ExampleFilters/radio.eff
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<effect name="Radio">
|
||||||
|
<amplifier gain="0.5" />
|
||||||
|
<biquad type="peak" fc="1000" q="10" gain="25" />
|
||||||
|
<lfo frequency="3000" depth="0.3" waveform="sine" mode="add" />
|
||||||
|
<clipping clip="0.9" />
|
||||||
|
<biquad type="highshelf" fc="8000" q="1" gain="-20" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="100" gain="0.7" />
|
||||||
|
<delay samples="200" gain="0.5" />
|
||||||
|
</delayline>
|
||||||
|
<amplifier gain="0.3" />
|
||||||
|
</effect>
|
||||||
10
ExampleFilters/robotic.eff
Normal file
10
ExampleFilters/robotic.eff
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<effect name="Robotic">
|
||||||
|
<biquad type="lowshelf" fc="100" q="2" gain="-20" />
|
||||||
|
<delayline>
|
||||||
|
<delay samples="400" gain="1" pan="-0.3" />
|
||||||
|
<delay samples="800" gain="1" pan="-0.3" />
|
||||||
|
<delay samples="1200" gain="1" pan="-0.3" />
|
||||||
|
<delay samples="1600" gain="1" pan="-0.3" />
|
||||||
|
<delay samples="2000" gain="1" pan="-0.3" />
|
||||||
|
</delayline>
|
||||||
|
</effect>
|
||||||
10
ExampleFilters/stereochorus.eff
Normal file
10
ExampleFilters/stereochorus.eff
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<effect name="Stereo Chorus">
|
||||||
|
<delayline>
|
||||||
|
<delay samples="2000" gain="0.1" pan="-0.3">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
<delay samples="4000" gain="0.1" pan="0.3">
|
||||||
|
<biquad type="highpass" fc="300" q="1" gain="0" />
|
||||||
|
</delay>
|
||||||
|
</delayline>
|
||||||
|
</effect>
|
||||||
75
README.md
75
README.md
@@ -8,6 +8,9 @@ A system for easing the task of recording and editing audiobooks.
|
|||||||
* Zero editing
|
* Zero editing
|
||||||
* MP3 export
|
* MP3 export
|
||||||
* Chapter management
|
* Chapter management
|
||||||
|
* Audio effect chains (biquad, delay line, etc)
|
||||||
|
|
||||||
|
# [Manual and Tutorial](https://majenkoprojects.github.io/AudiobookRecorder)
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
@@ -27,12 +30,14 @@ From here on much is controlled by key presses.
|
|||||||
* Press and hold "R" to record a new phrase - the screen flashes red while it's recording. The phrase is
|
* Press and hold "R" to record a new phrase - the screen flashes red while it's recording. The phrase is
|
||||||
appended to the currently selected chapter, or to the last chapter if none is selected.
|
appended to the currently selected chapter, or to the last chapter if none is selected.
|
||||||
* Press and hold "T" to record a new phrase that is the start of a new paragraph. This adds the "post paragraph" gap to the previous sentence. Otherwise it does the same as "R".
|
* Press and hold "T" to record a new phrase that is the start of a new paragraph. This adds the "post paragraph" gap to the previous sentence. Otherwise it does the same as "R".
|
||||||
|
* Press and hold "F" to record a "continuation" phrase. This sets the previous phrase's post-gap to be the "short" gap instead of the normal length gap.
|
||||||
|
* Press and hold "Y" to record a new phrase that is the start of a new section. This add the "post section" gap to the previous sentence. Otherwise it does the same as "R".
|
||||||
* Press "D" to delete the last phrase you recorded.
|
* Press "D" to delete the last phrase you recorded.
|
||||||
* Press "E" to re-record the currently selected phrase.
|
* Press "E" to re-record the currently selected phrase.
|
||||||
|
|
||||||
Each phrase you record will be briefly analysed using FFT to find the start and end of the audio and set
|
Each phrase you record can be automatically analysed to find the start and end of the audio and set
|
||||||
crop marks appropriately. These can be adjusted in the waveform display when a phrase is selected. You can also
|
crop marks appropriately. These can be adjusted in the waveform display when a phrase is selected. You can also
|
||||||
re-run the analysis using either the default FFT method or using a peak detector method (finding the first and last points
|
re-run the analysis using either FFT or a peak detector method (finding the first and last points
|
||||||
where the audio amplitude rises above the backround noise).
|
where the audio amplitude rises above the backround noise).
|
||||||
|
|
||||||
The phrases also have a "post gap" associated with them. This is the amount of room noise (in milliseconds) to place between
|
The phrases also have a "post gap" associated with them. This is the amount of room noise (in milliseconds) to place between
|
||||||
@@ -51,23 +56,67 @@ edit the text of this ID to identify the recordings. You
|
|||||||
may, for instance, change it to have the same text as the
|
may, for instance, change it to have the same text as the
|
||||||
audio contains.
|
audio contains.
|
||||||
|
|
||||||
To help with this CMU Sphinx (US EN dictionary) is bundled
|
The audio can also be automatically converted to text if you have an suitable command-line
|
||||||
with the system and can be used to try and convert the
|
executable that will work. One example is (on Linux) [DeepSpeech](https://github.com/mozilla/DeepSpeech) by Mozilla.
|
||||||
audio into text. Right clicking on a recording brings
|
|
||||||
up a menu which includes the option to try and convert
|
|
||||||
the audio into text. The detected text is then used to
|
|
||||||
replace the current recording ID / text.
|
|
||||||
|
|
||||||
It's far from perfect (especially for a British English
|
|
||||||
speaker), but it can help you to navigate your way around
|
|
||||||
a chapter.
|
|
||||||
|
|
||||||
File layout
|
File layout
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
All data is stored in your "storage" directory (specified in Options). Each book (which is a directory named after the
|
All data is stored in your "storage" directory (specified in Options). Each book (which is a directory named after the
|
||||||
title of the book) has an associated XML file (audiobook.abk) and a directory "files" where all the audio (stored as WAV
|
title of the book) has an associated XML file (audiobook.abx) and a directory "files" where all the audio (stored as WAV
|
||||||
files) is placed.
|
files) is placed.
|
||||||
|
|
||||||
When you export the book as MP3 a new folder "export" is created within the book's folder where the MP3 files are placed.
|
When you export the book as MP3 a new folder "export" is created within the book's folder where the MP3 files are placed.
|
||||||
MP3 files are all tagged with the book title, chapter title, chapter number and comment.
|
MP3 files are all tagged with the book title, chapter title, chapter number and comment.
|
||||||
|
|
||||||
|
|
||||||
|
Building
|
||||||
|
========
|
||||||
|
|
||||||
|
1. Check out this repo
|
||||||
|
2. Install `ant` and `default-jdk`
|
||||||
|
3. Install [git LFS support](https://help.github.com/articles/installing-git-large-file-storage/)
|
||||||
|
4. Pull the large files with `git lfs pull`
|
||||||
|
5. Build with `ant build`
|
||||||
|
6. Run with `java -jar ./AudiobookRecorder.jar`
|
||||||
|
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Extra Resources
|
||||||
|
===============
|
||||||
|
|
||||||
|
* DeepSpeech wrapper script
|
||||||
|
|
||||||
|
This is a small script that will convert the audio into a format DeepSpeech likes and call the `deepspeech` executable, removing any extra rubbish from the output. It
|
||||||
|
also requires `sox` to be installed for the audio conversion.
|
||||||
|
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ID=$$
|
||||||
|
FILE=$1
|
||||||
|
BINPATH=${HOME}/local/bin
|
||||||
|
MODELS=${HOME}/ds/deepspeech-0.6.1-models
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
```
|
||||||
|
|||||||
Binary file not shown.
@@ -25,7 +25,7 @@
|
|||||||
debug="true"
|
debug="true"
|
||||||
debuglevel="lines,vars,source"
|
debuglevel="lines,vars,source"
|
||||||
encoding="UTF-8"
|
encoding="UTF-8"
|
||||||
bootclasspath="${bootclass.path}"
|
bootclasspath="/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar"
|
||||||
includeAntRuntime="false"
|
includeAntRuntime="false"
|
||||||
deprecation="true"
|
deprecation="true"
|
||||||
srcdir="src"
|
srcdir="src"
|
||||||
|
|||||||
BIN
deps/commons-codec-1.10.jar
LFS
vendored
Normal file
BIN
deps/commons-codec-1.10.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/commons-lang3.jar
LFS
vendored
Normal file
BIN
deps/commons-lang3.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/commons-logging-1.2.jar
LFS
vendored
Normal file
BIN
deps/commons-logging-1.2.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/commons-text.jar
LFS
vendored
Normal file
BIN
deps/commons-text.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/fluent-hc-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/fluent-hc-4.5.6.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/httpclient-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpclient-4.5.6.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/httpclient-cache-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpclient-cache-4.5.6.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/httpclient-win-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpclient-win-4.5.6.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/httpcore-4.4.10.jar
LFS
vendored
Normal file
BIN
deps/httpcore-4.4.10.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/httpmime-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpmime-4.5.6.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/jna-4.4.0.jar
LFS
vendored
Normal file
BIN
deps/jna-4.4.0.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/jna-platform-4.4.0.jar
LFS
vendored
Normal file
BIN
deps/jna-platform-4.4.0.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/json-20180813.jar
LFS
vendored
Normal file
BIN
deps/json-20180813.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/json-20190722.jar
LFS
vendored
Normal file
BIN
deps/json-20190722.jar
LFS
vendored
Normal file
Binary file not shown.
BIN
deps/mp3agic-0.9.1.jar
vendored
BIN
deps/mp3agic-0.9.1.jar
vendored
Binary file not shown.
BIN
deps/sphinx4-core-5prealpha-SNAPSHOT.jar
vendored
BIN
deps/sphinx4-core-5prealpha-SNAPSHOT.jar
vendored
Binary file not shown.
BIN
deps/sphinx4-data-5prealpha-SNAPSHOT.jar
vendored
BIN
deps/sphinx4-data-5prealpha-SNAPSHOT.jar
vendored
Binary file not shown.
13
dist/linux/audiobookrecorder.desktop
vendored
Normal file
13
dist/linux/audiobookrecorder.desktop
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=AudiobookRecorder
|
||||||
|
GenericName=Audiobook Recorder
|
||||||
|
X-GNOME-FullName=AudiobookRecorder
|
||||||
|
Comment=Record audiobooks with ease
|
||||||
|
Keywords=audio
|
||||||
|
Exec=AudiobookRecorder
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
StartupNotify=true
|
||||||
|
Icon=AudiobookRecorder
|
||||||
|
Categories=AudioVideo;Audio;Recorder;
|
||||||
|
X-AppStream-Ignore=true
|
||||||
3
dist/linux/stub
vendored
3
dist/linux/stub
vendored
@@ -5,6 +5,7 @@ java=java
|
|||||||
if test -n "$JAVA_HOME"; then
|
if test -n "$JAVA_HOME"; then
|
||||||
java="$JAVA_HOME/bin/java"
|
java="$JAVA_HOME/bin/java"
|
||||||
fi
|
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 "$@"
|
exec "$java" $java_args -jar $MYSELF "$@"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
76
iircoeff
76
iircoeff
@@ -1,76 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
use Math::Trig;
|
|
||||||
|
|
||||||
my $fs = 96000;
|
|
||||||
|
|
||||||
printCo(0, 20, 25, $fs);
|
|
||||||
printCo(20, 25, 31.5, $fs);
|
|
||||||
printCo(25, 31.5, 40, $fs);
|
|
||||||
printCo(31.5, 40, 50, $fs);
|
|
||||||
printCo(40, 50, 63, $fs);
|
|
||||||
printCo(50, 63, 80, $fs);
|
|
||||||
printCo(63, 80, 100, $fs);
|
|
||||||
printCo(80, 100, 125, $fs);
|
|
||||||
printCo(100, 125, 160, $fs);
|
|
||||||
printCo(125, 160, 200, $fs);
|
|
||||||
printCo(160, 200, 250, $fs);
|
|
||||||
printCo(200, 250, 315, $fs);
|
|
||||||
printCo(250, 315, 400, $fs);
|
|
||||||
printCo(315, 400, 500, $fs);
|
|
||||||
printCo(400, 500, 630, $fs);
|
|
||||||
printCo(500, 630, 800, $fs);
|
|
||||||
printCo(630, 800, 1000, $fs);
|
|
||||||
printCo(800, 1000, 1250, $fs);
|
|
||||||
printCo(1000, 1250, 1600, $fs);
|
|
||||||
printCo(1250, 1600, 2000, $fs);
|
|
||||||
printCo(1600, 2000, 2500, $fs);
|
|
||||||
printCo(2000, 2500, 3150, $fs);
|
|
||||||
printCo(2500, 3150, 4000, $fs);
|
|
||||||
printCo(3150, 4000, 5000, $fs);
|
|
||||||
printCo(4000, 5000, 6300, $fs);
|
|
||||||
printCo(5000, 6300, 8000, $fs);
|
|
||||||
printCo(6300, 8000, 10000, $fs);
|
|
||||||
printCo(8000, 10000, 12500, $fs);
|
|
||||||
printCo(10000, 12500, 16000, $fs);
|
|
||||||
printCo(12500, 16000, 20000, $fs);
|
|
||||||
printCo(16000, 20000, $fs / 2, $fs);
|
|
||||||
|
|
||||||
sub printCo($$$$) {
|
|
||||||
my $fl = shift;
|
|
||||||
my $f0 = shift;
|
|
||||||
my $fh = shift;
|
|
||||||
my $fs = shift;
|
|
||||||
|
|
||||||
my $f1 = $f0 - (($f0 - $fl) / 2);
|
|
||||||
my $f2 = $f0 + (($fh - $f0) / 2);
|
|
||||||
|
|
||||||
@coeff = coefficient($f0, $fs, $f1, $f2);
|
|
||||||
print "/* $f0 Hz */\n";
|
|
||||||
printf("new IIRCoefficients(%.10e, %.10e, %.10e),\n" , $coeff[1] * 2, $coeff[0] * 2, $coeff[2] * 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub coefficient($$$$) {
|
|
||||||
my $f0 = shift;
|
|
||||||
my $fs = shift;
|
|
||||||
my $f1 = shift;
|
|
||||||
my $f2 = shift;
|
|
||||||
|
|
||||||
my $q = $f0 / ($f2 - $f1);
|
|
||||||
|
|
||||||
my $pi = 3.141592653;
|
|
||||||
|
|
||||||
my $theta0 = 2 * $pi * ($f0 / $fs);
|
|
||||||
|
|
||||||
my $thetaOverTwoQ = $theta0 / (2 * $q);
|
|
||||||
|
|
||||||
my $beta = 0.5 * ((1 - tan($thetaOverTwoQ)) / (1 + tan($thetaOverTwoQ)));
|
|
||||||
|
|
||||||
my $gamma = (0.5 + $beta) * cos($theta0);
|
|
||||||
|
|
||||||
my $alpha = (0.5 - $beta) / 2;
|
|
||||||
|
|
||||||
return ($alpha, $beta, $gamma);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="src" output="demo/SimpleApp/build" path="demo/SimpleApp/src"/>
|
<classpathentry kind="src" output="demo/ExitCodeApp/build" path="demo/ExitCodeApp/src"/>
|
||||||
<classpathentry kind="src" output="demo/ConsoleApp/build" path="demo/ConsoleApp/src"/>
|
<classpathentry kind="src" output="demo/SimpleApp/build" path="demo/SimpleApp/src"/>
|
||||||
<classpathentry kind="lib" path="lib/formsrt.jar"/>
|
<classpathentry kind="src" output="demo/ConsoleApp/build" path="demo/ConsoleApp/src"/>
|
||||||
<classpathentry kind="lib" path="lib/xstream.jar"/>
|
<classpathentry kind="lib" path="lib/formsrt.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/commons-beanutils.jar"/>
|
<classpathentry kind="lib" path="lib/xstream.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
|
<classpathentry kind="lib" path="lib/commons-beanutils.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/foxtrot.jar"/>
|
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/ant.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-common.jar"/>
|
<classpathentry kind="lib" path="lib/jgoodies-forms.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/jgoodies-forms.jar"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="lib" path="lib/jgoodies-looks.jar"/>
|
<classpathentry kind="lib" path="lib/flatlaf.jar"/>
|
||||||
<classpathentry kind="output" path="build"/>
|
<classpathentry kind="output" path="build"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
1
launch4j/.gitignore
vendored
1
launch4j/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/build
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>launch4j</name>
|
<name>launch4j</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
encoding/<project>=UTF-8
|
encoding/<project>=UTF-8
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
line.separator=\n
|
line.separator=\n
|
||||||
|
|||||||
@@ -1,81 +1,117 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
|
||||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.APILeak=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
|
||||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
|
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
|
||||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
|
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.6
|
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
|
||||||
|
|||||||
4
launch4j/.settings/org.eclipse.m2e.core.prefs
Normal file
4
launch4j/.settings/org.eclipse.m2e.core.prefs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
21
launch4j/.vscode/c_cpp_properties.json
vendored
Normal file
21
launch4j/.vscode/c_cpp_properties.json
vendored
Normal 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
17
launch4j/.vscode/tasks.json
vendored
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,30 +1,30 @@
|
|||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2021 Grzegorz Kowal
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
are permitted provided that the following conditions are met:
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice,
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
this list of conditions and the following disclaimer in the documentation
|
this list of conditions and the following disclaimer in the documentation
|
||||||
and/or other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its contributors
|
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
|
may be used to endorse or promote products derived from this software without
|
||||||
specific prior written permission.
|
specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
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
|
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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -1,62 +1,77 @@
|
|||||||
<project name="launch4j" default="compile" basedir=".">
|
<project name="launch4j" default="compile" basedir=".">
|
||||||
<property name="src" location="src" />
|
<property name="src" location="src" />
|
||||||
<property name="lib" location="lib" />
|
<property name="lib" location="lib" />
|
||||||
<property name="build" location="build" />
|
<property name="build" location="build" />
|
||||||
<property name="jar" location="./${ant.project.name}.jar" />
|
<property name="jar" location="./${ant.project.name}.jar" />
|
||||||
<property name="launch4j.dir" location="." />
|
<property name="launch4j.dir" location="." />
|
||||||
|
<property name="maven" location="maven" />
|
||||||
<path id="dist.classpath">
|
<property file="${src}/launch4j.properties"/>
|
||||||
<pathelement path="${build}" />
|
|
||||||
<fileset dir="${lib}">
|
<path id="dist.classpath">
|
||||||
<include name="**/*.jar" />
|
<pathelement path="${build}" />
|
||||||
</fileset>
|
<fileset dir="${lib}">
|
||||||
</path>
|
<include name="**/*.jar" />
|
||||||
|
</fileset>
|
||||||
<target name="init">
|
</path>
|
||||||
<tstamp />
|
|
||||||
<mkdir dir="${build}" />
|
<target name="init">
|
||||||
</target>
|
<tstamp />
|
||||||
|
<mkdir dir="${build}" />
|
||||||
<target name="compile" depends="init" description="compile the source">
|
</target>
|
||||||
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.6" debug="on" includeantruntime="false" />
|
|
||||||
<copy todir="${build}/images">
|
<target name="compile" depends="init" description="compile the source">
|
||||||
<fileset dir="${src}/images">
|
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.8" debug="on" includeantruntime="false" />
|
||||||
<include name="**/*" />
|
<copy todir="${build}/images">
|
||||||
</fileset>
|
<fileset dir="${src}/images">
|
||||||
</copy>
|
<include name="**/*" />
|
||||||
<copy todir="${build}">
|
</fileset>
|
||||||
<fileset dir="${src}">
|
</copy>
|
||||||
<include name="**/*.properties" />
|
<copy todir="${build}">
|
||||||
</fileset>
|
<fileset dir="${src}">
|
||||||
</copy>
|
<include name="**/*.properties" />
|
||||||
</target>
|
</fileset>
|
||||||
|
</copy>
|
||||||
<target name="jar" depends="compile" description="create jar">
|
</target>
|
||||||
<fileset dir="${lib}" id="lib.dist.fileset">
|
|
||||||
<include name="**/*.jar" />
|
<target name="jar" depends="compile" description="create jar">
|
||||||
</fileset>
|
<fileset dir="${lib}" id="lib.dist.fileset">
|
||||||
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
<include name="**/*.jar" />
|
||||||
<map from="${lib}" to="./lib" />
|
</fileset>
|
||||||
</pathconvert>
|
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
||||||
<!-- Put everything in ${build} into a jar file -->
|
<map from="${lib}" to="./lib" />
|
||||||
<jar jarfile="${jar}">
|
</pathconvert>
|
||||||
<fileset dir="${build}" excludes="**/messages_es.properties" />
|
<!-- Put everything in ${build} into a jar file -->
|
||||||
<manifest>
|
<jar jarfile="${jar}">
|
||||||
<attribute name="Main-Class" value="net.sf.launch4j.Main" />
|
<fileset dir="${build}" excludes="**/messages_es.properties" />
|
||||||
<attribute name="Class-Path" value=". ${dist.classpath}" />
|
<manifest>
|
||||||
</manifest>
|
<attribute name="Main-Class" value="net.sf.launch4j.Main" />
|
||||||
</jar>
|
<attribute name="Class-Path" value=". ${dist.classpath}" />
|
||||||
</target>
|
</manifest>
|
||||||
|
</jar>
|
||||||
<target name="demo" depends="jar" description="build the demos">
|
</target>
|
||||||
<ant dir="./demo/ConsoleApp" inheritAll="false" />
|
|
||||||
<ant dir="./demo/SimpleApp" inheritAll="false" />
|
<target name="demo" depends="jar" description="build the demos">
|
||||||
</target>
|
<ant dir="./demo/ConsoleApp" inheritAll="false" />
|
||||||
|
<ant dir="./demo/SimpleApp" inheritAll="false" />
|
||||||
<target name="clean" description="clean up">
|
</target>
|
||||||
<delete dir="${build}" />
|
|
||||||
<delete file="${jar}" />
|
<target name="clean" description="clean up">
|
||||||
<ant dir="./demo/ConsoleApp" target="clean" inheritAll="false" />
|
<delete dir="${build}" />
|
||||||
<ant dir="./demo/SimpleApp" target="clean" inheritAll="false" />
|
<delete file="${jar}" />
|
||||||
</target>
|
<ant dir="./demo/ConsoleApp" target="clean" inheritAll="false" />
|
||||||
</project>
|
<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>
|
||||||
|
|||||||
1
launch4j/demo/ConsoleApp/.gitignore
vendored
1
launch4j/demo/ConsoleApp/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/build
|
|
||||||
Binary file not shown.
@@ -1,57 +1,57 @@
|
|||||||
<project name="ConsoleApp" default="exe" basedir=".">
|
<project name="ConsoleApp" default="exe" basedir=".">
|
||||||
<property name="src" location="src" />
|
<property name="src" location="src" />
|
||||||
<property name="lib" location="lib" />
|
<property name="lib" location="lib" />
|
||||||
<property name="build" location="build" />
|
<property name="build" location="build" />
|
||||||
<property name="launch4j.dir" location="../.." />
|
<property name="launch4j.dir" location="../.." />
|
||||||
|
|
||||||
<path id="dist.classpath">
|
<path id="dist.classpath">
|
||||||
<pathelement path="${build}" />
|
<pathelement path="${build}" />
|
||||||
<fileset dir="${lib}">
|
<fileset dir="${lib}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<target name="init">
|
<target name="init">
|
||||||
<tstamp />
|
<tstamp />
|
||||||
<mkdir dir="${build}" />
|
<mkdir dir="${build}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="init" description="compile the source">
|
<target name="compile" depends="init" description="compile the source">
|
||||||
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.6" debug="on" includeantruntime="false" />
|
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.8" debug="on" includeantruntime="false" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="jar" depends="compile" description="create the jar">
|
<target name="jar" depends="compile" description="create the jar">
|
||||||
<fileset dir="${lib}" id="lib.dist.fileset">
|
<fileset dir="${lib}" id="lib.dist.fileset">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
||||||
<map from="${lib}" to=".\lib" />
|
<map from="${lib}" to=".\lib" />
|
||||||
</pathconvert>
|
</pathconvert>
|
||||||
<!-- Put everything in ${build} into a jar file -->
|
<!-- Put everything in ${build} into a jar file -->
|
||||||
<jar jarfile="${ant.project.name}.jar">
|
<jar jarfile="${ant.project.name}.jar">
|
||||||
<fileset dir="${build}" includes="**/*" />
|
<fileset dir="${build}" includes="**/*" />
|
||||||
<manifest>
|
<manifest>
|
||||||
<!-- SET YOUR MAIN CLASS HERE -->
|
<!-- SET YOUR MAIN CLASS HERE -->
|
||||||
<attribute name="Main-Class" value="net.sf.launch4j.example.ConsoleApp" />
|
<attribute name="Main-Class" value="net.sf.launch4j.example.ConsoleApp" />
|
||||||
<attribute name="Class-Path" value=". ${dist.classpath}" />
|
<attribute name="Class-Path" value=". ${dist.classpath}" />
|
||||||
</manifest>
|
</manifest>
|
||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="exe" depends="jar">
|
<target name="exe" depends="jar">
|
||||||
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
|
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
|
||||||
:${launch4j.dir}/lib/xstream.jar" />
|
:${launch4j.dir}/lib/xstream.jar" />
|
||||||
<launch4j>
|
<launch4j>
|
||||||
<config headerType="console" jar="ConsoleApp.jar" outfile="ConsoleApp.exe" errTitle="ConsoleApp" chdir="." icon="l4j/ConsoleApp.ico">
|
<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" />
|
<singleInstance mutexName="net.sf.launch4j.example.ConsoleApp" />
|
||||||
<jre minVersion="1.6.0" />
|
<jre path="%JAVA_HOME%;%PATH%" minVersion="1.8.0" />
|
||||||
</config>
|
</config>
|
||||||
</launch4j>
|
</launch4j>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<delete dir="${build}" />
|
<delete dir="${build}" />
|
||||||
<delete file="${ant.project.name}.jar" />
|
<delete file="${ant.project.name}.jar" />
|
||||||
<delete file="${ant.project.name}.exe" />
|
<delete file="${ant.project.name}.exe" />
|
||||||
</target>
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,72 +1,72 @@
|
|||||||
/*
|
/*
|
||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
are permitted provided that the following conditions are met:
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice,
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
this list of conditions and the following disclaimer in the documentation
|
this list of conditions and the following disclaimer in the documentation
|
||||||
and/or other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its contributors
|
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
|
may be used to endorse or promote products derived from this software without
|
||||||
specific prior written permission.
|
specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
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
|
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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.sf.launch4j.example;
|
package net.sf.launch4j.example;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Copyright (C) 2005 Grzegorz Kowal
|
* @author Copyright (C) 2005 Grzegorz Kowal
|
||||||
*/
|
*/
|
||||||
public class ConsoleApp {
|
public class ConsoleApp {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
StringBuffer sb = new StringBuffer("Hello World!\n\nJava version: ");
|
StringBuffer sb = new StringBuffer("Hello World!\n\nJava version: ");
|
||||||
sb.append(System.getProperty("java.version"));
|
sb.append(System.getProperty("java.version"));
|
||||||
sb.append("\nJava home: ");
|
sb.append("\nJava home: ");
|
||||||
sb.append(System.getProperty("java.home"));
|
sb.append(System.getProperty("java.home"));
|
||||||
sb.append("\nCurrent dir: ");
|
sb.append("\nCurrent dir: ");
|
||||||
sb.append(System.getProperty("user.dir"));
|
sb.append(System.getProperty("user.dir"));
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
sb.append("\nArgs: ");
|
sb.append("\nArgs: ");
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (int i = 0; i < args.length; i++) {
|
||||||
sb.append(args[i]);
|
sb.append(args[i]);
|
||||||
sb.append(' ');
|
sb.append(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sb.append("\n\nEnter a line of text, 'quit' or Ctrl-C to stop.\n\n>");
|
sb.append("\n\nEnter a line of text, 'quit' or Ctrl-C to stop.\n\n>");
|
||||||
System.out.print(sb.toString());
|
System.out.print(sb.toString());
|
||||||
try {
|
try {
|
||||||
BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
|
BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
|
||||||
String line;
|
String line;
|
||||||
while ((line = is.readLine()) != null && !line.equalsIgnoreCase("quit")) {
|
while ((line = is.readLine()) != null && !line.equalsIgnoreCase("quit")) {
|
||||||
System.out.print("You wrote: " + line + "\n\n>");
|
System.out.print("You wrote: " + line + "\n\n>");
|
||||||
}
|
}
|
||||||
is.close();
|
is.close();
|
||||||
System.exit(123);
|
System.exit(123);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.print(e);
|
System.err.print(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
75
launch4j/demo/ExitCodeApp/pom.xml
Normal file
75
launch4j/demo/ExitCodeApp/pom.xml
Normal 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>
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,30 +1,30 @@
|
|||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
are permitted provided that the following conditions are met:
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice,
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
this list of conditions and the following disclaimer in the documentation
|
this list of conditions and the following disclaimer in the documentation
|
||||||
and/or other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its contributors
|
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
|
may be used to endorse or promote products derived from this software without
|
||||||
specific prior written permission.
|
specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
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
|
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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|||||||
1
launch4j/demo/SimpleApp/.gitignore
vendored
1
launch4j/demo/SimpleApp/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/build
|
|
||||||
Binary file not shown.
@@ -1,52 +1,52 @@
|
|||||||
<project name="SimpleApp" default="exe" basedir=".">
|
<project name="SimpleApp" default="exe" basedir=".">
|
||||||
<property name="src" location="src" />
|
<property name="src" location="src" />
|
||||||
<property name="lib" location="lib" />
|
<property name="lib" location="lib" />
|
||||||
<property name="build" location="build" />
|
<property name="build" location="build" />
|
||||||
<property name="launch4j.dir" location="../.." />
|
<property name="launch4j.dir" location="../.." />
|
||||||
|
|
||||||
<path id="dist.classpath">
|
<path id="dist.classpath">
|
||||||
<pathelement path="${build}" />
|
<pathelement path="${build}" />
|
||||||
<fileset dir="${lib}">
|
<fileset dir="${lib}">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<target name="init">
|
<target name="init">
|
||||||
<tstamp />
|
<tstamp />
|
||||||
<mkdir dir="${build}" />
|
<mkdir dir="${build}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="init" description="compile the source">
|
<target name="compile" depends="init" description="compile the source">
|
||||||
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.6" debug="on" includeantruntime="false" />
|
<javac srcdir="${src}" destdir="${build}" classpathref="dist.classpath" source="1.8" debug="on" includeantruntime="false" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="jar" depends="compile" description="create the jar">
|
<target name="jar" depends="compile" description="create the jar">
|
||||||
<fileset dir="${lib}" id="lib.dist.fileset">
|
<fileset dir="${lib}" id="lib.dist.fileset">
|
||||||
<include name="**/*.jar" />
|
<include name="**/*.jar" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
<pathconvert pathsep=" " property="dist.classpath" refid="lib.dist.fileset">
|
||||||
<map from="${lib}" to=".\lib" />
|
<map from="${lib}" to=".\lib" />
|
||||||
</pathconvert>
|
</pathconvert>
|
||||||
<!-- Put everything in ${build} into a jar file -->
|
<!-- Put everything in ${build} into a jar file -->
|
||||||
<jar jarfile="${ant.project.name}.jar">
|
<jar jarfile="${ant.project.name}.jar">
|
||||||
<fileset dir="${build}" includes="**/*" />
|
<fileset dir="${build}" includes="**/*" />
|
||||||
<manifest>
|
<manifest>
|
||||||
<!-- SET YOUR MAIN CLASS HERE -->
|
<!-- SET YOUR MAIN CLASS HERE -->
|
||||||
<attribute name="Main-Class" value="net.sf.launch4j.example.SimpleApp" />
|
<attribute name="Main-Class" value="net.sf.launch4j.example.SimpleApp" />
|
||||||
<attribute name="Class-Path" value=". ${dist.classpath}" />
|
<attribute name="Class-Path" value=". ${dist.classpath}" />
|
||||||
</manifest>
|
</manifest>
|
||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="exe" depends="jar">
|
<target name="exe" depends="jar">
|
||||||
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
|
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar
|
||||||
:${launch4j.dir}/lib/xstream.jar" />
|
:${launch4j.dir}/lib/xstream.jar" />
|
||||||
<launch4j configFile="./l4j/SimpleApp.xml" />
|
<launch4j configFile="./l4j/SimpleApp.xml" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<delete dir="${build}" />
|
<delete dir="${build}" />
|
||||||
<delete file="${ant.project.name}.jar" />
|
<delete file="${ant.project.name}.jar" />
|
||||||
<delete file="${ant.project.name}.exe" />
|
<delete file="${ant.project.name}.exe" />
|
||||||
</target>
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
<launch4jConfig>
|
<launch4jConfig>
|
||||||
<headerType>gui</headerType>
|
<headerType>gui</headerType>
|
||||||
<jar>../SimpleApp.jar</jar>
|
<jar>SimpleApp.jar</jar>
|
||||||
<outfile>../SimpleApp.exe</outfile>
|
<dontWrapJar>true</dontWrapJar>
|
||||||
<errTitle>SimpleApp</errTitle>
|
<outfile>../SimpleApp.exe</outfile>
|
||||||
<chdir>.</chdir>
|
<errTitle>SimpleApp</errTitle>
|
||||||
<icon>SimpleApp.ico</icon>
|
<chdir>.</chdir>
|
||||||
<restartOnCrash>true</restartOnCrash>
|
<icon>SimpleApp.ico</icon>
|
||||||
<jre>
|
<restartOnCrash>true</restartOnCrash>
|
||||||
<minVersion>1.6.0</minVersion>
|
<jre>
|
||||||
</jre>
|
<path>%JAVA_HOME%;%PATH%</path>
|
||||||
<splash>
|
<minVersion>1.8.0</minVersion>
|
||||||
<file>splash.bmp</file>
|
</jre>
|
||||||
<waitForWindow>true</waitForWindow>
|
<splash>
|
||||||
<timeout>60</timeout>
|
<file>splash.bmp</file>
|
||||||
<timeoutErr>true</timeoutErr>
|
<waitForWindow>true</waitForWindow>
|
||||||
</splash>
|
<timeout>60</timeout>
|
||||||
|
<timeoutErr>true</timeoutErr>
|
||||||
|
</splash>
|
||||||
</launch4jConfig>
|
</launch4jConfig>
|
||||||
@@ -1,122 +1,195 @@
|
|||||||
/*
|
/*
|
||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
are permitted provided that the following conditions are met:
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice,
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
this list of conditions and the following disclaimer.
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
this list of conditions and the following disclaimer in the documentation
|
this list of conditions and the following disclaimer in the documentation
|
||||||
and/or other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
3. Neither the name of the copyright holder nor the names of its contributors
|
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
|
may be used to endorse or promote products derived from this software without
|
||||||
specific prior written permission.
|
specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
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
|
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.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.sf.launch4j.example;
|
package net.sf.launch4j.example;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Toolkit;
|
import java.awt.Font;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.Toolkit;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
import javax.swing.AbstractAction;
|
import java.util.ArrayList;
|
||||||
import javax.swing.JFrame;
|
import java.util.Collections;
|
||||||
import javax.swing.JMenu;
|
import java.util.List;
|
||||||
import javax.swing.JMenuBar;
|
|
||||||
import javax.swing.JMenuItem;
|
import javax.swing.AbstractAction;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.JMenu;
|
||||||
|
import javax.swing.JMenuBar;
|
||||||
public class SimpleApp extends JFrame {
|
import javax.swing.JMenuItem;
|
||||||
public SimpleApp(String[] args) {
|
import javax.swing.JScrollPane;
|
||||||
super("Java Application");
|
import javax.swing.JTextArea;
|
||||||
|
import javax.swing.UIManager;
|
||||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
|
||||||
setBounds (screenSize.width / 4, screenSize.height / 4, screenSize.width / 2, screenSize.height / 2);
|
public class SimpleApp extends JFrame {
|
||||||
|
public SimpleApp(String[] args) {
|
||||||
JMenu menu = new JMenu("File");
|
super("Java Application");
|
||||||
menu.add(new JMenuItem("Open"));
|
|
||||||
menu.add(new JMenuItem("Save"));
|
if (args.length == 1 && "throw".equals(args[0])) {
|
||||||
|
throw new IllegalStateException("Exception thrown from SimpleApp.");
|
||||||
menu.addSeparator();
|
}
|
||||||
|
|
||||||
menu.add(new JMenuItem(new AbstractAction("Exit with code 0") {
|
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
@Override
|
setBounds (screenSize.width / 4, screenSize.height / 4, screenSize.width / 2, screenSize.height / 2);
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
System.exit(0);
|
addWindowListener(new WindowAdapter() {
|
||||||
}
|
public void windowClosing(WindowEvent e) {
|
||||||
}));
|
System.exit(0);
|
||||||
|
}});
|
||||||
menu.add(new JMenuItem(new AbstractAction("Exit with code 100 and restart the application") {
|
|
||||||
@Override
|
initializeMenu();
|
||||||
public void actionPerformed(ActionEvent e) {
|
initializeTextArea(args);
|
||||||
System.exit(100);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
|
public static void setLAF() {
|
||||||
JMenuBar mb = new JMenuBar();
|
JFrame.setDefaultLookAndFeelDecorated(true);
|
||||||
mb.setOpaque(true);
|
Toolkit.getDefaultToolkit().setDynamicLayout(true);
|
||||||
mb.add(menu);
|
System.setProperty("sun.awt.noerasebackground","true");
|
||||||
setJMenuBar(mb);
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
this.addWindowListener(new WindowAdapter() {
|
} catch (Exception e) {
|
||||||
public void windowClosing(WindowEvent e) {
|
System.err.println("Failed to set LookAndFeel");
|
||||||
System.exit(0);
|
}
|
||||||
}});
|
}
|
||||||
setVisible(true);
|
|
||||||
|
public static void main(String[] args) {
|
||||||
StringBuffer sb = new StringBuffer("Java version: ");
|
setLAF();
|
||||||
sb.append(System.getProperty("java.version"));
|
new SimpleApp(args);
|
||||||
sb.append("\nJava home: ");
|
}
|
||||||
sb.append(System.getProperty("java.home"));
|
|
||||||
sb.append("\nCurrent dir: ");
|
private final void initializeMenu() {
|
||||||
sb.append(System.getProperty("user.dir"));
|
JMenu menu = new JMenu("Exit with code");
|
||||||
if (args.length > 0) {
|
|
||||||
sb.append("\nArgs: ");
|
menu.add(new JMenuItem(new AbstractAction("Exit with code 0") {
|
||||||
for (int i = 0; i < args.length; i++) {
|
@Override
|
||||||
sb.append(args[i]);
|
public void actionPerformed(ActionEvent e) {
|
||||||
sb.append(' ');
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}
|
}));
|
||||||
JOptionPane.showMessageDialog(this,
|
|
||||||
sb.toString(),
|
menu.add(new JMenuItem(new AbstractAction("Exit with code 100 and restart the application") {
|
||||||
"Info",
|
@Override
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
public void actionPerformed(ActionEvent e) {
|
||||||
}
|
System.exit(100);
|
||||||
|
}
|
||||||
public static void setLAF() {
|
}));
|
||||||
JFrame.setDefaultLookAndFeelDecorated(true);
|
|
||||||
Toolkit.getDefaultToolkit().setDynamicLayout(true);
|
JMenuBar mb = new JMenuBar();
|
||||||
System.setProperty("sun.awt.noerasebackground","true");
|
mb.setOpaque(true);
|
||||||
try {
|
mb.add(menu);
|
||||||
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
setJMenuBar(mb);
|
||||||
} catch (Exception e) {
|
}
|
||||||
System.err.println("Failed to set LookAndFeel");
|
|
||||||
}
|
private final void initializeTextArea(String[] args) {
|
||||||
}
|
JTextArea textArea = new JTextArea();
|
||||||
|
textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
|
||||||
public static void main(String[] args) {
|
textArea.setEditable(false);
|
||||||
setLAF();
|
|
||||||
new SimpleApp(args);
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
Except as contained in this notice, the name(s) of the above copyright holders
|
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
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization.
|
dealings in this Software without prior written authorization.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
26
launch4j/head_jni_BETA/LICENSE.txt
Normal file
26
launch4j/head_jni_BETA/LICENSE.txt
Normal 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.
|
||||||
BIN
launch4j/head_jni_BETA/head.o
Normal file
BIN
launch4j/head_jni_BETA/head.o
Normal file
Binary file not shown.
BIN
launch4j/head_jni_BETA/jniconsolehead.o
Normal file
BIN
launch4j/head_jni_BETA/jniconsolehead.o
Normal file
Binary file not shown.
BIN
launch4j/head_jni_BETA/jniguihead.o
Normal file
BIN
launch4j/head_jni_BETA/jniguihead.o
Normal file
Binary file not shown.
BIN
launch4j/head_jni_BETA/jnihead.o
Normal file
BIN
launch4j/head_jni_BETA/jnihead.o
Normal file
Binary file not shown.
@@ -1,26 +1,26 @@
|
|||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
Except as contained in this notice, the name(s) of the above copyright holders
|
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
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization.
|
dealings in this Software without prior written authorization.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
2
launch4j/head_src/consolehead/.gitignore
vendored
2
launch4j/head_src/consolehead/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
/consolehead.exe
|
|
||||||
/consolehead.layout
|
|
||||||
@@ -1,30 +1,28 @@
|
|||||||
# Project: consolehead
|
# Project: consolehead
|
||||||
# Makefile created by Dev-C++ 4.9.9.2
|
# Makefile created by Dev-C++ 5.7.1
|
||||||
|
|
||||||
CPP = g++.exe
|
CPP = g++.exe
|
||||||
CC = gcc.exe
|
CC = gcc.exe
|
||||||
WINDRES = windres.exe
|
WINDRES = windres.exe
|
||||||
RES =
|
OBJ = ../../head/consolehead.o ../../head/head.o
|
||||||
OBJ = ../../head/consolehead.o ../../head/head.o $(RES)
|
LINKOBJ = ../../head/consolehead.o ../../head/head.o
|
||||||
LINKOBJ = ../../head/consolehead.o ../../head/head.o $(RES)
|
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
|
||||||
LIBS = -L"C:/Dev-Cpp/lib" -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"
|
||||||
INCS = -I"C:/Dev-Cpp/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++"
|
||||||
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
|
||||||
BIN = consolehead.exe
|
CXXFLAGS = $(CXXINCS) -Os
|
||||||
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
|
CFLAGS = $(INCS) -Os
|
||||||
CFLAGS = $(INCS) -fexpensive-optimizations -O3
|
RM = rm.exe -f
|
||||||
RM = rm -f
|
|
||||||
|
|
||||||
.PHONY: all all-before all-after clean clean-custom
|
.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
|
clean: clean-custom
|
||||||
${RM} $(OBJ) $(BIN)
|
${RM} $(OBJ) $(BIN)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
# $(CC) $(LINKOBJ) -o "consolehead.exe" $(LIBS)
|
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
|
||||||
|
|
||||||
../../head/consolehead.o: consolehead.c
|
../../head/consolehead.o: consolehead.c
|
||||||
$(CC) -c consolehead.c -o ../../head/consolehead.o $(CFLAGS)
|
$(CC) -c consolehead.c -o ../../head/consolehead.o $(CFLAGS)
|
||||||
|
|||||||
@@ -1,97 +1,97 @@
|
|||||||
/*
|
/*
|
||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2007 Grzegorz Kowal
|
Copyright (c) 2004, 2007 Grzegorz Kowal
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
Except as contained in this notice, the name(s) of the above copyright holders
|
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
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization.
|
dealings in this Software without prior written authorization.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../resource.h"
|
#include "../resource.h"
|
||||||
#include "../head.h"
|
#include "../head.h"
|
||||||
|
|
||||||
extern FILE* hLog;
|
extern FILE* hLog;
|
||||||
|
|
||||||
BOOL restartOnCrash = FALSE;
|
BOOL restartOnCrash = FALSE;
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
setConsoleFlag();
|
setConsoleFlag();
|
||||||
LPTSTR cmdLine = GetCommandLine();
|
LPTSTR cmdLine = GetCommandLine();
|
||||||
|
|
||||||
if (*cmdLine == '"')
|
if (*cmdLine == '"')
|
||||||
{
|
{
|
||||||
if (*(cmdLine = strchr(cmdLine + 1, '"') + 1))
|
if (*(cmdLine = strchr(cmdLine + 1, '"') + 1))
|
||||||
{
|
{
|
||||||
cmdLine++;
|
cmdLine++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((cmdLine = strchr(cmdLine, ' ')) != NULL)
|
else if ((cmdLine = strchr(cmdLine, ' ')) != NULL)
|
||||||
{
|
{
|
||||||
cmdLine++;
|
cmdLine++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmdLine = "";
|
cmdLine = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = prepare(cmdLine);
|
int result = prepare(cmdLine, FALSE);
|
||||||
|
|
||||||
if (result == ERROR_ALREADY_EXISTS)
|
if (result == ERROR_ALREADY_EXISTS)
|
||||||
{
|
{
|
||||||
char errMsg[BIG_STR] = {0};
|
char errMsg[BIG_STR] = {0};
|
||||||
loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
|
loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
|
||||||
msgBox(errMsg);
|
msgBox(errMsg);
|
||||||
closeLogFile();
|
closeLogFile();
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != TRUE)
|
if (result != TRUE)
|
||||||
{
|
{
|
||||||
signalError();
|
signalError();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
restartOnCrash = loadBool(RESTART_ON_CRASH);
|
restartOnCrash = loadBool(RESTART_ON_CRASH);
|
||||||
DWORD dwExitCode;
|
DWORD dwExitCode;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
dwExitCode = 0;
|
dwExitCode = 0;
|
||||||
|
|
||||||
if (!execute(TRUE, &dwExitCode))
|
if (!execute(TRUE, &dwExitCode))
|
||||||
{
|
{
|
||||||
signalError();
|
signalError();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restartOnCrash && dwExitCode != 0)
|
if (restartOnCrash && dwExitCode != 0)
|
||||||
{
|
{
|
||||||
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
|
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
|
||||||
}
|
}
|
||||||
} while (restartOnCrash && dwExitCode != 0);
|
} while (restartOnCrash && dwExitCode != 0);
|
||||||
|
|
||||||
debug("Exit code:\t%d\n", dwExitCode);
|
debug("Exit code:\t%d\n", dwExitCode);
|
||||||
closeLogFile();
|
closeLogFile();
|
||||||
return (int) dwExitCode;
|
return (int) dwExitCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FileName=consolehead.dev
|
|||||||
Name=consolehead
|
Name=consolehead
|
||||||
UnitCount=4
|
UnitCount=4
|
||||||
Type=1
|
Type=1
|
||||||
Ver=1
|
Ver=2
|
||||||
ObjFiles=
|
ObjFiles=
|
||||||
Includes=
|
Includes=
|
||||||
Libs=
|
Libs=
|
||||||
@@ -22,12 +22,14 @@ OverrideOutputName=consolehead.exe
|
|||||||
HostApplication=
|
HostApplication=
|
||||||
Folders=
|
Folders=
|
||||||
CommandLine=
|
CommandLine=
|
||||||
UseCustomMakefile=1
|
UseCustomMakefile=0
|
||||||
CustomMakefile=Makefile.win
|
CustomMakefile=Makefile.win
|
||||||
IncludeVersionInfo=0
|
IncludeVersionInfo=0
|
||||||
SupportXPThemes=0
|
SupportXPThemes=0
|
||||||
CompilerSet=0
|
CompilerSet=0
|
||||||
CompilerSettings=0000000001001000000100
|
CompilerSettings=000000d000000000000001000
|
||||||
|
LogOutput=
|
||||||
|
LogOutputEnabled=0
|
||||||
|
|
||||||
[Unit1]
|
[Unit1]
|
||||||
FileName=consolehead.c
|
FileName=consolehead.c
|
||||||
@@ -47,7 +49,7 @@ Build=1
|
|||||||
LanguageID=1033
|
LanguageID=1033
|
||||||
CharsetID=1252
|
CharsetID=1252
|
||||||
CompanyName=
|
CompanyName=
|
||||||
FileVersion=
|
FileVersion=0.1.1.1
|
||||||
FileDescription=Developed using the Dev-C++ IDE
|
FileDescription=Developed using the Dev-C++ IDE
|
||||||
InternalName=
|
InternalName=
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
@@ -56,6 +58,7 @@ OriginalFilename=
|
|||||||
ProductName=
|
ProductName=
|
||||||
ProductVersion=
|
ProductVersion=
|
||||||
AutoIncBuildNr=0
|
AutoIncBuildNr=0
|
||||||
|
SyncProduct=0
|
||||||
|
|
||||||
[Unit2]
|
[Unit2]
|
||||||
FileName=..\resource.h
|
FileName=..\resource.h
|
||||||
|
|||||||
2
launch4j/head_src/guihead/.gitignore
vendored
2
launch4j/head_src/guihead/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
/guihead.exe
|
|
||||||
/guihead.layout
|
|
||||||
@@ -1,30 +1,28 @@
|
|||||||
# Project: guihead
|
# Project: guihead
|
||||||
# Makefile created by Dev-C++ 4.9.9.2
|
# Makefile created by Dev-C++ 5.7.1
|
||||||
|
|
||||||
CPP = g++.exe
|
CPP = g++.exe
|
||||||
CC = gcc.exe
|
CC = gcc.exe
|
||||||
WINDRES = windres.exe
|
WINDRES = windres.exe
|
||||||
RES =
|
OBJ = ../../head/guihead.o ../../head/head.o
|
||||||
OBJ = ../../head/guihead.o ../../head/head.o $(RES)
|
LINKOBJ = ../../head/guihead.o ../../head/head.o
|
||||||
LINKOBJ = ../../head/guihead.o ../../head/head.o $(RES)
|
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
|
||||||
LIBS = -L"C:/Dev-Cpp/lib" -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"
|
||||||
INCS = -I"C:/Dev-Cpp/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++"
|
||||||
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
|
||||||
BIN = guihead.exe
|
CXXFLAGS = $(CXXINCS) -Os
|
||||||
CXXFLAGS = $(CXXINCS) -fexpensive-optimizations -O3
|
CFLAGS = $(INCS) -Os
|
||||||
CFLAGS = $(INCS) -fexpensive-optimizations -O3
|
RM = rm.exe -f
|
||||||
RM = rm -f
|
|
||||||
|
|
||||||
.PHONY: all all-before all-after clean clean-custom
|
.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
|
clean: clean-custom
|
||||||
${RM} $(OBJ) $(BIN)
|
${RM} $(OBJ) $(BIN)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
# $(CC) $(LINKOBJ) -o "guihead.exe" $(LIBS)
|
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)
|
||||||
|
|
||||||
../../head/guihead.o: guihead.c
|
../../head/guihead.o: guihead.c
|
||||||
$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
|
$(CC) -c guihead.c -o ../../head/guihead.o $(CFLAGS)
|
||||||
|
|||||||
@@ -1,240 +1,241 @@
|
|||||||
/*
|
/*
|
||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2015 Grzegorz Kowal
|
Copyright (c) 2004, 2015 Grzegorz Kowal
|
||||||
Sylvain Mina (single instance patch)
|
Sylvain Mina (single instance patch)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
Except as contained in this notice, the name(s) of the above copyright holders
|
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
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization.
|
dealings in this Software without prior written authorization.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../resource.h"
|
#include "../resource.h"
|
||||||
#include "../head.h"
|
#include "../head.h"
|
||||||
#include "guihead.h"
|
#include "guihead.h"
|
||||||
|
|
||||||
extern FILE* hLog;
|
extern FILE* hLog;
|
||||||
extern PROCESS_INFORMATION processInformation;
|
extern PROCESS_INFORMATION processInformation;
|
||||||
|
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
DWORD dwExitCode = 0;
|
DWORD dwExitCode = 0;
|
||||||
BOOL stayAlive = FALSE;
|
BOOL stayAlive = FALSE;
|
||||||
BOOL splash = FALSE;
|
BOOL splash = FALSE;
|
||||||
BOOL splashTimeoutErr;
|
BOOL splashTimeoutErr;
|
||||||
BOOL waitForWindow;
|
BOOL waitForWindow;
|
||||||
BOOL restartOnCrash = FALSE;
|
BOOL restartOnCrash = FALSE;
|
||||||
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
|
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
|
||||||
|
|
||||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE hPrevInstance,
|
||||||
LPSTR lpCmdLine,
|
LPSTR lpCmdLine,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
int result = prepare(lpCmdLine);
|
int result = prepare(lpCmdLine, FALSE);
|
||||||
|
|
||||||
if (result == ERROR_ALREADY_EXISTS)
|
if (result == ERROR_ALREADY_EXISTS)
|
||||||
{
|
{
|
||||||
HWND handle = getInstanceWindow();
|
HWND handle = getInstanceWindow();
|
||||||
ShowWindow(handle, SW_SHOW);
|
ShowWindow(handle, SW_SHOW);
|
||||||
SetForegroundWindow(handle);
|
SetForegroundWindow(handle);
|
||||||
closeLogFile();
|
closeLogFile();
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != TRUE)
|
if (result != TRUE)
|
||||||
{
|
{
|
||||||
signalError();
|
signalError();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
splash = loadBool(SHOW_SPLASH)
|
splash = loadBool(SHOW_SPLASH)
|
||||||
&& strstr(lpCmdLine, "--l4j-no-splash") == NULL;
|
&& strstr(lpCmdLine, "--l4j-no-splash") == NULL;
|
||||||
restartOnCrash = loadBool(RESTART_ON_CRASH);
|
restartOnCrash = loadBool(RESTART_ON_CRASH);
|
||||||
|
|
||||||
// if we should restart on crash, we must also stay alive to check for crashes
|
// if we should restart on crash, we must also stay alive to check for crashes
|
||||||
stayAlive = restartOnCrash ||
|
stayAlive = restartOnCrash ||
|
||||||
(loadBool(GUI_HEADER_STAYS_ALIVE)
|
(loadBool(GUI_HEADER_STAYS_ALIVE)
|
||||||
&& strstr(lpCmdLine, "--l4j-dont-wait") == NULL);
|
&& strstr(lpCmdLine, "--l4j-dont-wait") == NULL);
|
||||||
|
|
||||||
if (splash || stayAlive)
|
if (splash || stayAlive)
|
||||||
{
|
{
|
||||||
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
|
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
|
||||||
WS_POPUP | SS_BITMAP,
|
WS_POPUP | SS_BITMAP,
|
||||||
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
|
||||||
if (splash)
|
if (splash)
|
||||||
{
|
{
|
||||||
char timeout[10] = {0};
|
char timeout[10] = {0};
|
||||||
if (loadString(SPLASH_TIMEOUT, timeout))
|
if (loadString(SPLASH_TIMEOUT, timeout))
|
||||||
{
|
{
|
||||||
splashTimeout = atoi(timeout);
|
splashTimeout = atoi(timeout);
|
||||||
if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT)
|
if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT)
|
||||||
{
|
{
|
||||||
splashTimeout = DEFAULT_SPLASH_TIMEOUT;
|
splashTimeout = DEFAULT_SPLASH_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
|
splashTimeout = splashTimeout * 1000; // to millis
|
||||||
&& strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
|
splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
|
||||||
waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
|
&& strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
|
||||||
HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
|
waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
|
||||||
MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
|
HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
|
||||||
IMAGE_BITMAP, // type of image
|
MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
|
||||||
0, // desired width
|
IMAGE_BITMAP, // type of image
|
||||||
0, // desired height
|
0, // desired width
|
||||||
LR_DEFAULTSIZE);
|
0, // desired height
|
||||||
if (hImage == NULL)
|
LR_DEFAULTSIZE);
|
||||||
{
|
if (hImage == NULL)
|
||||||
signalError();
|
{
|
||||||
return 1;
|
signalError();
|
||||||
}
|
return 1;
|
||||||
SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
|
}
|
||||||
RECT rect;
|
SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
|
||||||
GetWindowRect(hWnd, &rect);
|
RECT rect;
|
||||||
int x = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
GetWindowRect(hWnd, &rect);
|
||||||
int y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
int x = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
||||||
SetWindowPos(hWnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
|
int y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||||
ShowWindow(hWnd, nCmdShow);
|
SetWindowPos(hWnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
|
||||||
UpdateWindow (hWnd);
|
ShowWindow(hWnd, nCmdShow);
|
||||||
}
|
UpdateWindow (hWnd);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
do
|
|
||||||
{
|
do
|
||||||
if (splash || stayAlive)
|
{
|
||||||
{
|
if (splash || stayAlive)
|
||||||
if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc))
|
{
|
||||||
{
|
if (!SetTimer (hWnd, ID_TIMER, TIMER_PROC_INTERVAL, TimerProc))
|
||||||
signalError();
|
{
|
||||||
return 1;
|
signalError();
|
||||||
}
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!execute(FALSE, &dwExitCode))
|
|
||||||
{
|
if (!execute(FALSE, &dwExitCode))
|
||||||
signalError();
|
{
|
||||||
return 1;
|
signalError();
|
||||||
}
|
return 1;
|
||||||
|
}
|
||||||
if (!(splash || stayAlive))
|
|
||||||
{
|
if (!(splash || stayAlive))
|
||||||
debug("Exit code:\t0\n");
|
{
|
||||||
closeProcessHandles();
|
debug("Exit code:\t0\n");
|
||||||
closeLogFile();
|
closeProcessHandles();
|
||||||
return 0;
|
closeLogFile();
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
MSG msg;
|
|
||||||
while (GetMessage(&msg, NULL, 0, 0))
|
MSG msg;
|
||||||
{
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
TranslateMessage(&msg);
|
{
|
||||||
DispatchMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
}
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
if (restartOnCrash && dwExitCode != 0)
|
|
||||||
{
|
if (restartOnCrash && dwExitCode != 0)
|
||||||
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
|
{
|
||||||
}
|
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
|
||||||
|
}
|
||||||
closeProcessHandles();
|
|
||||||
} while (restartOnCrash && dwExitCode != 0);
|
closeProcessHandles();
|
||||||
|
} while (restartOnCrash && dwExitCode != 0);
|
||||||
debug("Exit code:\t%d\n", dwExitCode);
|
|
||||||
closeLogFile();
|
debug("Exit code:\t%d\n", dwExitCode);
|
||||||
return dwExitCode;
|
closeLogFile();
|
||||||
}
|
return dwExitCode;
|
||||||
|
}
|
||||||
HWND getInstanceWindow()
|
|
||||||
{
|
HWND getInstanceWindow()
|
||||||
char windowTitle[STR];
|
{
|
||||||
char instWindowTitle[STR] = {0};
|
char windowTitle[STR];
|
||||||
if (loadString(INSTANCE_WINDOW_TITLE, instWindowTitle))
|
char instWindowTitle[STR] = {0};
|
||||||
{
|
if (loadString(INSTANCE_WINDOW_TITLE, instWindowTitle))
|
||||||
HWND handle = FindWindowEx(NULL, NULL, NULL, NULL);
|
{
|
||||||
while (handle != NULL)
|
HWND handle = FindWindowEx(NULL, NULL, NULL, NULL);
|
||||||
{
|
while (handle != NULL)
|
||||||
GetWindowText(handle, windowTitle, STR - 1);
|
{
|
||||||
if (strstr(windowTitle, instWindowTitle) != NULL)
|
GetWindowText(handle, windowTitle, STR - 1);
|
||||||
{
|
if (strstr(windowTitle, instWindowTitle) != NULL)
|
||||||
return handle;
|
{
|
||||||
}
|
return handle;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
handle = FindWindowEx(NULL, handle, NULL, NULL);
|
{
|
||||||
}
|
handle = FindWindowEx(NULL, handle, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
}
|
||||||
}
|
return NULL;
|
||||||
|
}
|
||||||
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam)
|
|
||||||
{
|
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam)
|
||||||
DWORD processId;
|
{
|
||||||
GetWindowThreadProcessId(hwnd, &processId);
|
DWORD processId;
|
||||||
if (processInformation.dwProcessId == processId)
|
GetWindowThreadProcessId(hwnd, &processId);
|
||||||
{
|
if (processInformation.dwProcessId == processId)
|
||||||
LONG styles = GetWindowLong(hwnd, GWL_STYLE);
|
{
|
||||||
if ((styles & WS_VISIBLE) != 0)
|
LONG styles = GetWindowLong(hwnd, GWL_STYLE);
|
||||||
{
|
if ((styles & WS_VISIBLE) != 0)
|
||||||
splash = FALSE;
|
{
|
||||||
ShowWindow(hWnd, SW_HIDE);
|
splash = FALSE;
|
||||||
return FALSE;
|
ShowWindow(hWnd, SW_HIDE);
|
||||||
}
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
}
|
||||||
}
|
return TRUE;
|
||||||
|
}
|
||||||
VOID CALLBACK TimerProc(
|
|
||||||
HWND hwnd, // handle of window for timer messages
|
VOID CALLBACK TimerProc(
|
||||||
UINT uMsg, // WM_TIMER message
|
HWND hwnd, // handle of window for timer messages
|
||||||
UINT idEvent, // timer identifier
|
UINT uMsg, // WM_TIMER message
|
||||||
DWORD dwTime) // current system time
|
UINT idEvent, // timer identifier
|
||||||
{
|
DWORD dwTime) // current system time
|
||||||
if (splash)
|
{
|
||||||
{
|
if (splash)
|
||||||
if (splashTimeout == 0)
|
{
|
||||||
{
|
if (splashTimeout == 0)
|
||||||
splash = FALSE;
|
{
|
||||||
ShowWindow(hWnd, SW_HIDE);
|
splash = FALSE;
|
||||||
if (waitForWindow && splashTimeoutErr)
|
ShowWindow(hWnd, SW_HIDE);
|
||||||
{
|
if (waitForWindow && splashTimeoutErr)
|
||||||
KillTimer(hwnd, ID_TIMER);
|
{
|
||||||
signalError();
|
KillTimer(hwnd, ID_TIMER);
|
||||||
PostQuitMessage(0);
|
signalError();
|
||||||
}
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
splashTimeout--;
|
{
|
||||||
if (waitForWindow)
|
splashTimeout -= TIMER_PROC_INTERVAL;
|
||||||
{
|
if (waitForWindow)
|
||||||
EnumWindows(enumwndfn, 0);
|
{
|
||||||
}
|
EnumWindows(enumwndfn, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
GetExitCodeProcess(processInformation.hProcess, &dwExitCode);
|
|
||||||
if (dwExitCode != STILL_ACTIVE
|
GetExitCodeProcess(processInformation.hProcess, &dwExitCode);
|
||||||
|| !(splash || stayAlive))
|
if (dwExitCode != STILL_ACTIVE
|
||||||
{
|
|| !(splash || stayAlive))
|
||||||
KillTimer(hWnd, ID_TIMER);
|
{
|
||||||
PostQuitMessage(0);
|
KillTimer(hWnd, ID_TIMER);
|
||||||
}
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FileName=guihead.dev
|
|||||||
Name=guihead
|
Name=guihead
|
||||||
UnitCount=5
|
UnitCount=5
|
||||||
Type=0
|
Type=0
|
||||||
Ver=1
|
Ver=2
|
||||||
ObjFiles=
|
ObjFiles=
|
||||||
Includes=
|
Includes=
|
||||||
Libs=
|
Libs=
|
||||||
@@ -22,12 +22,14 @@ OverrideOutputName=guihead.exe
|
|||||||
HostApplication=
|
HostApplication=
|
||||||
Folders=
|
Folders=
|
||||||
CommandLine=
|
CommandLine=
|
||||||
UseCustomMakefile=1
|
UseCustomMakefile=0
|
||||||
CustomMakefile=Makefile.win
|
CustomMakefile=Makefile.win
|
||||||
IncludeVersionInfo=0
|
IncludeVersionInfo=0
|
||||||
SupportXPThemes=0
|
SupportXPThemes=0
|
||||||
CompilerSet=0
|
CompilerSet=0
|
||||||
CompilerSettings=0000000001001000000100
|
CompilerSettings=000000d000000000000001000
|
||||||
|
LogOutput=
|
||||||
|
LogOutputEnabled=0
|
||||||
|
|
||||||
[Unit1]
|
[Unit1]
|
||||||
FileName=guihead.c
|
FileName=guihead.c
|
||||||
@@ -66,6 +68,7 @@ OriginalFilename=
|
|||||||
ProductName=
|
ProductName=
|
||||||
ProductVersion=
|
ProductVersion=
|
||||||
AutoIncBuildNr=0
|
AutoIncBuildNr=0
|
||||||
|
SyncProduct=0
|
||||||
|
|
||||||
[Unit4]
|
[Unit4]
|
||||||
FileName=..\head.h
|
FileName=..\head.h
|
||||||
@@ -95,7 +98,7 @@ Compile=1
|
|||||||
Link=1
|
Link=1
|
||||||
Priority=1000
|
Priority=1000
|
||||||
OverrideBuildCmd=0
|
OverrideBuildCmd=0
|
||||||
BuildCmd=
|
BuildCmd=$(CC) -c head.c -o ../../head/head.o $(CFLAGS)
|
||||||
|
|
||||||
[Unit5]
|
[Unit5]
|
||||||
FileName=..\resource.h
|
FileName=..\resource.h
|
||||||
|
|||||||
@@ -1,43 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2007 Grzegorz Kowal
|
Copyright (c) 2004, 2007 Grzegorz Kowal
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
Except as contained in this notice, the name(s) of the above copyright holders
|
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
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization.
|
dealings in this Software without prior written authorization.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define ID_TIMER 1
|
#define ID_TIMER 1
|
||||||
#define DEFAULT_SPLASH_TIMEOUT 60 /* 60 seconds */
|
#define DEFAULT_SPLASH_TIMEOUT 60 /* 60 seconds */
|
||||||
#define MAX_SPLASH_TIMEOUT 60 * 15 /* 15 minutes */
|
#define MAX_SPLASH_TIMEOUT 60 * 15 /* 15 minutes */
|
||||||
|
#define TIMER_PROC_INTERVAL 100 /* interval in ms between calls to EnumWindows */
|
||||||
HWND getInstanceWindow();
|
|
||||||
|
HWND getInstanceWindow();
|
||||||
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam);
|
|
||||||
|
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam);
|
||||||
VOID CALLBACK TimerProc(
|
|
||||||
HWND hwnd, // handle of window for timer messages
|
VOID CALLBACK TimerProc(
|
||||||
UINT uMsg, // WM_TIMER message
|
HWND hwnd, // handle of window for timer messages
|
||||||
UINT idEvent, // timer identifier
|
UINT uMsg, // WM_TIMER message
|
||||||
DWORD dwTime // current system time
|
UINT idEvent, // timer identifier
|
||||||
);
|
DWORD dwTime // current system time
|
||||||
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
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)
|
Ian Roberts (jdk preference patch)
|
||||||
Sylvain Mina (single instance patch)
|
Sylvain Mina (single instance patch)
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ FILE* hLog;
|
|||||||
BOOL debugAll = FALSE;
|
BOOL debugAll = FALSE;
|
||||||
BOOL console = FALSE;
|
BOOL console = FALSE;
|
||||||
BOOL wow64 = FALSE;
|
BOOL wow64 = FALSE;
|
||||||
|
BOOL jniHeader = FALSE;
|
||||||
char oldPwd[_MAX_PATH];
|
char oldPwd[_MAX_PATH];
|
||||||
|
|
||||||
PROCESS_INFORMATION processInformation;
|
PROCESS_INFORMATION processInformation;
|
||||||
@@ -51,25 +52,28 @@ struct
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int runtimeBits;
|
|
||||||
int foundJava;
|
int foundJava;
|
||||||
BOOL bundledJreAsFallback;
|
BOOL requiresJdk;
|
||||||
|
BOOL requires64Bit;
|
||||||
BOOL corruptedJreFound;
|
BOOL corruptedJreFound;
|
||||||
|
char originalJavaMinVer[STR];
|
||||||
|
char originalJavaMaxVer[STR];
|
||||||
char javaMinVer[STR];
|
char javaMinVer[STR];
|
||||||
char javaMaxVer[STR];
|
char javaMaxVer[STR];
|
||||||
char foundJavaVer[STR];
|
char foundJavaVer[STR];
|
||||||
char foundJavaKey[_MAX_PATH];
|
|
||||||
char foundJavaHome[_MAX_PATH];
|
char foundJavaHome[_MAX_PATH];
|
||||||
} search;
|
} search;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
char mainClass[_MAX_PATH];
|
||||||
char cmd[_MAX_PATH];
|
char cmd[_MAX_PATH];
|
||||||
char args[MAX_ARGS];
|
char args[MAX_ARGS];
|
||||||
} launcher;
|
} launcher;
|
||||||
|
|
||||||
BOOL initGlobals()
|
BOOL initGlobals(BOOL jni)
|
||||||
{
|
{
|
||||||
|
jniHeader = jni;
|
||||||
hModule = GetModuleHandle(NULL);
|
hModule = GetModuleHandle(NULL);
|
||||||
|
|
||||||
if (hModule == NULL)
|
if (hModule == NULL)
|
||||||
@@ -79,9 +83,9 @@ BOOL initGlobals()
|
|||||||
|
|
||||||
strcpy(error.title, LAUNCH4j);
|
strcpy(error.title, LAUNCH4j);
|
||||||
|
|
||||||
search.runtimeBits = INIT_RUNTIME_BITS;
|
search.foundJava = JAVA_NOT_FOUND;
|
||||||
search.foundJava = NO_JAVA_FOUND;
|
search.requiresJdk = FALSE;
|
||||||
search.bundledJreAsFallback = FALSE;
|
search.requires64Bit = FALSE;
|
||||||
search.corruptedJreFound = FALSE;
|
search.corruptedJreFound = FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -138,7 +142,7 @@ void setWow64Flag()
|
|||||||
fnIsWow64Process(GetCurrentProcess(), &wow64);
|
fnIsWow64Process(GetCurrentProcess(), &wow64);
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("WOW64:\t\t%s\n", wow64 ? "yes" : "no");
|
debug("WOW64:\t\t%s\n", wow64 ? "Yes" : "No");
|
||||||
}
|
}
|
||||||
|
|
||||||
void setConsoleFlag()
|
void setConsoleFlag()
|
||||||
@@ -150,7 +154,14 @@ void msgBox(const char* text)
|
|||||||
{
|
{
|
||||||
if (console)
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -197,6 +208,7 @@ BOOL loadString(const int resID, char* buffer)
|
|||||||
HRSRC hResource;
|
HRSRC hResource;
|
||||||
HGLOBAL hResourceLoaded;
|
HGLOBAL hResourceLoaded;
|
||||||
LPBYTE lpBuffer;
|
LPBYTE lpBuffer;
|
||||||
|
debugAll("Resource %d:\t", resID);
|
||||||
|
|
||||||
hResource = FindResourceEx(hModule, RT_RCDATA, MAKEINTRESOURCE(resID),
|
hResource = FindResourceEx(hModule, RT_RCDATA, MAKEINTRESOURCE(resID),
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT));
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT));
|
||||||
@@ -214,10 +226,7 @@ BOOL loadString(const int resID, char* buffer)
|
|||||||
buffer[x] = (char) lpBuffer[x];
|
buffer[x] = (char) lpBuffer[x];
|
||||||
} while (buffer[x++] != 0);
|
} while (buffer[x++] != 0);
|
||||||
|
|
||||||
if (debugAll)
|
debugAll("%s\n", buffer);
|
||||||
{
|
|
||||||
debug("Resource %d:\t%s\n", resID, buffer);
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,6 +236,8 @@ BOOL loadString(const int resID, char* buffer)
|
|||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debugAll("<NULL>\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,6 +313,120 @@ BOOL regQueryValue(const char* regPath, unsigned char* buffer,
|
|||||||
return result;
|
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)
|
void regSearch(const char* keyName, const int searchType)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
@@ -322,12 +447,13 @@ void regSearch(const char* keyName, const int searchType)
|
|||||||
unsigned long versionSize = _MAX_PATH;
|
unsigned long versionSize = _MAX_PATH;
|
||||||
FILETIME time;
|
FILETIME time;
|
||||||
char fullKeyName[_MAX_PATH] = {0};
|
char fullKeyName[_MAX_PATH] = {0};
|
||||||
|
char originalVersion[_MAX_PATH] = {0};
|
||||||
char version[_MAX_PATH] = {0};
|
char version[_MAX_PATH] = {0};
|
||||||
|
|
||||||
while (RegEnumKeyEx(
|
while (RegEnumKeyEx(
|
||||||
hKey, // handle to key to enumerate
|
hKey, // handle to key to enumerate
|
||||||
x++, // index of subkey 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
|
&versionSize, // address for size of subkey buffer
|
||||||
NULL, // reserved
|
NULL, // reserved
|
||||||
NULL, // address of buffer for class string
|
NULL, // address of buffer for class string
|
||||||
@@ -335,31 +461,27 @@ void regSearch(const char* keyName, const int searchType)
|
|||||||
&time) == ERROR_SUCCESS)
|
&time) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
strcpy(fullKeyName, keyName);
|
strcpy(fullKeyName, keyName);
|
||||||
appendPath(fullKeyName, version);
|
appendPath(fullKeyName, originalVersion);
|
||||||
debug("Check:\t\t%s\n", fullKeyName);
|
debug("Check:\t\t%s\n", fullKeyName);
|
||||||
|
formatJavaVersion(version, originalVersion);
|
||||||
|
|
||||||
if (strcmp(version, search.javaMinVer) >= 0
|
if (isJavaVersionGood(version, wow64KeyMask)
|
||||||
&& (!*search.javaMaxVer || strcmp(version, search.javaMaxVer) <= 0)
|
&& isRegistryJavaHomeValid(fullKeyName, searchType))
|
||||||
&& strcmp(version, search.foundJavaVer) > 0
|
|
||||||
&& isJavaHomeValid(fullKeyName, searchType))
|
|
||||||
{
|
{
|
||||||
strcpy(search.foundJavaVer, version);
|
strcpy(search.foundJavaVer, version);
|
||||||
strcpy(search.foundJavaKey, fullKeyName);
|
|
||||||
search.foundJava = searchType;
|
search.foundJava = searchType;
|
||||||
debug("Match:\t\t%s\n", version);
|
debug("Match:\t\t%s\n", version);
|
||||||
}
|
break;
|
||||||
else
|
|
||||||
{
|
|
||||||
debug("Ignore:\t\t%s\n", version);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug("Ignore:\t\t%s\n", version);
|
||||||
versionSize = _MAX_PATH;
|
versionSize = _MAX_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL isJavaHomeValid(const char* keyName, const int searchType)
|
BOOL isRegistryJavaHomeValid(const char* keyName, const int searchType)
|
||||||
{
|
{
|
||||||
BOOL valid = FALSE;
|
BOOL valid = FALSE;
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
@@ -384,10 +506,6 @@ BOOL isJavaHomeValid(const char* keyName, const int searchType)
|
|||||||
path[i] = buffer[i];
|
path[i] = buffer[i];
|
||||||
} while (path[i++] != 0);
|
} while (path[i++] != 0);
|
||||||
|
|
||||||
if (searchType & FOUND_SDK)
|
|
||||||
{
|
|
||||||
appendPath(path, "jre");
|
|
||||||
}
|
|
||||||
valid = isLauncherPathValid(path);
|
valid = isLauncherPathValid(path);
|
||||||
}
|
}
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
@@ -409,6 +527,7 @@ BOOL isLauncherPathValid(const char* path)
|
|||||||
{
|
{
|
||||||
struct _stat statBuf;
|
struct _stat statBuf;
|
||||||
char launcherPath[_MAX_PATH] = {0};
|
char launcherPath[_MAX_PATH] = {0};
|
||||||
|
char javacPath[_MAX_PATH] = {0};
|
||||||
BOOL result = FALSE;
|
BOOL result = FALSE;
|
||||||
|
|
||||||
if (*path)
|
if (*path)
|
||||||
@@ -416,6 +535,15 @@ BOOL isLauncherPathValid(const char* path)
|
|||||||
strcpy(launcherPath, path);
|
strcpy(launcherPath, path);
|
||||||
appendLauncher(launcherPath);
|
appendLauncher(launcherPath);
|
||||||
result = _stat(launcherPath, &statBuf) == 0;
|
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)
|
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;
|
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:
|
regSearch(keyName, JAVA_FOUND | KEY_WOW64_64KEY);
|
||||||
if (wow64)
|
|
||||||
{
|
|
||||||
regSearch(keyName, searchType | KEY_WOW64_64KEY);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USE_64_AND_32_BIT_RUNTIME:
|
|
||||||
if (wow64)
|
|
||||||
{
|
|
||||||
regSearch(keyName, searchType | KEY_WOW64_64KEY);
|
|
||||||
|
|
||||||
if ((search.foundJava & KEY_WOW64_64KEY) != NO_JAVA_FOUND)
|
if ((search.foundJava & KEY_WOW64_64KEY) != JAVA_NOT_FOUND)
|
||||||
{
|
{
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
regSearch(keyName, searchType);
|
if (!search.requires64Bit)
|
||||||
break;
|
{
|
||||||
|
regSearch(keyName, JAVA_FOUND);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void regSearchJreSdk(const char* jreKeyName, const char* sdkKeyName,
|
BOOL findRegistryJavaHome(char* path)
|
||||||
const int jdkPreference)
|
|
||||||
{
|
{
|
||||||
if (jdkPreference == JDK_ONLY || jdkPreference == PREFER_JDK)
|
debugAll("findRegistryJavaHome()\n");
|
||||||
{
|
if (!search.requiresJdk)
|
||||||
regSearchWow(sdkKeyName, FOUND_SDK);
|
{
|
||||||
if (jdkPreference != JDK_ONLY)
|
regSearchWow("SOFTWARE\\JavaSoft\\Java Runtime Environment");
|
||||||
{
|
|
||||||
regSearchWow(jreKeyName, FOUND_JRE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
regSearchWow("SOFTWARE\\JavaSoft\\Java Development Kit");
|
||||||
{
|
|
||||||
// jdkPreference == JRE_ONLY or PREFER_JRE
|
// Java 9 support
|
||||||
regSearchWow(jreKeyName, FOUND_JRE);
|
if (!search.requiresJdk)
|
||||||
if (jdkPreference != JRE_ONLY)
|
{
|
||||||
{
|
regSearchWow("SOFTWARE\\JavaSoft\\JRE");
|
||||||
regSearchWow(sdkKeyName, FOUND_SDK);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
regSearchWow("SOFTWARE\\JavaSoft\\JDK");
|
||||||
|
|
||||||
BOOL findJavaHome(char* path, const int jdkPreference)
|
// IBM Java 1.8
|
||||||
{
|
if (search.foundJava == JAVA_NOT_FOUND)
|
||||||
regSearchJreSdk("SOFTWARE\\JavaSoft\\Java Runtime Environment",
|
|
||||||
"SOFTWARE\\JavaSoft\\Java Development Kit",
|
|
||||||
jdkPreference);
|
|
||||||
|
|
||||||
if (search.foundJava == NO_JAVA_FOUND)
|
|
||||||
{
|
{
|
||||||
regSearchJreSdk("SOFTWARE\\IBM\\Java2 Runtime Environment",
|
if (!search.requiresJdk)
|
||||||
"SOFTWARE\\IBM\\Java Development Kit",
|
{
|
||||||
jdkPreference);
|
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);
|
strcpy(path, search.foundJavaHome);
|
||||||
debug("Runtime used:\t%s (%s-bit)\n", search.foundJavaVer,
|
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;
|
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)
|
else if (strstr(varName, HKEY_STR) == varName)
|
||||||
{
|
{
|
||||||
regQueryValue(varName, dst + strlen(dst), BIG_STR);
|
regQueryValue(varName, dst + strlen(dst), BIG_STR);
|
||||||
|
}
|
||||||
|
else if (strcmp(varName, "") == 0)
|
||||||
|
{
|
||||||
|
strcat(dst, "%");
|
||||||
}
|
}
|
||||||
else if (GetEnvironmentVariable(varName, varValue, MAX_VAR_SIZE) > 0)
|
else if (GetEnvironmentVariable(varName, varValue, MAX_VAR_SIZE) > 0)
|
||||||
{
|
{
|
||||||
@@ -733,6 +837,7 @@ BOOL createMutex()
|
|||||||
|
|
||||||
if (*mutexName)
|
if (*mutexName)
|
||||||
{
|
{
|
||||||
|
debug("Create mutex:\t%s\n", mutexName);
|
||||||
SECURITY_ATTRIBUTES security;
|
SECURITY_ATTRIBUTES security;
|
||||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
security.bInheritHandle = TRUE;
|
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};
|
char jrePath[MAX_ARGS] = {0};
|
||||||
expandVars(jrePath, tmpPath, exePath, pathLen);
|
expandVars(jrePath, jrePathSpec, exePath, pathLen);
|
||||||
debug("Bundled JRE:\t%s\n", jrePath);
|
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] == ':')
|
if (lastBackslash != NULL && strcasecmp(lastBackslash, "\\bin") == 0)
|
||||||
{
|
{
|
||||||
// Absolute
|
strncpy(pathNoBin, path, lastBackslash - path);
|
||||||
strcpy(launcher.cmd, jrePath);
|
}
|
||||||
}
|
else if (lastSlash != NULL && strcasecmp(lastSlash, "/bin") == 0)
|
||||||
else
|
{
|
||||||
{
|
strncpy(pathNoBin, path, lastSlash - path);
|
||||||
// Relative
|
}
|
||||||
strncpy(launcher.cmd, exePath, pathLen);
|
else
|
||||||
appendPath(launcher.cmd, jrePath);
|
{
|
||||||
}
|
strcpy(pathNoBin, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
removeChar(pathNoBin, '"');
|
||||||
|
|
||||||
if (isLauncherPathValid(launcher.cmd))
|
if (*pathNoBin == '\\' || (*pathNoBin != '\0' && *(pathNoBin + 1) == ':'))
|
||||||
{
|
{
|
||||||
search.foundJava = (wow64 && loadBool(BUNDLED_JRE_64_BIT))
|
// Absolute
|
||||||
? FOUND_BUNDLED | KEY_WOW64_64KEY
|
strcpy(launcher.cmd, pathNoBin);
|
||||||
: FOUND_BUNDLED;
|
}
|
||||||
strcpy(search.foundJavaHome, launcher.cmd);
|
else
|
||||||
return TRUE;
|
{
|
||||||
}
|
// 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;
|
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()
|
void createJreSearchError()
|
||||||
@@ -811,20 +962,17 @@ void createJreSearchError()
|
|||||||
{
|
{
|
||||||
loadString(JRE_VERSION_ERR, error.msg);
|
loadString(JRE_VERSION_ERR, error.msg);
|
||||||
strcat(error.msg, " ");
|
strcat(error.msg, " ");
|
||||||
strcat(error.msg, search.javaMinVer);
|
strcat(error.msg, search.originalJavaMinVer);
|
||||||
|
|
||||||
if (*search.javaMaxVer)
|
if (*search.javaMaxVer)
|
||||||
{
|
{
|
||||||
strcat(error.msg, " - ");
|
strcat(error.msg, " - ");
|
||||||
strcat(error.msg, search.javaMaxVer);
|
strcat(error.msg, search.originalJavaMaxVer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (search.runtimeBits == USE_64_BIT_RUNTIME
|
if (search.requires64Bit)
|
||||||
|| search.runtimeBits == USE_32_BIT_RUNTIME)
|
|
||||||
{
|
{
|
||||||
strcat(error.msg, " (");
|
strcat(error.msg, " (64-bit)");
|
||||||
strcat(error.msg, search.runtimeBits == USE_64_BIT_RUNTIME ? "64" : "32");
|
|
||||||
strcat(error.msg, "-bit)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (search.corruptedJreFound)
|
if (search.corruptedJreFound)
|
||||||
@@ -842,33 +990,31 @@ void createJreSearchError()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
loadString(BUNDLED_JRE_ERR, error.msg);
|
loadString(JRE_NOT_FOUND_ERR, error.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL jreSearch(const char *exePath, const int pathLen)
|
BOOL jreSearch(const char *exePath, const int pathLen)
|
||||||
{
|
{
|
||||||
|
debugAll("jreSearch()\n");
|
||||||
BOOL result = TRUE;
|
BOOL result = TRUE;
|
||||||
|
|
||||||
search.bundledJreAsFallback = loadBool(BUNDLED_JRE_AS_FALLBACK);
|
search.requiresJdk = loadBool(REQUIRES_JDK);
|
||||||
loadString(JAVA_MIN_VER, search.javaMinVer);
|
debug("Requires JDK:\t%s\n", search.requiresJdk ? "Yes" : "No");
|
||||||
loadString(JAVA_MAX_VER, search.javaMaxVer);
|
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 = registryJreSearch();
|
||||||
{
|
|
||||||
result = bundledJreSearch(exePath, pathLen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!bundledJreSearch(exePath, pathLen))
|
|
||||||
{
|
|
||||||
result = installedJreSearch();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
createJreSearchError();
|
createJreSearchError();
|
||||||
@@ -934,14 +1080,15 @@ void setMainClassAndClassPath(const char *exePath, const int pathLen)
|
|||||||
{
|
{
|
||||||
char classPath[MAX_ARGS] = {0};
|
char classPath[MAX_ARGS] = {0};
|
||||||
char expandedClassPath[MAX_ARGS] = {0};
|
char expandedClassPath[MAX_ARGS] = {0};
|
||||||
char mainClass[STR] = {0};
|
|
||||||
char jar[_MAX_PATH] = {0};
|
char jar[_MAX_PATH] = {0};
|
||||||
char fullFileName[_MAX_PATH] = {0};
|
char fullFileName[_MAX_PATH] = {0};
|
||||||
const BOOL wrapper = loadBool(WRAPPER);
|
const BOOL wrapper = loadBool(WRAPPER);
|
||||||
loadString(JAR, jar);
|
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))
|
if (!loadString(CLASSPATH, classPath))
|
||||||
{
|
{
|
||||||
debug("Info:\t\tClasspath not defined.\n");
|
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;
|
*(launcher.args + strlen(launcher.args) - 1) = 0;
|
||||||
strcat(launcher.args, "\" ");
|
strcat(launcher.args, "\" ");
|
||||||
strcat(launcher.args, mainClass);
|
strcat(launcher.args, launcher.mainClass);
|
||||||
}
|
}
|
||||||
else if (wrapper)
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1071,6 +1218,7 @@ int prepare(const char *lpCmdLine)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug("JNI:\t\t%s\n", jniHeader ? "Yes" : "No");
|
||||||
setWow64Flag();
|
setWow64Flag();
|
||||||
|
|
||||||
// Set default error message, title and optional support web site url.
|
// Set default error message, title and optional support web site url.
|
||||||
@@ -1158,3 +1306,147 @@ BOOL execute(const BOOL wait, DWORD *dwExitCode)
|
|||||||
*dwExitCode = -1;
|
*dwExitCode = -1;
|
||||||
return FALSE;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,10 +28,13 @@
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x0501
|
||||||
|
#endif // _WIN32_WINNT
|
||||||
|
|
||||||
#ifndef _LAUNCH4J_HEAD__INCLUDED_
|
#ifndef _LAUNCH4J_HEAD__INCLUDED_
|
||||||
#define _LAUNCH4J_HEAD__INCLUDED_
|
#define _LAUNCH4J_HEAD__INCLUDED_
|
||||||
|
|
||||||
#define _WIN32_WINNT 0x0501
|
|
||||||
#define WIN32_LEAN_AND_MEAN // VC - Exclude rarely-used stuff from Windows headers
|
#define WIN32_LEAN_AND_MEAN // VC - Exclude rarely-used stuff from Windows headers
|
||||||
|
|
||||||
// Windows Header Files:
|
// Windows Header Files:
|
||||||
@@ -51,23 +54,12 @@
|
|||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|
||||||
#define LAUNCH4j "Launch4j"
|
#define LAUNCH4j "Launch4j"
|
||||||
#define VERSION "3.7"
|
#define VERSION "3.50"
|
||||||
|
|
||||||
#define NO_JAVA_FOUND 0
|
#define JRE_VER_MAX_DIGITS_PER_PART 3
|
||||||
#define FOUND_JRE 1
|
|
||||||
#define FOUND_SDK 2
|
|
||||||
#define FOUND_BUNDLED 4
|
|
||||||
|
|
||||||
#define JRE_ONLY 0
|
#define JAVA_NOT_FOUND 0
|
||||||
#define PREFER_JRE 1
|
#define JAVA_FOUND 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 KEY_WOW64_64KEY 0x0100
|
#define KEY_WOW64_64KEY 0x0100
|
||||||
|
|
||||||
@@ -88,10 +80,11 @@
|
|||||||
|
|
||||||
#define ERROR_FORMAT "Error:\t\t%s\n"
|
#define ERROR_FORMAT "Error:\t\t%s\n"
|
||||||
#define debug(args...) if (hLog != NULL) fprintf(hLog, ## args);
|
#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);
|
typedef void (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
|
||||||
|
|
||||||
BOOL initGlobals();
|
BOOL initGlobals(BOOL jni);
|
||||||
FILE* openLogFile(const char* exePath, const int pathLen);
|
FILE* openLogFile(const char* exePath, const int pathLen);
|
||||||
void closeLogFile();
|
void closeLogFile();
|
||||||
BOOL initializeLogging(const char *lpCmdLine, const char* exePath, const int pathLen);
|
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);
|
int loadInt(const int resID);
|
||||||
BOOL regQueryValue(const char* regPath, unsigned char* buffer,
|
BOOL regQueryValue(const char* regPath, unsigned char* buffer,
|
||||||
unsigned long bufferLength);
|
unsigned long bufferLength);
|
||||||
|
void formatJavaVersion(char* version, const char* originalVersion);
|
||||||
void regSearch(const char* keyName, const int searchType);
|
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);
|
BOOL isLauncherPathValid(const char* path);
|
||||||
void regSearchWow(const char* keyName, const int searchType);
|
void regSearchWow(const char* keyName);
|
||||||
void regSearchJreSdk(const char* jreKeyName, const char* sdkKeyName,
|
BOOL findRegistryJavaHome(char* path);
|
||||||
const int jdkPreference);
|
|
||||||
BOOL findJavaHome(char* path, const int jdkPreference);
|
|
||||||
int getExePath(char* exePath);
|
int getExePath(char* exePath);
|
||||||
void appendPath(char* basepath, const char* path);
|
void appendPath(char* basepath, const char* path);
|
||||||
void appendLauncher(char* jrePath);
|
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);
|
void setJvmOptions(char *jvmOptions, const char *exePath);
|
||||||
BOOL createMutex();
|
BOOL createMutex();
|
||||||
void setWorkingDirectory(const char *exePath, const int pathLen);
|
void setWorkingDirectory(const char *exePath, const int pathLen);
|
||||||
BOOL bundledJreSearch(const char *exePath, const int pathLen);
|
void removeChar(char *src, const char toRemove);
|
||||||
BOOL installedJreSearch();
|
BOOL pathJreSearch(const char *exePath, const int pathLen);
|
||||||
|
BOOL registryJreSearch();
|
||||||
void createJreSearchError();
|
void createJreSearchError();
|
||||||
BOOL jreSearch(const char *exePath, const int pathLen);
|
BOOL jreSearch(const char *exePath, const int pathLen);
|
||||||
BOOL appendToPathVar(const char* path);
|
BOOL appendToPathVar(const char* path);
|
||||||
@@ -129,8 +122,15 @@ BOOL appendJreBinToPathVar();
|
|||||||
void setEnvironmentVariables(const char *exePath, const int pathLen);
|
void setEnvironmentVariables(const char *exePath, const int pathLen);
|
||||||
void setMainClassAndClassPath(const char *exePath, const int pathLen);
|
void setMainClassAndClassPath(const char *exePath, const int pathLen);
|
||||||
void setCommandLineArgs(const char *lpCmdLine);
|
void setCommandLineArgs(const char *lpCmdLine);
|
||||||
int prepare(const char *lpCmdLine);
|
int prepare(const char *lpCmdLine, BOOL jni);
|
||||||
void closeProcessHandles();
|
void closeProcessHandles();
|
||||||
BOOL execute(const BOOL wait, DWORD *dwExitCode);
|
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_
|
#endif // _LAUNCH4J_HEAD__INCLUDED_
|
||||||
|
|||||||
34
launch4j/head_src/jniconsolehead_BETA/Makefile.win
Normal file
34
launch4j/head_src/jniconsolehead_BETA/Makefile.win
Normal 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)
|
||||||
99
launch4j/head_src/jniconsolehead_BETA/jniconsolehead.c
Normal file
99
launch4j/head_src/jniconsolehead_BETA/jniconsolehead.c
Normal 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;
|
||||||
|
}
|
||||||
112
launch4j/head_src/jniconsolehead_BETA/jniconsolehead.dev
Normal file
112
launch4j/head_src/jniconsolehead_BETA/jniconsolehead.dev
Normal 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=
|
||||||
|
|
||||||
34
launch4j/head_src/jniguihead_BETA/Makefile.win
Normal file
34
launch4j/head_src/jniguihead_BETA/Makefile.win
Normal 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)
|
||||||
244
launch4j/head_src/jniguihead_BETA/jniguihead.c
Normal file
244
launch4j/head_src/jniguihead_BETA/jniguihead.c
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
122
launch4j/head_src/jniguihead_BETA/jniguihead.dev
Normal file
122
launch4j/head_src/jniguihead_BETA/jniguihead.dev
Normal 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=
|
||||||
|
|
||||||
43
launch4j/head_src/jniguihead_BETA/jniguihead.h
Normal file
43
launch4j/head_src/jniguihead_BETA/jniguihead.h
Normal 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
284
launch4j/head_src/jnihead.c
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
41
launch4j/head_src/jnihead.h
Normal file
41
launch4j/head_src/jnihead.h
Normal 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);
|
||||||
|
|
||||||
13
launch4j/head_src/makefile
Normal file
13
launch4j/head_src/makefile
Normal 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
|
||||||
@@ -1,75 +1,72 @@
|
|||||||
/*
|
/*
|
||||||
Launch4j (http://launch4j.sourceforge.net/)
|
Launch4j (http://launch4j.sourceforge.net/)
|
||||||
Cross-platform Java application wrapper for creating Windows native executables.
|
Cross-platform Java application wrapper for creating Windows native executables.
|
||||||
|
|
||||||
Copyright (c) 2004, 2014 Grzegorz Kowal
|
Copyright (c) 2004, 2014 Grzegorz Kowal
|
||||||
Ian Roberts (jdk preference patch)
|
Ian Roberts (jdk preference patch)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
Except as contained in this notice, the name(s) of the above copyright holders
|
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
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
||||||
dealings in this Software without prior written authorization.
|
dealings in this Software without prior written authorization.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ICON
|
// ICON
|
||||||
#define APP_ICON 1
|
#define APP_ICON 1
|
||||||
|
|
||||||
// BITMAP
|
// BITMAP
|
||||||
#define SPLASH_BITMAP 1
|
#define SPLASH_BITMAP 1
|
||||||
|
|
||||||
// RCDATA
|
// RCDATA
|
||||||
#define JRE_PATH 1
|
#define JRE_PATH 1
|
||||||
#define JAVA_MIN_VER 2
|
#define JAVA_MIN_VER 2
|
||||||
#define JAVA_MAX_VER 3
|
#define JAVA_MAX_VER 3
|
||||||
#define SHOW_SPLASH 4
|
#define SHOW_SPLASH 4
|
||||||
#define SPLASH_WAITS_FOR_WINDOW 5
|
#define SPLASH_WAITS_FOR_WINDOW 5
|
||||||
#define SPLASH_TIMEOUT 6
|
#define SPLASH_TIMEOUT 6
|
||||||
#define SPLASH_TIMEOUT_ERR 7
|
#define SPLASH_TIMEOUT_ERR 7
|
||||||
#define CHDIR 8
|
#define CHDIR 8
|
||||||
#define SET_PROC_NAME 9
|
#define ERR_TITLE 10
|
||||||
#define ERR_TITLE 10
|
#define GUI_HEADER_STAYS_ALIVE 11
|
||||||
#define GUI_HEADER_STAYS_ALIVE 11
|
#define JVM_OPTIONS 12
|
||||||
#define JVM_OPTIONS 12
|
#define CMD_LINE 13
|
||||||
#define CMD_LINE 13
|
#define JAR 14
|
||||||
#define JAR 14
|
#define MAIN_CLASS 15
|
||||||
#define MAIN_CLASS 15
|
#define CLASSPATH 16
|
||||||
#define CLASSPATH 16
|
#define WRAPPER 17
|
||||||
#define WRAPPER 17
|
#define REQUIRES_JDK 18
|
||||||
#define JDK_PREFERENCE 18
|
#define ENV_VARIABLES 19
|
||||||
#define ENV_VARIABLES 19
|
#define PRIORITY_CLASS 20
|
||||||
#define PRIORITY_CLASS 20
|
#define DOWNLOAD_URL 21
|
||||||
#define DOWNLOAD_URL 21
|
#define SUPPORT_URL 22
|
||||||
#define SUPPORT_URL 22
|
#define MUTEX_NAME 23
|
||||||
#define MUTEX_NAME 23
|
#define INSTANCE_WINDOW_TITLE 24
|
||||||
#define INSTANCE_WINDOW_TITLE 24
|
#define INITIAL_HEAP_SIZE 25
|
||||||
#define INITIAL_HEAP_SIZE 25
|
#define INITIAL_HEAP_PERCENT 26
|
||||||
#define INITIAL_HEAP_PERCENT 26
|
#define MAX_HEAP_SIZE 27
|
||||||
#define MAX_HEAP_SIZE 27
|
#define MAX_HEAP_PERCENT 28
|
||||||
#define MAX_HEAP_PERCENT 28
|
#define REQUIRES_64_BIT 29
|
||||||
#define BUNDLED_JRE_64_BIT 29
|
#define RESTART_ON_CRASH 31
|
||||||
#define RUNTIME_BITS 30
|
|
||||||
#define RESTART_ON_CRASH 31
|
#define STARTUP_ERR 101
|
||||||
#define BUNDLED_JRE_AS_FALLBACK 32
|
#define JRE_NOT_FOUND_ERR 102
|
||||||
|
#define JRE_VERSION_ERR 103
|
||||||
#define STARTUP_ERR 101
|
#define LAUNCHER_ERR 104
|
||||||
#define BUNDLED_JRE_ERR 102
|
#define INSTANCE_ALREADY_EXISTS_MSG 105
|
||||||
#define JRE_VERSION_ERR 103
|
|
||||||
#define LAUNCHER_ERR 104
|
|
||||||
#define INSTANCE_ALREADY_EXISTS_MSG 105
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
LAUNCH4J="$(dirname "$0")"/launch4j.jar
|
LAUNCH4J="$(dirname "$0")"/launch4j.jar
|
||||||
if [ -n "$JAVA_HOME" ]; then
|
if [ -n "$JAVA_HOME" ]; then
|
||||||
$JAVA_HOME/bin/java -jar "$LAUNCH4J" "$@"
|
$JAVA_HOME/bin/java -jar "$LAUNCH4J" "$@"
|
||||||
else
|
else
|
||||||
java -jar "$LAUNCH4J" "$@"
|
java -jar "$LAUNCH4J" "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user