Compare commits

...

257 Commits

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

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

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-30 23:31:32 +00:00
37c44ca462 Removed focus from upgrade button 2020-05-23 20:21:55 +01:00
19bf57143c Added RMS and clipping alert in tree view 2020-05-23 20:18:49 +01:00
1005619211 Released 0.4.1 2020-05-19 14:33:33 +01:00
af31ba91a4 Fixed loss of sentence settings on window resize 2020-05-19 14:33:00 +01:00
0e9ae7cc91 Improved gain curve editing 2020-05-18 14:11:36 +01:00
702160c1df Added sentence gain envelopes 2020-05-04 16:45:58 +01:00
b57c1b5753 Change time display to show chapter runtime not sentence runtime 2020-03-05 10:48:51 +00:00
e22a1ce84a Fixed bad array construction in options 2020-02-17 15:56:34 +00:00
83c728e7c8 Optimized record deny and keyboard intercept 2020-02-17 14:25:47 +00:00
ed75718d34 Moved opengl to CLI option 2020-02-17 11:48:13 +00:00
75873b9e8c Fixed mixer list to show more than one device 2020-02-16 12:21:43 +00:00
1416f6d632 Reenabled editing of tree 2020-02-13 10:13:38 +00:00
8a7e070f46 Disable notes areas when nothing relevent selected 2020-02-10 14:42:28 +00:00
1c953dbf1f Fix notes saving and colour 2020-02-10 14:38:32 +00:00
da3b88e083 Added old book importer 2020-02-10 13:49:13 +00:00
13d8dc4612 Add refresh data button 2020-02-10 11:45:23 +00:00
785a4f1b7b Add book length 2020-02-09 15:02:12 +00:00
43b0ccd96d Completely remove book and tools menus 2020-02-09 12:05:26 +00:00
f6af5ce2e7 Add import wav file 2020-02-08 23:32:33 +00:00
577ff9c1eb Move addChapter 2020-02-08 22:24:33 +00:00
f0ae69d610 Clean up tools and book menus a little 2020-02-08 22:09:40 +00:00
7e6a08d64b Move purge to book context menu 2020-02-08 21:31:02 +00:00
5f34c57b23 Change order of tree line entries 2020-02-08 21:09:59 +00:00
356d95191b Fixed auto expansion of books at startup 2020-02-08 20:53:40 +00:00
903f8eaa91 Don't copy sentence files if moving within book 2020-02-08 20:01:31 +00:00
1b7dd7dfb1 Copy files while merging books 2020-02-08 20:00:17 +00:00
ca0a15ba09 Added insert below 2020-02-08 19:49:49 +00:00
c52422247c Added merge book to book context menu 2020-02-08 19:36:35 +00:00
c9b65cb315 Reimplemented book merge 2020-02-08 19:19:10 +00:00
fc3365af62 Implemented multiple open books 2020-02-08 17:16:11 +00:00
7c7cd58963 Auto naming of new chapters 2020-02-07 19:42:29 +00:00
aea5a58691 Moving code out of AudiobookRecorder.java 2020-02-07 19:28:20 +00:00
fab7f1a91c Cleanup of debugging 2020-02-05 20:22:37 +00:00
9b23eb56ce Cleanup 2020-02-05 20:03:23 +00:00
450e80ad21 Added manual link to readme 2020-02-04 23:46:10 +00:00
21d7d9d597 Removed debugging cruft 2020-02-03 21:12:01 +00:00
746f47a5fa Added release version checker 2020-02-03 20:27:15 +00:00
c67e6d6abc Remove orphan chapter if empty 2020-02-03 16:13:17 +00:00
1f722f5df3 Move effects reloading into worker thread 2020-02-03 15:51:23 +00:00
df4eae1d66 Add cancel button to queue monitor 2020-02-03 11:24:22 +00:00
4d435b4fc1 Move external processing to worker threads 2020-02-03 10:22:20 +00:00
f95ae10d03 Fix new chapter adding at top of tree 2020-02-02 19:07:23 +00:00
423d840d83 Release 0.3.8 2020-02-02 17:13:12 +00:00
1997b0bf9b Fix tree collapse on recording finish 2020-02-02 17:09:06 +00:00
b206fb33aa Added deepspeech wrapper example to readme 2020-02-02 15:08:55 +00:00
11b26e396c Minor improvements to readme 2020-02-02 15:01:39 +00:00
94139e6ac6 Released 0.3.7 2020-02-02 14:28:26 +00:00
c0cc2432ff Moved some batch processes to thread worker queue and improved tree view; 2020-02-02 14:02:25 +00:00
f86aaa3782 Delay and batch waveform updates 2020-02-02 00:36:29 +00:00
690a8f0c3b Released 0.3.6 2020-02-01 21:18:47 +00:00
1de0ca8d60 Cleaned up imports 2020-02-01 21:16:32 +00:00
de149c5d85 Added options tooltips 2020-02-01 17:05:02 +00:00
7d2b11473b Improved recognition display 2020-02-01 01:03:02 +00:00
4c25fccc86 Moved speech recognition to configrable external command with worther thread pool 2020-01-31 17:29:00 +00:00
5e310b0224 Updated copyright date 2020-01-31 15:02:06 +00:00
169802ccaf Improved book rendering in tree 2020-01-31 14:57:18 +00:00
28257e00c0 Released 0.3.5 2020-01-29 22:12:28 +00:00
38c6af7090 Implement wheel over waveform to change gain 2020-01-29 20:00:45 +00:00
bdbf4c604d Invert sample storage arrays 2020-01-29 02:01:05 +00:00
73bcba2c9a Added peak dB display in tree 2020-01-27 22:18:17 +00:00
90ca84cfbf Released 0.3.4 2020-01-27 01:18:29 +00:00
a18ca1ce21 Fix reload tree on split and cut operations 2020-01-26 17:41:16 +00:00
b92babb5cd Major improvements to tree list, and added time recording 2020-01-20 23:58:56 +00:00
e3231ec495 Cure tree flashing on playback 2020-01-20 16:00:29 +00:00
4896ee7a65 Released 0.3.3 2020-01-17 14:16:31 +00:00
ce3eb7165a Added book/chapter/phrase notes area tabs 2020-01-17 12:31:25 +00:00
4de00b8fac Add processed flag for batch processing of new recordings 2020-01-15 11:35:49 +00:00
ebe777bdc5 Released 0.3.2 2020-01-12 23:43:08 +00:00
3b5cacb8ad Added import / open manuscript file 2020-01-12 22:46:15 +00:00
db7d297dbc Improve controls spacing 2020-01-12 15:23:16 +00:00
2f9abf7629 Fix split location problem 2020-01-12 15:01:22 +00:00
b6063d2fed Fix tree redraw on split resize 2020-01-12 13:15:52 +00:00
e1f566f0c8 Released 0.3.1 2020-01-12 12:23:14 +00:00
9fa892a6fd Added missing IDs in xml files 2020-01-12 12:22:58 +00:00
1572e163ef Added notes panel 2020-01-12 10:38:16 +00:00
2791691057 Switch book data file to full XML 2020-01-11 20:45:07 +00:00
575537ae66 Fix normalize 2020-01-11 12:31:59 +00:00
fde4a597c7 Released 0.2.2 2020-01-10 20:23:43 +00:00
e69ae52f50 Updated example filters 2020-01-10 18:55:46 +00:00
8bdb06749f Improvements to LFO 2020-01-10 18:29:22 +00:00
0cfd066f4f Released 0.2.1 2019-12-18 11:31:43 +00:00
217ccb915a Added mono/stereo export option 2019-12-16 15:54:34 +00:00
1dd3e9d86f Add purge backup files menu entry 2019-11-28 14:32:11 +00:00
d3d81d71fe Remove play stop/start 2019-11-28 12:19:31 +00:00
80c110afa9 Added playback block size option 2019-10-13 20:11:07 +01:00
1c08b9a51d Purge cache when changing base effect or reloading effects 2019-09-08 22:37:27 +01:00
4ad30106b6 Move save population to sentence 2019-09-08 22:36:58 +01:00
9100d0e35a Improvements to AGC limiting 2019-09-08 22:36:37 +01:00
b8dea19c30 Make splits continuations and have single playback always 1.00x 2019-09-08 12:30:52 +01:00
671f2b9270 Added adjustable FFT block size 2019-09-07 21:24:46 +01:00
d619fb2f4d Added playback speed option 2019-09-07 20:34:02 +01:00
3eb6704f2f Released 0.2.0 2019-09-05 00:21:04 +01:00
cd24beb8a6 Removed pointless garbage collection calls. Massive speedup 2019-09-05 00:20:29 +01:00
fa287305eb Use 100* integer for gain comparison 2019-09-03 00:12:45 +01:00
3fb656b693 Add small visual gap for paragraphs 2019-09-03 00:12:26 +01:00
f514993525 Added global effects disable and fixed caching problems 2019-09-02 21:44:44 +01:00
81787260c9 Lighten font and make flashing panel alternate red/green 2019-08-27 17:14:17 +01:00
f9ad396228 Added chapter and book level resetting of post gaps 2019-08-25 14:08:25 +01:00
8976f2e359 Add post gap classification 2019-08-25 13:41:46 +01:00
187c3edaf6 Add waveform split and cut functionality 2019-08-14 19:58:06 +01:00
02e85fb354 Released 0.1.9 2019-08-13 14:03:45 +01:00
289834021f Finally fixed pesky memory leak 2019-08-13 14:02:14 +01:00
04fea4acb2 Added race condition debugging and reduced recording buffer size for better responsiveness 2019-08-11 12:51:10 +01:00
54739b0a75 Add Tritex to recording controls 2019-08-11 11:15:55 +01:00
ea5520a729 Fix double apply gain shift in AGC 2019-07-26 14:06:30 +01:00
0a19d8d308 Protect against no effects 2019-07-24 14:17:38 +01:00
4dbe3e23b7 Remove debugging cruft 2019-07-23 12:45:46 +01:00
c43cfc3b69 Improve caching policy 2019-07-23 12:44:24 +01:00
babd3d2052 Release 0.1.8 2019-07-22 23:24:16 +01:00
9464839b4d Turn on JTattoo 2019-07-22 23:24:07 +01:00
bcf7875414 Scrap Sample object and use double[][] instead. Disable processed audio caching - it causes heap overflows 2019-07-22 23:23:03 +01:00
732894a0fb Add Chain effect to connect effects together 2019-07-22 10:43:53 +01:00
146bf5a3c2 Release 0.1.7 2019-07-21 20:03:05 +01:00
b05bfde094 Add pan effect 2019-07-21 20:02:16 +01:00
37d372b8f5 Fix caching of processed audio. Add effect icon and name to tree 2019-07-21 20:02:07 +01:00
c01fee3b73 Switch to Sample object instead of double, and refactor effects for whole sampleset processing 2019-07-21 17:21:50 +01:00
c907e735c6 Prevent stacking of default effect chain 2019-07-21 15:36:33 +01:00
7545e33d2f Make effects two-layerd 2019-07-20 23:03:05 +01:00
ebf961449a Reinstate sphinx to replace defunct Haven 2019-07-18 15:07:04 +01:00
45d6882527 Remove defunct Haven processing 2019-07-18 14:31:59 +01:00
2ec370ad61 Add Shift+Space for Play From 2019-07-18 11:51:07 +01:00
63d5c4af8e Released 0.1.6 2019-07-17 23:14:29 +01:00
9619fd574e Apply default effect to room noise 2019-07-17 23:13:39 +01:00
adeb42070d Added more example filters 2019-07-15 00:50:58 +01:00
d207d246bf Added clipping filter 2019-07-14 22:15:10 +01:00
4dd3a3b874 Released 0.1.5 2019-04-03 13:12:02 +01:00
52b04a754c Added section break and stopped effects chain dropdown from intercepting keypresses 2019-04-03 13:11:19 +01:00
c0efd152e8 Reinstated sample scroll bar 2019-01-21 15:06:30 +00:00
9bda80d40d Update to readme 2019-01-20 13:17:14 +00:00
0e12995063 Added AGC filter 2019-01-20 13:09:52 +00:00
424ebafab5 Detailed LFO in example folder 2019-01-19 16:52:53 +00:00
73d4feb679 Added LFO ring modulator 2019-01-19 16:23:33 +00:00
887b2a9205 Added FFT trim threshold setting and example filters 2019-01-17 00:00:49 +00:00
927eb3e1ff Implemented new effect chain system instead of EQ 2019-01-15 22:43:02 +00:00
fd19f5befe Added Biquad processing class 2019-01-13 23:59:28 +00:00
382775d6ab Reset post sentence gap on record 2019-01-11 22:32:54 +00:00
c41ee27069 Restricted external processors to unlocked sentences 2019-01-07 16:51:51 +00:00
e5b395ffa5 Added external processors 2019-01-07 15:45:52 +00:00
b55f76c855 Add edit in external editor 2019-01-07 13:17:36 +00:00
28a8bd3c51 Checkpoint release 2018-11-14 15:58:25 +00:00
9adcd89cd5 Added groundwork for multiple EQ profiles 2018-11-14 12:00:19 +00:00
14e6709c29 Added gain control and normalization, along with peak display 2018-11-13 13:26:54 +00:00
024626019d Added overlay icons 2018-11-03 11:58:04 +00:00
c0d86d5753 Merge branch 'master' of github.com:MajenkoProjects/AudiobookRecorder 2018-10-29 15:34:19 +00:00
175281537c Added ethereal voice effect 2018-10-29 15:33:25 +00:00
Matt Jenkins
abb26288c6 Added book name to start of exported chapters 2018-10-22 14:08:16 +01:00
f5c0d5bbfc Dumped Sphinx and instead using Haven OnDemand speech API 2018-10-21 13:52:20 +01:00
ff08db3e44 Added book info edit option 2018-10-06 21:30:58 +01:00
7431550d61 Added ACX website connections 2018-10-06 20:47:22 +01:00
448910b8d7 Put options and EQ panels in scroll panes 2018-10-04 20:38:09 +01:00
991c4fbf8e Updated locked theme 2018-10-04 00:33:00 +01:00
ced0aaa597 Added attention flag 2018-10-04 00:26:16 +01:00
498247c793 Removed enable/disable of toolbar buttons and fixed broken playback controls 2018-10-03 15:47:10 +01:00
ad5c3808cd Merge branch 'master' of github.com:MajenkoProjects/AudiobookRecorder 2018-10-03 12:42:29 +01:00
c658dc6a50 Added archive path to options 2018-10-03 12:41:38 +01:00
Matt Jenkins
100adec397 Added desktop file 2018-10-02 23:18:12 +01:00
Matt Jenkins
f4b793574d Added build instructions to README 2018-10-02 23:08:31 +01:00
d8c52575fb Move jars to LFS 2018-10-02 22:41:39 +01:00
1b2945d9c4 Added LFS 2018-10-02 22:40:01 +01:00
1244bd60ed Decimate by 4 2018-10-02 22:37:31 +01:00
b566b9e89e Add book name to window title 2018-10-02 15:39:20 +01:00
4a4d7f2a38 Checkpoint release 2018-10-02 14:37:23 +01:00
f7848228a2 Added cover art import #6 2018-10-02 14:36:37 +01:00
8c22315b15 Added import archive #4 2018-10-02 14:21:12 +01:00
718c982578 Added batch conversion of text #8 2018-10-02 12:00:11 +01:00
be0f6a9f56 Checkpoint release 2018-10-02 00:45:31 +01:00
35874f5ca2 Only display begging panel every 10 launches 2018-10-02 00:43:30 +01:00
a7fdfce094 Added donation panel 2018-10-02 00:38:35 +01:00
5947c9a020 Added JEQ license file 2018-10-02 00:17:22 +01:00
05408915b1 Improved 96000 coefficients 2018-10-02 00:13:22 +01:00
4635b5af0f Added archive creation 2018-10-01 20:56:11 +01:00
b362217d75 Renamed ExportDialog to ProgressDialog 2018-10-01 20:05:24 +01:00
cc48d49b5c Added duplicate sentence and moved all playing out of Sentence and into main program 2018-10-01 19:41:27 +01:00
391e54b993 Added playback marker #20 2018-10-01 16:21:44 +01:00
49b6a92865 Added space to stop #10 2018-10-01 15:57:57 +01:00
fbe05367fa Added continuation recording on F key 2018-10-01 12:00:23 +01:00
eaf3080859 Added jpg and gif coverart to book panel 2018-10-01 11:11:10 +01:00
6ceec9ef85 Filtered empty lines on script execution 2018-09-30 22:58:07 +01:00
ac73711122 Updated buttons to be focusless and added red to background of mic toggle button 2018-09-30 17:22:54 +01:00
3cb0471027 Custom buttons with no focus 2018-09-30 13:51:15 +01:00
38e7434730 Added playback marker for single phrase play 2018-09-30 02:00:16 +01:00
d8cd72809c Added trim method option in preferences 2018-09-30 01:21:13 +01:00
5f5550b166 Checkpoint release 2018-09-29 14:30:22 +01:00
9bb4492d4d Added waveform zoom and scroll #18 2018-09-29 14:28:09 +01:00
3bba7a2519 Simplified JTattoo string drawing routines 2018-09-29 13:45:45 +01:00
6d48f13d1b Included JTattoo sources in tree and cleaned up warnings 2018-09-29 13:32:31 +01:00
aa6bca412e Display noise floor in dB 2018-09-28 23:37:44 +01:00
f01704535b Added mouse dragging to waveform markers 2018-09-28 19:28:51 +01:00
bc74f2bb5b Migrated code to JVM-11 compatability 2018-09-28 15:33:23 +01:00
4e5fb09ba2 Store recording settings in the book configuration 2018-09-28 13:47:49 +01:00
edc5373e64 Added merge books and delete chapter 2018-09-28 12:27:39 +01:00
fde64c5764 Added save book menu item 2018-09-28 11:37:17 +01:00
a91f5e1edb Added double-click support to open dialog 2018-09-28 11:20:24 +01:00
9e42cfa8db Improved equaliser display 2018-09-27 19:27:56 +01:00
2ff885c6f9 Improved 96kHz coefficients 2018-09-27 13:13:16 +01:00
981f9bd539 Partial 96kHz support 2018-09-27 11:05:56 +01:00
fab11f5755 Beginnings of multi-bit support 2018-09-26 16:38:34 +01:00
c34f909b21 Released checkpoint version 2018-09-26 15:40:05 +01:00
955227e9e3 Complete overhaul of recording to allow better recording from microphones that require a warmup and self-calibration period 2018-09-26 14:26:44 +01:00
e626da0c5e Revamped equaliser and added to book settings 2018-09-25 16:57:51 +01:00
6adb22b9ac Added curve smoothing button to EQ 2018-09-24 18:53:10 +01:00
a51af45e50 Released 0.0.7 checkpoint 2018-09-24 15:57:11 +01:00
2a52f8ccfb Added audio EQ 2018-09-24 15:47:51 +01:00
36c8cc0a26 Improved export facility and added export single chapter 2018-09-24 10:27:25 +01:00
c9bada7721 Added progress dialog while exporting #14 2018-09-23 17:51:54 +01:00
3036ef801b Add scroll sentence into view when playing all #9 2018-09-23 15:45:35 +01:00
c591025b4f Add lock and unlock all #15 2018-09-23 15:42:16 +01:00
ae22c8c86d Added Linux exe stub 2018-09-17 10:12:34 +01:00
eade8ef47d Various cleanups as recommended by FindBug 2018-09-16 20:58:07 +01:00
c74de99835 Included os name in exe filenames 2018-09-16 20:57:34 +01:00
1c056c9e7b Added zero crossing detection #7 2018-09-16 15:34:49 +01:00
43d80c00d9 Added sentence cache system 2018-09-16 13:55:19 +01:00
9fb3d1f816 Merge chapters (#1) 2018-09-16 12:20:48 +01:00
9ee4acfc8d Moved todo into github issues 2018-09-15 22:37:52 +01:00
7f4303df40 Added alert to todo 2018-09-15 22:30:07 +01:00
8170f3c905 Added file chooser boxes for options 2018-09-15 19:16:08 +01:00
12f51bb471 Released v0.0.6 2018-09-15 17:27:07 +01:00
2a8ecf4c8c Improved release 2018-09-15 17:26:33 +01:00
5e3620c521 Added auto release target 2018-09-15 17:14:05 +01:00
ec90e5727f Added about panel 2018-09-15 17:00:40 +01:00
583 changed files with 54927 additions and 1892 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.jar filter=lfs diff=lfs merge=lfs -text

6
.gitignore vendored
View File

@@ -2,5 +2,7 @@
._*
bin
AudiobookRecorder.jar
AudiobookRecorder.dmg
AudiobookRecorder.exe
AudiobookRecorder-linux
AudiobookRecorder-osx.dmg
AudiobookRecorder-win.exe
.*.swp

View File

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

View File

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

View File

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

77
ExampleFilters/README.md Normal file
View 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
View 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>

View 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>

View 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>

View 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>

View 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>

View 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
View File

@@ -0,0 +1,2 @@
<effect name="Flat">
</effect>

View 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>

View 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>

View File

@@ -0,0 +1,3 @@
<effect name="Pan Left">
<pan pan="-0.4" />
</effect>

View File

@@ -0,0 +1,3 @@
<effect name="Pan Right">
<pan pan="0.4" />
</effect>

8
ExampleFilters/phone.eff Normal file
View 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
View 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>

View 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>

View 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>

View File

@@ -35,3 +35,4 @@ Third party software
* JAVE ffmpeg wrapper: http://www.sauronsoftware.it/projects/jave/
* JTattoo: http://www.sauronsoftware.it/projects/jave/
* Icons from, or based on, Oxygen: https://github.com/KDE/oxygen-icons
* JEQ, the Java Equaliser: https://sourceforge.net/projects/jeq/

View File

@@ -8,6 +8,9 @@ A system for easing the task of recording and editing audiobooks.
* Zero editing
* MP3 export
* Chapter management
* Audio effect chains (biquad, delay line, etc)
# [Manual and Tutorial](https://majenkoprojects.github.io/AudiobookRecorder)
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
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 "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 "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
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).
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
audio contains.
To help with this CMU Sphinx (US EN dictionary) is bundled
with the system and can be used to try and convert the
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.
The audio can also be automatically converted to text if you have an suitable command-line
executable that will work. One example is (on Linux) [DeepSpeech](https://github.com/mozilla/DeepSpeech) by Mozilla.
File layout
-----------
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.
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.
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 ""
```

View File

@@ -1,8 +0,0 @@
ToDo
====
* Merge chapters
* Identify and export 5 minute retail sample
* Identify and export 15 minute checkpoint
* Archive (Zip and delete) audiobooks
* File path browser buttons in options

Binary file not shown.

View File

@@ -1,8 +1,13 @@
<?xml version="1.0"?>
<project name="Audiobook Recorder" default="build">
<property file="resources/uk/co/majenko/audiobookrecorder/config.txt"/>
<taskdef name="jarbundler" classname="com.ultramixer.jarbundler.JarBundler" classpath="ant-libs/jarbundler-2.3.2.jar" />
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="launch4j/launch4j.jar:launch4g/lib/xstream.jar" />
<target name="clean" description="Clean out the build directories">
<delete dir="bin" />
<delete file="AudiobookRecorder.jar" />
@@ -20,7 +25,7 @@
debug="true"
debuglevel="lines,vars,source"
encoding="UTF-8"
bootclasspath="${bootclass.path}"
bootclasspath="/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar"
includeAntRuntime="false"
deprecation="true"
srcdir="src"
@@ -38,19 +43,15 @@
<manifest>
<attribute name="Main-Class" value="uk.co.majenko.audiobookrecorder.AudiobookRecorder" />
<attribute name="Class-Path" value="AudiobookRecorder.jar" />
<!--attribute name="Version" value="${Version}" />
<attribute name="Release" value="${Release}" /-->
<attribute name="Version" value="${version}" />
</manifest>
</jar>
<chmod perm="0755" file="uecide.jar" />
</target>
<target name="release" depends="macapp">
</target>
<target name="macapp" depends="build">
<mkdir dir="tmp"/>
<mkdir dir="tmp"/>
<jarbundler
name="AudiobookRecorder"
@@ -76,7 +77,7 @@
<arg value="-r" />
<arg value="-apple" />
<arg value="-o" />
<arg value="AudiobookRecorder.dmg" />
<arg value="AudiobookRecorder-osx.dmg" />
<arg value="-dir-mode" />
<arg value="0755" />
<arg value="-file-mode" />
@@ -87,4 +88,83 @@
<delete dir="tmp" />
</target>
<target name="winapp" depends="build">
<launch4j configFile="dist/windows/windows.xml" outfile="AudiobookRecorder-win.exe" />
</target>
<target name="linuxapp" depends="build">
<concat destfile="AudiobookRecorder-linux" binary="true">
<file file="dist/linux/stub" />
<file file="AudiobookRecorder.jar" />
</concat>
<chmod perm="0755" file="AudiobookRecorder-linux" />
</target>
<target name="dist" depends="macapp,winapp,linuxapp" />
<target name="tag">
<exec executable="git">
<arg value="tag" />
<arg value="-m" />
<arg value="Auto generated tag" />
<arg value="-s" />
<arg value="v${version}" />
</exec>
<exec executable="git">
<arg value="push" />
<arg value="--tags" />
</exec>
</target>
<target name="release" depends="dist,tag">
<echo>Creating release v${version}</echo>
<exec executable="./mklog"
outputproperty="changelog">
<arg value="v${version}"/>
</exec>
<exec executable="github-release">
<arg value="release"/>
<arg value="-u"/> <arg value="MajenkoProjects"/>
<arg value="-r"/> <arg value="AudiobookRecorder"/>
<arg value="-t"/> <arg value="v${version}"/>
<arg value="-d"/> <arg value="${changelog}"/>
</exec>
<echo>Uploading AudiobookRecorder.jar</echo>
<exec executable="github-release">
<arg value="upload"/>
<arg value="-u"/> <arg value="MajenkoProjects"/>
<arg value="-r"/> <arg value="AudiobookRecorder"/>
<arg value="-t"/> <arg value="v${version}"/>
<arg value="-f"/> <arg value="AudiobookRecorder.jar"/>
<arg value="-n"/> <arg value="AudiobookRecorder.jar"/>
</exec>
<echo>Uploading AudiobookRecorder-osx.dmg</echo>
<exec executable="github-release">
<arg value="upload"/>
<arg value="-u"/> <arg value="MajenkoProjects"/>
<arg value="-r"/> <arg value="AudiobookRecorder"/>
<arg value="-t"/> <arg value="v${version}"/>
<arg value="-f"/> <arg value="AudiobookRecorder-osx.dmg"/>
<arg value="-n"/> <arg value="AudiobookRecorder-osx.dmg"/>
</exec>
<echo>Uploading AudiobookRecorder-win.exe</echo>
<exec executable="github-release">
<arg value="upload"/>
<arg value="-u"/> <arg value="MajenkoProjects"/>
<arg value="-r"/> <arg value="AudiobookRecorder"/>
<arg value="-t"/> <arg value="v${version}"/>
<arg value="-f"/> <arg value="AudiobookRecorder-win.exe"/>
<arg value="-n"/> <arg value="AudiobookRecorder-win.exe"/>
</exec>
<echo>Uploading AudiobookRecorder-linux</echo>
<exec executable="github-release">
<arg value="upload"/>
<arg value="-u"/> <arg value="MajenkoProjects"/>
<arg value="-r"/> <arg value="AudiobookRecorder"/>
<arg value="-t"/> <arg value="v${version}"/>
<arg value="-f"/> <arg value="AudiobookRecorder-linux"/>
<arg value="-n"/> <arg value="AudiobookRecorder-linux"/>
</exec>
</target>
</project>

Binary file not shown.

BIN
deps/commons-codec-1.10.jar LFS vendored Normal file

Binary file not shown.

BIN
deps/commons-lang3.jar LFS vendored Normal file

Binary file not shown.

BIN
deps/commons-logging-1.2.jar LFS vendored Normal file

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

BIN
deps/json-20190722.jar LFS vendored Normal file

Binary file not shown.

BIN
deps/mp3agic-0.9.1.jar vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

13
dist/linux/audiobookrecorder.desktop vendored Normal file
View 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

11
dist/linux/stub vendored Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
MYSELF=`which "$0" 2>/dev/null`
[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"
java=java
if test -n "$JAVA_HOME"; then
java="$JAVA_HOME/bin/java"
fi
MEM=`grep MemTotal: /proc/meminfo | awk '{printf "%.0f", ($2 / 1024 / 1024 /2)}'`
java_args=-Xmx${MEM}g
exec "$java" $java_args -jar $MYSELF "$@"
exit 1

BIN
dist/windows/audiobookrecorder.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

28
dist/windows/windows.xml vendored Normal file
View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>../../AudiobookRecorder.jar</jar>
<outfile>AudiobookRecorder.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest></manifest>
<icon>audiobookrecorder.ico</icon>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.7.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
<initialHeapSize>512</initialHeapSize>
<maxHeapSize>512</maxHeapSize>
</jre>
</launch4jConfig>

17
launch4j/.classpath Normal file
View File

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

17
launch4j/.project Normal file
View File

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

View File

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

View File

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

View File

@@ -0,0 +1,117 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

View File

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

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

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

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

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

30
launch4j/LICENSE.txt Normal file
View File

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

77
launch4j/build.xml Normal file
View File

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

Binary file not shown.

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,8 @@
Put your jar libs here and the build script will include them
in the classpath stored inside the jar manifest.
In order to run your application move the output exe file from
the dist directory to the same level as lib.
SimpleApp.exe
lib/
lib/xml.jar

View File

@@ -0,0 +1 @@
To build the example application set JAVA_HOME and ANT_HOME environment variables.

View File

@@ -0,0 +1,72 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.sf.launch4j.example;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author Copyright (C) 2005 Grzegorz Kowal
*/
public class ConsoleApp {
public static void main(String[] args) {
StringBuffer sb = new StringBuffer("Hello World!\n\nJava version: ");
sb.append(System.getProperty("java.version"));
sb.append("\nJava home: ");
sb.append(System.getProperty("java.home"));
sb.append("\nCurrent dir: ");
sb.append(System.getProperty("user.dir"));
if (args.length > 0) {
sb.append("\nArgs: ");
for (int i = 0; i < args.length; i++) {
sb.append(args[i]);
sb.append(' ');
}
}
sb.append("\n\nEnter a line of text, 'quit' or Ctrl-C to stop.\n\n>");
System.out.print(sb.toString());
try {
BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = is.readLine()) != null && !line.equalsIgnoreCase("quit")) {
System.out.print("You wrote: " + line + "\n\n>");
}
is.close();
System.exit(123);
} catch (IOException e) {
System.err.print(e);
}
}
}

View File

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

View File

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

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

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

Binary file not shown.

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,8 @@
Put your jar libs here and the build script will include them
in the classpath stored inside the jar manifest.
In order to run your application move the output exe file from
the dist directory to the same level as lib.
SimpleApp.exe
lib/
lib/xml.jar

View File

@@ -0,0 +1 @@
To build the example application set JAVA_HOME and ANT_HOME environment variables.

View File

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

3
launch4j/demo/readme.txt Normal file
View File

@@ -0,0 +1,3 @@
JRE/SDK 1.6.0 or higher must be installed on your system to run this demo.
try running it with some command line arguments...

26
launch4j/head/LICENSE.txt Normal file
View File

@@ -0,0 +1,26 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

BIN
launch4j/head/consolehead.o Normal file

Binary file not shown.

BIN
launch4j/head/guihead.o Normal file

Binary file not shown.

BIN
launch4j/head/head.o Normal file

Binary file not shown.

View File

@@ -0,0 +1,26 @@
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

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

View File

@@ -0,0 +1,97 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2007 Grzegorz Kowal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "../resource.h"
#include "../head.h"
extern FILE* hLog;
BOOL restartOnCrash = FALSE;
int main(int argc, char* argv[])
{
setConsoleFlag();
LPTSTR cmdLine = GetCommandLine();
if (*cmdLine == '"')
{
if (*(cmdLine = strchr(cmdLine + 1, '"') + 1))
{
cmdLine++;
}
}
else if ((cmdLine = strchr(cmdLine, ' ')) != NULL)
{
cmdLine++;
}
else
{
cmdLine = "";
}
int result = prepare(cmdLine, FALSE);
if (result == ERROR_ALREADY_EXISTS)
{
char errMsg[BIG_STR] = {0};
loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
msgBox(errMsg);
closeLogFile();
return 2;
}
if (result != TRUE)
{
signalError();
return 1;
}
restartOnCrash = loadBool(RESTART_ON_CRASH);
DWORD dwExitCode;
do
{
dwExitCode = 0;
if (!execute(TRUE, &dwExitCode))
{
signalError();
break;
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return (int) dwExitCode;
}

View File

@@ -0,0 +1,111 @@
[Project]
FileName=consolehead.dev
Name=consolehead
UnitCount=4
Type=1
Ver=2
ObjFiles=
Includes=
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=
Linker=-n_@@_
IsCpp=0
Icon=
ExeOutput=
ObjectOutput=..\..\head
OverrideOutput=0
OverrideOutputName=consolehead.exe
HostApplication=
Folders=
CommandLine=
UseCustomMakefile=0
CustomMakefile=Makefile.win
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=000000d000000000000001000
LogOutput=
LogOutputEnabled=0
[Unit1]
FileName=consolehead.c
CompileCpp=0
Folder=consolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=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=consolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit3]
FileName=..\head.c
CompileCpp=0
Folder=consolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit4]
FileName=..\head.h
CompileCpp=0
Folder=consolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit5]
FileName=..\head.rc
Folder=consolehead
Compile=1
Link=0
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit6]
FileName=..\resid.h
CompileCpp=0
Folder=consolehead
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

View File

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

View File

@@ -0,0 +1,241 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
Sylvain Mina (single instance patch)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "../resource.h"
#include "../head.h"
#include "guihead.h"
extern FILE* hLog;
extern PROCESS_INFORMATION processInformation;
HWND hWnd;
DWORD dwExitCode = 0;
BOOL stayAlive = FALSE;
BOOL splash = FALSE;
BOOL splashTimeoutErr;
BOOL waitForWindow;
BOOL restartOnCrash = FALSE;
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int result = prepare(lpCmdLine, FALSE);
if (result == ERROR_ALREADY_EXISTS)
{
HWND handle = getInstanceWindow();
ShowWindow(handle, SW_SHOW);
SetForegroundWindow(handle);
closeLogFile();
return 2;
}
if (result != TRUE)
{
signalError();
return 1;
}
splash = loadBool(SHOW_SPLASH)
&& strstr(lpCmdLine, "--l4j-no-splash") == NULL;
restartOnCrash = loadBool(RESTART_ON_CRASH);
// if we should restart on crash, we must also stay alive to check for crashes
stayAlive = restartOnCrash ||
(loadBool(GUI_HEADER_STAYS_ALIVE)
&& strstr(lpCmdLine, "--l4j-dont-wait") == NULL);
if (splash || stayAlive)
{
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
WS_POPUP | SS_BITMAP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if (splash)
{
char timeout[10] = {0};
if (loadString(SPLASH_TIMEOUT, timeout))
{
splashTimeout = atoi(timeout);
if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT)
{
splashTimeout = DEFAULT_SPLASH_TIMEOUT;
}
}
splashTimeout = splashTimeout * 1000; // to millis
splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
&& strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
IMAGE_BITMAP, // type of image
0, // desired width
0, // desired height
LR_DEFAULTSIZE);
if (hImage == NULL)
{
signalError();
return 1;
}
SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
RECT rect;
GetWindowRect(hWnd, &rect);
int x = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
int y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
ShowWindow(hWnd, nCmdShow);
UpdateWindow (hWnd);
}
}
do
{
if (splash || stayAlive)
{
if (!SetTimer (hWnd, ID_TIMER, TIMER_PROC_INTERVAL, TimerProc))
{
signalError();
return 1;
}
}
if (!execute(FALSE, &dwExitCode))
{
signalError();
return 1;
}
if (!(splash || stayAlive))
{
debug("Exit code:\t0\n");
closeProcessHandles();
closeLogFile();
return 0;
}
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
closeProcessHandles();
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return dwExitCode;
}
HWND getInstanceWindow()
{
char windowTitle[STR];
char instWindowTitle[STR] = {0};
if (loadString(INSTANCE_WINDOW_TITLE, instWindowTitle))
{
HWND handle = FindWindowEx(NULL, NULL, NULL, NULL);
while (handle != NULL)
{
GetWindowText(handle, windowTitle, STR - 1);
if (strstr(windowTitle, instWindowTitle) != NULL)
{
return handle;
}
else
{
handle = FindWindowEx(NULL, handle, NULL, NULL);
}
}
}
return NULL;
}
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam)
{
DWORD processId;
GetWindowThreadProcessId(hwnd, &processId);
if (processInformation.dwProcessId == processId)
{
LONG styles = GetWindowLong(hwnd, GWL_STYLE);
if ((styles & WS_VISIBLE) != 0)
{
splash = FALSE;
ShowWindow(hWnd, SW_HIDE);
return FALSE;
}
}
return TRUE;
}
VOID CALLBACK TimerProc(
HWND hwnd, // handle of window for timer messages
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
DWORD dwTime) // current system time
{
if (splash)
{
if (splashTimeout == 0)
{
splash = FALSE;
ShowWindow(hWnd, SW_HIDE);
if (waitForWindow && splashTimeoutErr)
{
KillTimer(hwnd, ID_TIMER);
signalError();
PostQuitMessage(0);
}
}
else
{
splashTimeout -= TIMER_PROC_INTERVAL;
if (waitForWindow)
{
EnumWindows(enumwndfn, 0);
}
}
}
GetExitCodeProcess(processInformation.hProcess, &dwExitCode);
if (dwExitCode != STILL_ACTIVE
|| !(splash || stayAlive))
{
KillTimer(hWnd, ID_TIMER);
PostQuitMessage(0);
}
}

View File

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

View File

@@ -0,0 +1,44 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2007 Grzegorz Kowal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#define ID_TIMER 1
#define DEFAULT_SPLASH_TIMEOUT 60 /* 60 seconds */
#define MAX_SPLASH_TIMEOUT 60 * 15 /* 15 minutes */
#define TIMER_PROC_INTERVAL 100 /* interval in ms between calls to EnumWindows */
HWND getInstanceWindow();
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam);
VOID CALLBACK TimerProc(
HWND hwnd, // handle of window for timer messages
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
DWORD dwTime // current system time
);

1452
launch4j/head_src/head.c Normal file

File diff suppressed because it is too large Load Diff

136
launch4j/head_src/head.h Normal file
View File

@@ -0,0 +1,136 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal,
Ian Roberts (jdk preference patch)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif // _WIN32_WINNT
#ifndef _LAUNCH4J_HEAD__INCLUDED_
#define _LAUNCH4J_HEAD__INCLUDED_
#define WIN32_LEAN_AND_MEAN // VC - Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <shellapi.h>
#include <direct.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <io.h>
#include <process.h>
#define LAUNCH4j "Launch4j"
#define VERSION "3.50"
#define JRE_VER_MAX_DIGITS_PER_PART 3
#define JAVA_NOT_FOUND 0
#define JAVA_FOUND 1
#define KEY_WOW64_64KEY 0x0100
#define HKEY_STR "HKEY"
#define HKEY_CLASSES_ROOT_STR "HKEY_CLASSES_ROOT"
#define HKEY_CURRENT_USER_STR "HKEY_CURRENT_USER"
#define HKEY_LOCAL_MACHINE_STR "HKEY_LOCAL_MACHINE"
#define HKEY_USERS_STR "HKEY_USERS"
#define HKEY_CURRENT_CONFIG_STR "HKEY_CURRENT_CONFIG"
#define STR 128
#define BIG_STR 1024
#define MAX_VAR_SIZE 32767
#define MAX_ARGS 32768
#define TRUE_STR "true"
#define FALSE_STR "false"
#define ERROR_FORMAT "Error:\t\t%s\n"
#define debug(args...) if (hLog != NULL) fprintf(hLog, ## args);
#define debugAll(args...) if (debugAll && hLog != NULL) fprintf(hLog, ## args);
typedef void (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
BOOL initGlobals(BOOL jni);
FILE* openLogFile(const char* exePath, const int pathLen);
void closeLogFile();
BOOL initializeLogging(const char *lpCmdLine, const char* exePath, const int pathLen);
void msgBox(const char* text);
void signalError();
BOOL loadString(const int resID, char* buffer);
BOOL loadBool(const int resID);
int loadInt(const int resID);
BOOL regQueryValue(const char* regPath, unsigned char* buffer,
unsigned long bufferLength);
void formatJavaVersion(char* version, const char* originalVersion);
void regSearch(const char* keyName, const int searchType);
BOOL isRegistryJavaHomeValid(const char* keyName, const int searchType);
BOOL isLauncherPathValid(const char* path);
void regSearchWow(const char* keyName);
BOOL findRegistryJavaHome(char* path);
int getExePath(char* exePath);
void appendPath(char* basepath, const char* path);
void appendLauncher(char* jrePath);
void appendAppClasspath(char* dst, const char* src);
BOOL expandVars(char *dst, const char *src, const char *exePath, const int pathLen);
void appendHeapSizes(char *dst);
void appendHeapSize(char *dst, const int megabytesID, const int percentID,
const DWORDLONG availableMemory, const char *option);
void setJvmOptions(char *jvmOptions, const char *exePath);
BOOL createMutex();
void setWorkingDirectory(const char *exePath, const int pathLen);
void removeChar(char *src, const char toRemove);
BOOL pathJreSearch(const char *exePath, const int pathLen);
BOOL registryJreSearch();
void createJreSearchError();
BOOL jreSearch(const char *exePath, const int pathLen);
BOOL appendToPathVar(const char* path);
BOOL appendJreBinToPathVar();
void setEnvironmentVariables(const char *exePath, const int pathLen);
void setMainClassAndClassPath(const char *exePath, const int pathLen);
void setCommandLineArgs(const char *lpCmdLine);
int prepare(const char *lpCmdLine, BOOL jni);
void closeProcessHandles();
BOOL execute(const BOOL wait, DWORD *dwExitCode);
const char* getJavaHome();
const char* getMainClass();
const char* getLauncherArgs();
void getVersionFromOutput(HANDLE outputRd, char *version, int versionLen, BOOL *is64Bit);
BOOL CreateChildProcess(char *cmdline, HANDLE outputWr);
BOOL isJavaVersionGood(const char* version, BOOL is64Bit);
BOOL isJavaPathVersionGood(const char *path, BOOL *is64Bit);
#endif // _LAUNCH4J_HEAD__INCLUDED_

View File

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

View File

@@ -0,0 +1,99 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2007 Grzegorz Kowal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "../resource.h"
#include "../head.h"
#include "../jnihead.h"
extern FILE* hLog;
BOOL restartOnCrash = FALSE;
int main(int argc, char* argv[])
{
setConsoleFlag();
LPTSTR cmdLine = GetCommandLine();
if (*cmdLine == '"')
{
if (*(cmdLine = strchr(cmdLine + 1, '"') + 1))
{
cmdLine++;
}
}
else if ((cmdLine = strchr(cmdLine, ' ')) != NULL)
{
cmdLine++;
}
else
{
cmdLine = "";
}
int result = prepare(cmdLine, TRUE);
if (result == ERROR_ALREADY_EXISTS)
{
char errMsg[BIG_STR] = {0};
loadString(INSTANCE_ALREADY_EXISTS_MSG, errMsg);
msgBox(errMsg);
closeLogFile();
return 2;
}
if (result != TRUE)
{
signalError();
return 1;
}
restartOnCrash = loadBool(RESTART_ON_CRASH);
DWORD dwExitCode;
do
{
dwExitCode = 0;
saveJvmOptions(getJavaHome(), getMainClass(), getLauncherArgs());
if (!executeVm(&dwExitCode))
{
signalError();
break;
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return (int) dwExitCode;
}

View File

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

View File

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

View File

@@ -0,0 +1,244 @@
/*
Launch4j (http://launch4j.sourceforge.net/)
Cross-platform Java application wrapper for creating Windows native executables.
Copyright (c) 2004, 2015 Grzegorz Kowal
Sylvain Mina (single instance patch)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "../resource.h"
#include "../head.h"
#include "../jnihead.h"
#include "jniguihead.h"
extern FILE* hLog;
extern PROCESS_INFORMATION processInformation;
HWND hWnd;
DWORD dwExitCode = 0;
BOOL stayAlive = FALSE;
BOOL splash = FALSE;
BOOL splashTimeoutErr;
BOOL waitForWindow;
BOOL restartOnCrash = FALSE;
int splashTimeout = DEFAULT_SPLASH_TIMEOUT;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int result = prepare(lpCmdLine, TRUE);
if (result == ERROR_ALREADY_EXISTS)
{
HWND handle = getInstanceWindow();
ShowWindow(handle, SW_SHOW);
SetForegroundWindow(handle);
closeLogFile();
return 2;
}
if (result != TRUE)
{
signalError();
return 1;
}
splash = loadBool(SHOW_SPLASH)
&& strstr(lpCmdLine, "--l4j-no-splash") == NULL;
restartOnCrash = loadBool(RESTART_ON_CRASH);
// if we should restart on crash, we must also stay alive to check for crashes
stayAlive = restartOnCrash ||
(loadBool(GUI_HEADER_STAYS_ALIVE)
&& strstr(lpCmdLine, "--l4j-dont-wait") == NULL);
if (splash || stayAlive)
{
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, "STATIC", "",
WS_POPUP | SS_BITMAP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if (splash)
{
char timeout[10] = {0};
if (loadString(SPLASH_TIMEOUT, timeout))
{
splashTimeout = atoi(timeout);
if (splashTimeout <= 0 || splashTimeout > MAX_SPLASH_TIMEOUT)
{
splashTimeout = DEFAULT_SPLASH_TIMEOUT;
}
}
splashTimeoutErr = loadBool(SPLASH_TIMEOUT_ERR)
&& strstr(lpCmdLine, "--l4j-no-splash-err") == NULL;
waitForWindow = loadBool(SPLASH_WAITS_FOR_WINDOW);
HANDLE hImage = LoadImage(hInstance, // handle of the instance containing the image
MAKEINTRESOURCE(SPLASH_BITMAP), // name or identifier of image
IMAGE_BITMAP, // type of image
0, // desired width
0, // desired height
LR_DEFAULTSIZE);
if (hImage == NULL)
{
signalError();
return 1;
}
SendMessage(hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImage);
RECT rect;
GetWindowRect(hWnd, &rect);
int x = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
int y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
ShowWindow(hWnd, nCmdShow);
UpdateWindow (hWnd);
}
}
do
{
if (splash || stayAlive)
{
if (!SetTimer (hWnd, ID_TIMER, 1000 /* 1s */, TimerProc))
{
signalError();
return 1;
}
}
debug(getJavaHome());
saveJvmOptions(getJavaHome(), getMainClass(), getLauncherArgs());
if (!executeVm(&dwExitCode))
{
signalError();
return 1;
}
if (!(splash || stayAlive))
{
debug("Exit code:\t0\n");
closeProcessHandles();
closeLogFile();
return 0;
}
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (restartOnCrash && dwExitCode != 0)
{
debug("Exit code:\t%d, restarting the application!\n", dwExitCode);
}
closeProcessHandles();
} while (restartOnCrash && dwExitCode != 0);
debug("Exit code:\t%d\n", dwExitCode);
closeLogFile();
return dwExitCode;
}
HWND getInstanceWindow()
{
char windowTitle[STR];
char instWindowTitle[STR] = {0};
if (loadString(INSTANCE_WINDOW_TITLE, instWindowTitle))
{
HWND handle = FindWindowEx(NULL, NULL, NULL, NULL);
while (handle != NULL)
{
GetWindowText(handle, windowTitle, STR - 1);
if (strstr(windowTitle, instWindowTitle) != NULL)
{
return handle;
}
else
{
handle = FindWindowEx(NULL, handle, NULL, NULL);
}
}
}
return NULL;
}
BOOL CALLBACK enumwndfn(HWND hwnd, LPARAM lParam)
{
DWORD processId;
GetWindowThreadProcessId(hwnd, &processId);
if (processInformation.dwProcessId == processId)
{
LONG styles = GetWindowLong(hwnd, GWL_STYLE);
if ((styles & WS_VISIBLE) != 0)
{
splash = FALSE;
ShowWindow(hWnd, SW_HIDE);
return FALSE;
}
}
return TRUE;
}
VOID CALLBACK TimerProc(
HWND hwnd, // handle of window for timer messages
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
DWORD dwTime) // current system time
{
if (splash)
{
if (splashTimeout == 0)
{
splash = FALSE;
ShowWindow(hWnd, SW_HIDE);
if (waitForWindow && splashTimeoutErr)
{
KillTimer(hwnd, ID_TIMER);
signalError();
PostQuitMessage(0);
}
}
else
{
splashTimeout--;
if (waitForWindow)
{
EnumWindows(enumwndfn, 0);
}
}
}
GetExitCodeProcess(processInformation.hProcess, &dwExitCode);
if (dwExitCode != STILL_ACTIVE
|| !(splash || stayAlive))
{
KillTimer(hWnd, ID_TIMER);
PostQuitMessage(0);
}
}

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