Compare commits

...

16 Commits

Author SHA1 Message Date
432eff3e10 Added GitHub Actions workflow for building Launch5j.
Some checks failed
CI/CD / Build Launch5j (x64, MINGW64, x86_64) (push) Has been cancelled
CI/CD / Build Launch5j (x86, MINGW32, i686) (push) Has been cancelled
CI/CD / Generate Docs (push) Has been cancelled
CI/CD / Build Example (push) Has been cancelled
CI/CD / Generate Release Package (push) Has been cancelled
2024-10-01 16:11:55 +02:00
0a36344f49 Bump version. 2024-09-29 18:10:59 +02:00
02931280d0 Added runtime option for *not* setting the current working directory to the executable directory. 2024-09-29 16:23:11 +02:00
9d27eb5a98 Limit the Java heap size to 1024 MB when 32-Bit JVM was detected. 2023-03-28 22:14:45 +02:00
2d5b01092b Allow options 'ID_STR_HEAPMIN' and 'ID_STR_HEAPMAX' to be set independently. 2023-03-26 20:50:13 +02:00
656d4145c1 Added configuration options to set the minimum/maximum JVM heap size as percentage of the total physical memory. 2023-03-26 18:28:19 +02:00
735a0839ee Added detection of Eclipse Adoptium JRE/JDK (supersedes AdoptOpenJDK). 2023-03-26 16:19:00 +02:00
548787d7b2 Fixed build with latest version of MSYS2/Mingw-w64. 2023-03-26 15:52:00 +02:00
60916768ac Improved generation of the manifest + small tweak to Makefile generator code. 2020-10-06 13:14:30 +02:00
bee745b199 Updated README file. 2020-10-05 19:51:45 +02:00
928887d979 Small Makefile improvement. 2020-10-05 19:35:32 +02:00
d95313cd98 Improved error handling + updated README file. 2020-10-05 18:48:01 +02:00
9e73dfa2c5 Make sure that dependency on Common Control v6.0 is only included in GUI versions. 2020-10-05 14:15:02 +02:00
26ac902313 Print messages directly to console in non-GUI mode. 2020-10-05 00:04:27 +02:00
2a5e624757 Added support for "windows" (GUI) and "console" mode. 2020-10-04 22:10:58 +02:00
77c12f0c54 Small update to screenshot. 2020-10-04 18:40:04 +02:00
15 changed files with 874 additions and 318 deletions

113
.github/workflows/build-l5j.yml vendored Normal file
View File

@ -0,0 +1,113 @@
name: "CI/CD"
on:
push:
branches: ['**']
pull_request:
release:
types: [published]
jobs:
build:
name: Build Launch5j
runs-on: windows-2019
strategy:
matrix:
include:
- flavor: "x86"
msystem: "MINGW32"
toolchain: "i686"
- flavor: "x64"
msystem: "MINGW64"
toolchain: "x86_64"
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: mingw-w64-${{ matrix.toolchain }}-toolchain base-devel git
- uses: actions/checkout@v4
- shell: msys2 {0}
run: make -B
- uses: actions/upload-artifact@v4
with:
name: launch5j-bin-${{ matrix.flavor }}
path: bin/*.exe
example:
name: Build Example
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "temurin"
architecture: x64
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: launch5j-bin-x86
path: bin
- run: |
ant -noinput -buildfile src/example/build.xml
mkdir -p /var/tmp/launch5j-example
cp -f bin/launch5j_x86_wrapped_registry.exe /var/tmp/launch5j-example/example.exe
dd if=src/example/dist/example.jar of=/var/tmp/launch5j-example/example.exe oflag=append conv=notrunc
- uses: actions/upload-artifact@v4
with:
name: launch5j-example
path: /var/tmp/launch5j-example/*
docs:
name: Generate Docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: docker://pandoc/core:2.9
with:
args: >-
-f markdown-implicit_figures -t html5
--standalone --ascii --toc --toc-depth=2
--css="etc/css/gh-pandoc.css"
-o "./README.html" "./README.yaml" "./README.md"
- uses: actions/upload-artifact@v4
with:
name: launch5j-doc
path: |
LICENSE.txt
README.html
etc/img/*.png
etc/css/*.css
release:
name: Generate Release Package
needs: [build, example, docs]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
name: launch5j-doc
- uses: actions/download-artifact@v4
with:
name: launch5j-bin-x86
- uses: actions/download-artifact@v4
with:
name: launch5j-bin-x64
path: x64
- uses: actions/download-artifact@v4
with:
name: launch5j-example
path: example
- run: |
mkdir -p /var/tmp/launch5j-release
tar -czvf /var/tmp/launch5j-release/launch5j-bin.$(date +"%Y-%m-%d").tar.gz *
- uses: actions/upload-artifact@v4
with:
name: launch5j-release
path: /var/tmp/launch5j-release/*
- if: ${{ github.event_name == 'release' }}
uses: Roang-zero1/github-upload-release-artifacts-action@v2
with:
args: /var/tmp/launch5j-release/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,4 +1,4 @@
Copyright 2020 LoRd_MuldeR <mulder2@gmx.de>
Copyright 2024 LoRd_MuldeR <mulder2@gmx.de>
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

416
Makefile
View File

@ -39,10 +39,7 @@ else
SUFFIX = g.exe
endif
CFLAGS += -municode -mwindows -march=$(MARCH) -mtune=$(MTUNE)
LDFLAGS = -lcomctl32
MANIFEST := tmp/assets/manifest.$(CPU_ARCH).xml
CFLAGS += -municode -march=$(MARCH) -mtune=$(MTUNE)
# ==========================================================
# Targets
@ -57,285 +54,418 @@ initialize:
mkdir -p obj
mkdir -p tmp
.PHONY: resources
resources: initialize $(MANIFEST)
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/common.$(CPU_ARCH).o res/common.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/registry.$(CPU_ARCH).o res/registry.rc
.PHONY: manifests
manifests: initialize
@mkdir -p tmp/assets
sed -e 's/$${{version}}/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(BUILDNO)/g' -e 's/$${{processorArchitecture}}/$(CPU_ARCH)/g' res/assets/manifest-console.xml > tmp/assets/manifest-console.$(CPU_ARCH).xml
sed -e 's/$${{version}}/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(BUILDNO)/g' -e 's/$${{processorArchitecture}}/$(CPU_ARCH)/g' res/assets/manifest-windows.xml > tmp/assets/manifest-windows.$(CPU_ARCH).xml
$(MANIFEST):
mkdir -p $(@D)
sed -e 's/$${{version}}/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(BUILDNO)/g' -e 's/$${{processorArchitecture}}/$(CPU_ARCH)/g' res/assets/manifest.xml > $@
.PHONY: resources
resources: manifests
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/common.$(CPU_ARCH).o res/common.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/manifest-console.$(CPU_ARCH).o res/manifest-console.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/manifest-windows.$(CPU_ARCH).o res/manifest-windows.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/registry.$(CPU_ARCH).o res/registry.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc
.PHONY: clean
clean: init
$(RM) bin/*.$(SUFFIX)
$(RM) obj/*.o
clean: initialize
find bin -type f -delete
find obj -type f -delete
find tmp -type f -delete
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.PHONY: l5j_0811A25A
l5j_0811A25A: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH).exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_B855
launch5j_B855: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH).exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH).exe
endif
.PHONY: l5j_42469150
l5j_42469150: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_A2FE
launch5j_A2FE: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_noenc.exe
endif
.PHONY: l5j_F81FDB78
l5j_F81FDB78: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_D99E
launch5j_D99E: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nosplash.exe
endif
.PHONY: l5j_7CF91784
l5j_7CF91784: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_6DCE
launch5j_6DCE: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe
endif
.PHONY: l5j_E587E52D
l5j_E587E52D: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_9E54
launch5j_9E54: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait.exe
endif
.PHONY: l5j_6E20D95A
l5j_6E20D95A: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_1CDC
launch5j_1CDC: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe
endif
.PHONY: l5j_DA0AF4B3
l5j_DA0AF4B3: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_459A
launch5j_459A: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe
endif
.PHONY: l5j_C2A28D42
l5j_C2A28D42: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_AA99
launch5j_AA99: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe
endif
.PHONY: l5j_C1D101EB
l5j_C1D101EB: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_2F4C
launch5j_2F4C: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry.exe
endif
.PHONY: l5j_8ACFCE06
l5j_8ACFCE06: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_1A0D
launch5j_1A0D: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_noenc.exe
endif
.PHONY: l5j_9323B28F
l5j_9323B28F: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_9AA2
launch5j_9AA2: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe
endif
.PHONY: l5j_C522BC06
l5j_C522BC06: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_7178
launch5j_7178: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe
endif
.PHONY: l5j_6DDBAE3A
l5j_6DDBAE3A: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_A25D
launch5j_A25D: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait.exe
endif
.PHONY: l5j_54363F57
l5j_54363F57: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_20DF
launch5j_20DF: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe
endif
.PHONY: l5j_99A9F076
l5j_99A9F076: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_8568
launch5j_8568: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe
endif
.PHONY: l5j_87BC92B7
l5j_87BC92B7: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_2BCA
launch5j_2BCA: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe
endif
.PHONY: l5j_23E70F95
l5j_23E70F95: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_7B70
launch5j_7B70: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped.exe
endif
.PHONY: l5j_F7BB2C3A
l5j_F7BB2C3A: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_91AC
launch5j_91AC: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe
endif
.PHONY: l5j_3D20DF32
l5j_3D20DF32: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_FA0C
launch5j_FA0C: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe
endif
.PHONY: l5j_4C98F897
l5j_4C98F897: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_2559
launch5j_2559: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe
endif
.PHONY: l5j_F294C7A0
l5j_F294C7A0: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_2EFE
launch5j_2EFE: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe
endif
.PHONY: l5j_73B5E7E2
l5j_73B5E7E2: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_8F9C
launch5j_8F9C: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe
endif
.PHONY: l5j_954D523C
l5j_954D523C: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_3478
launch5j_3478: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe
endif
.PHONY: l5j_DC741815
l5j_DC741815: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_4F5B
launch5j_4F5B: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe
endif
.PHONY: l5j_2627E161
l5j_2627E161: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_2A1E
launch5j_2A1E: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe
endif
.PHONY: l5j_D900AE4B
l5j_D900AE4B: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_FE04
launch5j_FE04: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe
endif
.PHONY: l5j_C6E02423
l5j_C6E02423: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_2BCE
launch5j_2BCE: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe
endif
.PHONY: l5j_1AA2C98F
l5j_1AA2C98F: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_9D63
launch5j_9D63: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe
endif
.PHONY: l5j_C0460A41
l5j_C0460A41: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_F5D7
launch5j_F5D7: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe
endif
.PHONY: l5j_795967C2
l5j_795967C2: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_33A4
launch5j_33A4: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=1 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/splash_screen.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe
endif
.PHONY: l5j_33D9B9BD
l5j_33D9B9BD: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_D3FD
launch5j_D3FD: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe
endif
.PHONY: l5j_ECB0C2F6
l5j_ECB0C2F6: resources
$(CC) $(CFLAGS) -DL5J_BUILDNO=$(BUILDNO) -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o $(LDFLAGS)
.PHONY: launch5j_D36F
launch5j_D36F: resources
$(CC) $(CFLAGS) -mwindows -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=1 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-windows.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o -lcomctl32
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe
endif
.PHONY: launch5j_F945
launch5j_F945: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui.exe
endif
.PHONY: launch5j_4745
launch5j_4745: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_noenc.exe
endif
.PHONY: launch5j_01E0
launch5j_01E0: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_nowait.exe
endif
.PHONY: launch5j_78AA
launch5j_78AA: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_nowait_noenc.exe
endif
.PHONY: launch5j_B8C6
launch5j_B8C6: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_registry.exe
endif
.PHONY: launch5j_3848
launch5j_3848: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_registry_noenc.exe
endif
.PHONY: launch5j_778B
launch5j_778B: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_registry_nowait.exe
endif
.PHONY: launch5j_627C
launch5j_627C: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=0 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_registry_nowait_noenc.exe
endif
.PHONY: launch5j_66EE
launch5j_66EE: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped.exe
endif
.PHONY: launch5j_9FFA
launch5j_9FFA: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_noenc.exe
endif
.PHONY: launch5j_7C79
launch5j_7C79: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_nowait.exe
endif
.PHONY: launch5j_2928
launch5j_2928: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=0 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_nowait_noenc.exe
endif
.PHONY: launch5j_8EFD
launch5j_8EFD: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry.exe
endif
.PHONY: launch5j_59FE
launch5j_59FE: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=1 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry_noenc.exe
endif
.PHONY: launch5j_C25B
launch5j_C25B: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=1 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry_nowait.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry_nowait.exe
endif
.PHONY: launch5j_DAFA
launch5j_DAFA: resources
$(CC) $(CFLAGS) -mconsole -DL5J_BUILDNO=$(BUILDNO) -DL5J_ENABLE_GUI=0 -DL5J_JAR_FILE_WRAPPED=1 -DL5J_DETECT_REGISTRY=1 -DL5J_STAY_ALIVE=0 -DL5J_ENABLE_SPLASH=0 -DL5J_ENCODE_ARGS=0 -o bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry_nowait_noenc.exe src/head.c obj/common.$(CPU_ARCH).o obj/manifest-console.$(CPU_ARCH).o obj/registry.$(CPU_ARCH).o
ifeq ($(DEBUG),0)
strip bin/launch5j_$(CPU_ARCH)_nogui_wrapped_registry_nowait_noenc.exe
endif
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ALL
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.PHONY: all
all: \
l5j_0811A25A \
l5j_42469150 \
l5j_F81FDB78 \
l5j_7CF91784 \
l5j_E587E52D \
l5j_6E20D95A \
l5j_DA0AF4B3 \
l5j_C2A28D42 \
l5j_C1D101EB \
l5j_8ACFCE06 \
l5j_9323B28F \
l5j_C522BC06 \
l5j_6DDBAE3A \
l5j_54363F57 \
l5j_99A9F076 \
l5j_87BC92B7 \
l5j_23E70F95 \
l5j_F7BB2C3A \
l5j_3D20DF32 \
l5j_4C98F897 \
l5j_F294C7A0 \
l5j_73B5E7E2 \
l5j_954D523C \
l5j_DC741815 \
l5j_2627E161 \
l5j_D900AE4B \
l5j_C6E02423 \
l5j_1AA2C98F \
l5j_C0460A41 \
l5j_795967C2 \
l5j_33D9B9BD \
l5j_ECB0C2F6
launch5j_B855 \
launch5j_A2FE \
launch5j_D99E \
launch5j_6DCE \
launch5j_9E54 \
launch5j_1CDC \
launch5j_459A \
launch5j_AA99 \
launch5j_2F4C \
launch5j_1A0D \
launch5j_9AA2 \
launch5j_7178 \
launch5j_A25D \
launch5j_20DF \
launch5j_8568 \
launch5j_2BCA \
launch5j_7B70 \
launch5j_91AC \
launch5j_FA0C \
launch5j_2559 \
launch5j_2EFE \
launch5j_8F9C \
launch5j_3478 \
launch5j_4F5B \
launch5j_2A1E \
launch5j_FE04 \
launch5j_2BCE \
launch5j_9D63 \
launch5j_F5D7 \
launch5j_33A4 \
launch5j_D3FD \
launch5j_D36F \
launch5j_F945 \
launch5j_4745 \
launch5j_01E0 \
launch5j_78AA \
launch5j_B8C6 \
launch5j_3848 \
launch5j_778B \
launch5j_627C \
launch5j_66EE \
launch5j_9FFA \
launch5j_7C79 \
launch5j_2928 \
launch5j_8EFD \
launch5j_59FE \
launch5j_C25B \
launch5j_DAFA

117
README.md
View File

@ -1,35 +1,58 @@
![Launch5j](etc/img/logo.png)
**Java JAR file wrapper for creating Windows native executables**
**Java JAR file wrapper for creating Windows&trade; native executables**
# Introduction
**Launch5j** is a reimagination of “Launch4j”, *with full Unicode support*. This is a tool for wrapping Java applications distributed as JARs in lightweight Windows native executables. The executable can be configured to search for a certain JRE version or use a bundled one. The wrapper also provides better user experience through an application icon, a native pre-JRE splash screen, and a Java download page in case the appropriate JRE cannot be found.
**Launch5j** is a reimagination of “Launch4j”, *with full Unicode support*. This is a tool for wrapping Java applications distributed as JARs in lightweight Windows&trade; native executables. The executable can be configured to search for a certain JRE version or use a bundled one. The wrapper also provides better user experience through an application icon, a native pre-JRE splash screen, and a Java download page in case the appropriate JRE cannot be found.
# Usage
There currently are two different ways to use Launch5j with your application code:
* ***Use the launcher executable with a separate JAR file***
* **Use the launcher executable with a separate JAR file**
Simply put the launcher executable (`launch5j.exe`) and your JAR file into the same directory. Launch5j will automatically detect the path of the JAR file based on the location of the executable file. More specifically, Launch5j detects the full path of the executable file and then replaces the `.exe` file extension with a `.jar` file extension. Of course, you can rename the `launch5j.exe` executable to whatever you prefer.
*For example:* If you application's JAR file is called `bazinga.jar`, pick the Launch5j variant of your choice, rename the Launch5j executable to `bazinga.exe`, and put these two files (JAR + EXE) into the “install”directory.
***For example:*** Assuming your application's JAR file is called `thingamabob.jar`, pick the Launch5j launcher variant of your choice (**no** `wrapped` variant though!), rename the launcher executable to `thingamabob.exe`, and put these two files into the “install” directory. Also, the Java runtime should be located in the `runtime` sub-directory within the “install” directory &ndash; unless you are using the `registry` variant of Launch5j.
* ***Combine the launcher executable and the JAR file (“wrapping”)***
```
install_dir
├── thingamabob.exe
├── thingamabob.jar
├── runtime
│ └── bin
│ ├── java.exe
│ ├── javaw.exe
│ └── [...]
└── [...]
```
* **Combine the launcher executable and the JAR file (“wrapping”)**
In order to combine the launcher executable (`launch5j_wrapped.exe`) and the JAR file to a *single* file, you can simply concatenate these files. The executable launcher must go before the JAR file content. There are many ways to achieve this, but one method is by running the following **copy** command-line in the terminal:
In order to combine the Launch5j launcher executable and the JAR file to a ***single*** file, you can simply *concatenate* these two files. For this purpose, you have to choose one of the `wrapped` variants of Launch5j. Also, the executable launcher code must go before the JAR file content. There are many ways to achieve this, but probably the most simple method is running the following **copy** command-line in the terminal:
copy /B launch5j_wrapped.exe + bazinga.jar bazinga.exe
copy /B launch5j_wrapped.exe + thingamabob.jar thingamabob.exe
If you are building you application with [**Apache Ant**](https://ant.apache.org/), consider using the `concat` task like this:
If you are building your application with [**Apache Ant**](https://ant.apache.org/), consider using the `concat` task like this:
<concat destfile="bazinga.exe" binary="true">
<concat destfile="thingamabob.exe" binary="true">
<fileset file="launch5j_wrapped.exe"/>
<fileset file="bazinga.jar"/>
<fileset file="thingamabob.jar"/>
</concat>
The resulting `bazinga.exe` will be fully self-contained and is the only file you'll need to ship.
The resulting `thingamabob.exe` is fully self-contained, **no** separate JAR file needs to be shipped. Still, a Java runtime is required to run the application! The Java runtime should be located in the `runtime` sub-directory within the “install” directory &ndash; unless you are using the `registry` variant of Launch5j.
```
install_dir
├── thingamabob.exe
├── runtime
│ └── bin
│ ├── java.exe
│ ├── javaw.exe
│ └── [...]
└── [...]
```
**Warning:** Code signing, as with Microsoft&reg;'s `SignTool`, probably does **not** work with the “wrapped” executable file! If code signing is a requirement, please use a *separate* JAR file and just sing the launcher executable.
@ -38,20 +61,25 @@ There currently are two different ways to use Launch5j with your application cod
Launch5j executables come in a number of variants, allowing you to pick the most suitable one for your project:
* **`nogui`**
No graphical user interface is created and the Java application is launched via the `java.exe` (console mode) program; default variant launches the Java application via the `javaw.exe` (windowed mode) program.
*Note:* If using this variant, the program should be called from within a terminal window!
* **`wrapped`**
Expects that the JAR file and the executable launcher have been combined to a *single* file; default variant expects that a separate JAR file is present in the same directory where the executable launcher resides.
* **`registry`**
Tries to automatically detect the install path of the JRE from the Windows registry; default variant expects the JRE to be located in the `/runtime` path relative to the location of the executable launcher.
Tries to automatically detect the install path of the JRE from the Windows&trade; registry; default variant expects the JRE to be located in the `runtime` path relative to the location of the executable launcher.
At this time, the following Java distributions can be detected from the registry:
- [Oracle JDK (JavaSoft)](https://www.oracle.com/java/technologies/javase-downloads.html)
- [AdoptOpenJDK](https://adoptopenjdk.net/)
- [Eclipse Adoptium](https://adoptium.net/)
- [Liberica OpenJDK](https://bell-sw.com/)
- [Zulu OpenJDK](https://www.azul.com/downloads/zulu-community/)
Regarding the different available distributions of Java, please refer to this document:
[*Java Is Still Free*](https://docs.google.com/document/d/1nFGazvrCvHMZJgFstlbzoHjpAVwv5DEdnaBr_5pKuHo/preview)
[***Java Is Still Free***](https://docs.google.com/document/d/1nFGazvrCvHMZJgFstlbzoHjpAVwv5DEdnaBr_5pKuHo/preview)
* **`nowait`**
Does **not** keep the launcher executable alive while the application is running; default variant keeps the launcher executable alive until the application terminates and then forwards the application's exit code.
@ -64,9 +92,9 @@ Launch5j executables come in a number of variants, allowing you to pick the most
## Supported platforms
All of the above Launch5j variants are available as `x86` (32-Bit) and `x64` (64-Bit) executables. The `x86` (32-Bit) executables can run on *32-Bit* and *64-Bit* versions of Microsoft&reg; Windows&trade;, whereas the `x64` (64-Bit) executables require a *64-Bit* version of Microsoft&reg; Windows&trade;. Consequently, it is generally recommended to distribute the `x86` (32-Bit) launcher executable. Please note that this does **not** restrict the “bitness” of the JRE that can be used. Even the `x86` (32-Bit) launcher executable is perfectly able to detect and launch a *64-Bit* JRE &ndash; if it is available.
All of the above Launch5j variants are available as `x86` (32-Bit) and `amd64` (64-Bit) executables. The `x86` (32-Bit) executables can run on *32-Bit* and *64-Bit* versions of Microsoft&reg; Windows&trade;, whereas the `amd64` (64-Bit) executables require a *64-Bit* version of Microsoft&reg; Windows&trade;. Consequently, it is generally recommended to distribute the `x86` (32-Bit) launcher executable. Please note that this does **not** restrict the “bitness” of the JRE that can be used. Even the `x86` (32-Bit) launcher executable is perfectly able to detect and launch a *64-Bit* JRE &ndash; if it is available.
*Note:* Launch5j has been tested to work correctly on Windows XP (Service Pack 2), or a compatible newer version.
*Note:* Launch5j has been tested to work correctly on Windows XP with Service Pack 3, or a compatible newer version.
# Customizations
@ -81,24 +109,24 @@ It is ***not*** necessary to re-build the executable files for that purpose. Ins
Some options can be configured via the launcher executable's [STRINGTABLE](https://docs.microsoft.com/en-us/windows/win32/menurc/stringtable-resource) resource:
* **`ID_STR_HEADING` (#1)**
* **`ID_STR_HEADING` (0x1)**
Specifies a custom application title that will be used, e.g., as the heading of message boxes.
* **`ID_STR_JVMARGS` (#2)**
* **`ID_STR_JVMARGS` (0x2)**
Specifies *additional* options JVM options to be passed, such as `-Xmx2g` or `-Dproperty=value`.
See here for a list of available options:
<https://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html>
* **`ID_STR_CMDARGS` (#3)**
* **`ID_STR_CMDARGS` (0x3)**
Specifies *additional* fixed command-line parameters to be passed to the Java application.
* **`ID_STR_JREPATH` (#4)**
* **`ID_STR_JREPATH` (0x4)**
Specifies the path to the Java runtime (`javaw.exe`) relative to the launcher executable location.
If not specified, then the *default* runtime path `runtime\\bin\\javaw.exe` is assumed.
(This option does **not** apply to the “registry” variant of Launch5j)
* **`ID_STR_MUTEXID` (#5)**
* **`ID_STR_MUTEXID` (0x5)**
Specifies the application ID to be used when creating the [*single-instance*](http://www.bcbjournal.org/articles/vol3/9911/Single-instance_applications.htm) mutex.
The ID **must** be at least 5 characters in length and **should** be a *unique* string for each application!
If not specified, then **no** mutex will be created and thus *multiple* instances will be allowed.
@ -107,7 +135,24 @@ Some options can be configured via the launcher executable's [STRINGTABLE](https
(This option does **not** apply to the “nowait” variant of Launch5j)
* **`ID_STR_JAVAMIN` (#6)**
* **`ID_STR_HEAPMIN` (0x6)**
Specifies the the ***minimum*** Java heap size (i.e. JVM option `-Xms`), as percentage of the total physical memory.
This value must be an integral value in the `1` to `100` range.
(If `ID_STR_HEAPMAX` is specified too, then this value **must** be less than or equal to `ID_STR_HEAPMAX`).
* **`ID_STR_HEAPMAX` (0x7)**
Specifies the the ***maximum*** Java heap size (i.e. JVM option `-Xmx`), as percentage of the total physical memory.
This value must be an integral value in the `1` to `100` range.
(If `ID_STR_HEAPMIN` is specified too, then this value **must** be greater than or equal to `ID_STR_HEAPMIN`).
* **`ID_STR_NSETCWD` (0x8)**
If set to a non-zero value, do ***not*** change the current working directory.
(By default, the current working directory is set to the directory where the executable file is located)
* **`ID_STR_JAVAMIN` (0x9)**
Specifies the ***minimum*** supported JRE version, in the **`w.x.y.z`** format (e.g. `11.0.0.0`).
This values is *inclusive*, i.e. the specified JRE version or any newer JRE version will be accepted.
If not specified, then the *default* minimum supported JRE version `8.0.0.0` applies.
@ -116,7 +161,7 @@ Some options can be configured via the launcher executable's [STRINGTABLE](https
(This option only applies to the “registry” variant of Launch5j)
* **`ID_STR_JAVAMAX` (#7)**
* **`ID_STR_JAVAMAX` (0xA)**
Specifies the ***maximum*** supported JRE version, in the **`w.x.y.z`** format (e.g. `12.0.0.0`).
This values is *exclusive*, i.e. only JRE versions *older* than the specified JRE version will be accepted.
If not specified, then there is **no** upper limit on the supported JRE version.
@ -125,15 +170,15 @@ Some options can be configured via the launcher executable's [STRINGTABLE](https
(This option only applies to the “registry” variant of Launch5j)
* **`ID_STR_BITNESS` (#8)**
* **`ID_STR_BITNESS` (0xB)**
Specifies the required ***bitness*** of the JRE. This can be either **`32`** (x86, aka i586) or **`64`** (x86-64).
If not specified, then 32-Bit *and* 64-Bit JREs are accepted, with a preference to 64-Bit.
(This option only applies to the “registry” variant of Launch5j)
* **`ID_STR_JAVAURL` (#9)**
* **`ID_STR_JAVAURL` (0xC)**
The Java download URL that will ne suggested, if **no** suitable JRE could be detected on the machine.
If not specified, wes suggest downloading OpenJDK as provided by the [AdoptOpenJDK](https://adoptopenjdk.net/) project.
If not specified, wes suggest downloading OpenJDK, as provided by the [Eclipse Adoptium](https://adoptium.net/) project.
*Hint:* The URL must begin with a `http://` or `https://` prefix; otherwise the URL will be ignored!
@ -197,9 +242,21 @@ The launcher executable recognizes the following “special” command-line opti
Enable experimental “slunk” mode; this is for experts only!
# Source code
# Downloads
The source code of **Launch5j** is available from the official Git mirrors at:
Official **Launch5j** download mirrors:
* <https://github.com/lordmulder/Launch5j/releases>
* <https://sourceforge.net/projects/muldersoft/files/Launch5j/>
* <https://bitbucket.org/muldersoft/launch5j/downloads/>
It is *highly recommended* to download Launch5j only from one of the mirrors listed above. We are **not** responsible for the integrity and trustworthiness of Launch5j downloads you may have received from other locations!
## Source code
**Launch5j** source code is available via [Git](https://git-scm.com/):
* `git clone https://github.com/lordmulder/Launch5j.git`
@ -210,7 +267,7 @@ The source code of **Launch5j** is available from the official Git mirrors at:
# Build instructions
In order to build **Launch5j** from the sources, it is recommended to use the [*GNU C Compiler* (GCC)](https://gcc.gnu.org/) for Windows, as provided by the [*Mingw-w64*](http://mingw-w64.org/) project. Other C compilers may work, but are **not** officially supported.
In order to build **Launch5j** from the sources, it is recommended to use the [*GNU C Compiler* (GCC)](https://gcc.gnu.org/) for Windows&trade;, as provided by the [*Mingw-w64*](http://mingw-w64.org/) project. Other C compilers may work, but are **not** officially supported.
Probably the most simple way to set up the required build environment is by installing the [**MSYS2**](https://www.msys2.org/) distribution, which includes *GCC* (Mingw-w64) as well as all the required build tools, such as *Bash*, *GNU make* and *Git*.
@ -244,7 +301,7 @@ This project is partly inspired by the “Launch4j” project, even though it ha
This work has been released under the MIT license:
Copyright 2020 LoRd_MuldeR <mulder2@gmx.de>
Copyright 2024 LoRd_MuldeR <mulder2@gmx.de>
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

View File

@ -65,7 +65,7 @@ for %%m in (32,64) do (
echo Build %%m-Bit
echo ========================================================================
echo.
call "%MSYS2_DIR%\msys2_shell.cmd" -mingw%%m -no-start -defterm -where "%~dp0" -c "make -B -j8"
call "%MSYS2_DIR%\msys2_shell.cmd" -mingw%%m -no-start -defterm -where "%~dp0" -c "make -B"
if not "!ERRORLEVEL!"=="0" goto:BuildHasFailed
echo.
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="com.muldersoft.launch5j" version="${{version}}" processorArchitecture="${{processorArchitecture}}"/>
<description>Launch5j</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application>
<asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

View File

@ -11,15 +11,10 @@
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--The ID below indicates application support for Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!--The ID below indicates application support for Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>

View File

@ -17,10 +17,6 @@
#include "../src/resource.h"
#ifndef L5J_CPU_ARCH
#error L5J_CPU_ARCH is not defined!
#endif
/////////////////////////////////////////////////////////////////////////////
// Neutral resources
/////////////////////////////////////////////////////////////////////////////
@ -46,6 +42,9 @@ BEGIN
ID_STR_CMDARGS L"?" /*additional command-line args*/
ID_STR_JREPATH L"?" /*relative path to JRE*/
ID_STR_MUTEXID L"?" /*single instance mutex ID*/
ID_STR_HEAPMIN L"?" /*min. heap size, in percent of phys. memory*/
ID_STR_HEAPMAX L"?" /*max. heap size, in percent of phys. memory*/
ID_STR_NSETCWD L"?" /*do not set current working directory*/
END
/////////////////////////////////////////////////////////////////////////////
@ -90,13 +89,3 @@ BEGIN
VALUE "Translation", 0x0, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
// Manifest
/////////////////////////////////////////////////////////////////////////////
#define L5J_MANIFEST_GLUE1(X,Y,Z) #X #Y #Z
#define L5J_MANIFEST_GLUE2(X,Y,Z) L5J_MANIFEST_GLUE1(X,Y,Z)
#define L5J_MANIFEST_STR L5J_MANIFEST_GLUE2(../tmp/assets/manifest.,L5J_CPU_ARCH,.xml)
1 RT_MANIFEST L5J_MANIFEST_STR

33
res/manifest-console.rc Normal file
View File

@ -0,0 +1,33 @@
/************************************************************/
/* Launch5j, by LoRd_MuldeR <MuldeR2@GMX.de> */
/* Java JAR wrapper for creating Windows native executables */
/* https://github.com/lordmulder/ */
/* */
/* This work has been released under the MIT license. */
/* Please see LICENSE.TXT for details! */
/* */
/* ACKNOWLEDGEMENT */
/* This project is partly inspired by the Launch4j project: */
/* https://sourceforge.net/p/launch4j/ */
/************************************************************/
#define APSTUDIO_READONLY_SYMBOLS
#include "WinResrc.h"
#undef APSTUDIO_READONLY_SYMBOLS
#include "../src/resource.h"
#ifndef L5J_CPU_ARCH
#error L5J_CPU_ARCH is not defined!
#endif
/////////////////////////////////////////////////////////////////////////////
// Manifest
/////////////////////////////////////////////////////////////////////////////
#define L5J_MANIFEST_GLUE1(X) #X
#define L5J_MANIFEST_GLUE2(X,Y,Z) L5J_MANIFEST_GLUE1(X.Y.Z)
#define L5J_MANIFEST_GLUE3(X,Y,Z) L5J_MANIFEST_GLUE2(X,Y,Z)
#define L5J_MANIFEST_STR L5J_MANIFEST_GLUE3(../tmp/assets/manifest-console,L5J_CPU_ARCH,xml)
1 RT_MANIFEST L5J_MANIFEST_STR

33
res/manifest-windows.rc Normal file
View File

@ -0,0 +1,33 @@
/************************************************************/
/* Launch5j, by LoRd_MuldeR <MuldeR2@GMX.de> */
/* Java JAR wrapper for creating Windows native executables */
/* https://github.com/lordmulder/ */
/* */
/* This work has been released under the MIT license. */
/* Please see LICENSE.TXT for details! */
/* */
/* ACKNOWLEDGEMENT */
/* This project is partly inspired by the Launch4j project: */
/* https://sourceforge.net/p/launch4j/ */
/************************************************************/
#define APSTUDIO_READONLY_SYMBOLS
#include "WinResrc.h"
#undef APSTUDIO_READONLY_SYMBOLS
#include "../src/resource.h"
#ifndef L5J_CPU_ARCH
#error L5J_CPU_ARCH is not defined!
#endif
/////////////////////////////////////////////////////////////////////////////
// Manifest
/////////////////////////////////////////////////////////////////////////////
#define L5J_MANIFEST_GLUE1(X) #X
#define L5J_MANIFEST_GLUE2(X,Y,Z) L5J_MANIFEST_GLUE1(X.Y.Z)
#define L5J_MANIFEST_GLUE3(X,Y,Z) L5J_MANIFEST_GLUE2(X,Y,Z)
#define L5J_MANIFEST_STR L5J_MANIFEST_GLUE3(../tmp/assets/manifest-windows,L5J_CPU_ARCH,xml)
1 RT_MANIFEST L5J_MANIFEST_STR

View File

@ -21,6 +21,8 @@
#include <sys/stat.h>
#include <errno.h>
#include <direct.h>
#include <fcntl.h>
#include <mbctype.h>
// Win32 API
#include <Windows.h>
@ -31,6 +33,9 @@
#include "resource.h"
// Options
#ifndef L5J_ENABLE_GUI
#error L5J_ENABLE_GUI flag is *not* defined!
#endif
#ifndef L5J_JAR_FILE_WRAPPED
#error L5J_JAR_FILE_WRAPPED flag is *not* defined!
#endif
@ -50,10 +55,17 @@
#define L5J_WAIT_FOR_WINDOW 1
#endif
// Checks
#if L5J_ENABLE_SPLASH && (!L5J_ENABLE_GUI)
#error L5J_ENABLE_SPLASH requires L5J_ENABLE_GUI to be enabled!
#endif
// Const
static const wchar_t *const JRE_DOWNLOAD_LINK_DEFAULT = L"https://adoptopenjdk.net/";
static const wchar_t *const JRE_RELATIVE_PATH_DEFAULT = L"runtime\\bin\\javaw.exe";
static const wchar_t *const JRE_DOWNLOAD_LINK_DEFAULT = L"https://adoptium.net/";
static const wchar_t *const JRE_RELATIVE_PATH_DEFAULT = L"runtime\\bin";
static const wchar_t *const JRE_EXECUTABLE_NAME = L5J_ENABLE_GUI ? L"javaw.exe" : L"java.exe";
static const size_t MIN_MUTEXID_LENGTH = 5U;
static const size_t BYTES_PER_MEGABYTE = 1024U * 1024U;
static const DWORD SPLASH_SCREEN_TIMEOUT = 30000U;
// Check platform
@ -61,13 +73,29 @@ static const DWORD SPLASH_SCREEN_TIMEOUT = 30000U;
#error Unknown target platform!
#endif
// Boolean value
/* ======================================================================== */
/* Miscellaneous */
/* ======================================================================== */
#define BOOLIFY(X) ((X) ? TRUE : FALSE)
#define PERCENT(X) (bound_value(1U, (X), 100U) / 100.0)
static DWORD bound_value(const DWORD min_value, const DWORD value, const DWORD max_value)
{
return max(min_value, min(max_value, value));
}
static ULONGLONG div_ceil(const ULONGLONG value, const ULONGLONG divisor)
{
return (!(value % divisor)) ? (value / divisor) : ((value / divisor) + 1ULL);
}
/* ======================================================================== */
/* String routines */
/* ======================================================================== */
static const wchar_t SPACE_CHAR = L'\x20';
#define XSTR(S) STR(S)
#define STR(S) #S
@ -135,13 +163,11 @@ static wchar_t *wcsndup (const wchar_t *const str, const size_t n)
return result;
}
static const wchar_t *skip_leading_spaces(const wchar_t *const str)
static const wchar_t *skip_leading_spaces(const wchar_t *str)
{
if (NOT_EMPTY(str))
{
const wchar_t *result;
for (result = str; (*result) && iswspace(*result); ++result);
return result;
for (; (*str) && (*str <= SPACE_CHAR); ++str);
}
return str;
}
@ -312,6 +338,18 @@ static BOOL running_on_64bit(void)
#endif
}
static ULONGLONG get_physical_memory_size()
{
MEMORYSTATUSEX memory_status;
SecureZeroMemory(&memory_status, sizeof(MEMORYSTATUSEX));
memory_status.dwLength = sizeof(MEMORYSTATUSEX);
if (GlobalMemoryStatusEx(&memory_status))
{
return memory_status.ullTotalPhys;
}
return 0L;
}
/* ======================================================================== */
/* File name routines */
/* ======================================================================== */
@ -510,7 +548,7 @@ static DWORD load_uint32(const HINSTANCE hinstance, const UINT id, const DWORD f
{
DWORD value = fallback;
const wchar_t *const str = load_string(hinstance, id);
if(NOT_EMPTY(str))
if(AVAILABLE(str))
{
value = wcstoul(str, NULL, 10);
}
@ -856,7 +894,7 @@ static ULONGLONG parse_java_version(const wchar_t *const version_str)
static DWORD detect_java_runtime_verify(const wchar_t **const executable_path_out, const HKEY root_key, const wchar_t *const full_reg_path, const BOOL reg_view_64bit)
{
static const wchar_t *const JAVA_REG_NAMES[] = { L"JavaHome", L"Path", L"InstallationPath", NULL };
static const wchar_t *const JAVA_EXE_PATHS[] = { L"%s\\jre\\bin\\javaw.exe", L"%s\\bin\\javaw.exe", NULL };
static const wchar_t *const JAVA_EXE_PATHS[] = { L"%s\\jre\\bin\\%s", L"%s\\bin\\%s", NULL };
*executable_path_out = NULL;
DWORD result = 0U;
@ -871,10 +909,10 @@ static DWORD detect_java_runtime_verify(const wchar_t **const executable_path_ou
{
for (size_t j = 0U; JAVA_EXE_PATHS[j] && (!result); ++j)
{
const wchar_t *const javaw_executable_path = aswprintf(JAVA_EXE_PATHS[j], java_home_path);
if (javaw_executable_path)
const wchar_t *const java_executable_path = aswprintf(JAVA_EXE_PATHS[j], java_home_path, JRE_EXECUTABLE_NAME);
if (java_executable_path)
{
const wchar_t *const absolute_executable_path = get_absolute_path(javaw_executable_path);
const wchar_t *const absolute_executable_path = get_absolute_path(java_executable_path);
if (absolute_executable_path)
{
const DWORD bitness = file_is_executable(absolute_executable_path);
@ -888,7 +926,7 @@ static DWORD detect_java_runtime_verify(const wchar_t **const executable_path_ou
free((void*)absolute_executable_path);
}
}
free((void*)javaw_executable_path);
free((void*)java_executable_path);
}
}
}
@ -931,7 +969,7 @@ static BOOL detect_java_runtime_scan_javasoft(const wchar_t *const key_name, con
return TRUE;
}
static BOOL detect_java_runtime_scan_adoptjdk(const wchar_t *const key_name, const ULONG_PTR user_data)
static BOOL detect_java_runtime_scan_adoptium(const wchar_t *const key_name, const ULONG_PTR user_data)
{
static const wchar_t *const JVM_NATURE[] = { L"hotspot", L"openj9", NULL };
@ -1006,20 +1044,22 @@ static BOOL detect_java_runtime_scan_liberica(const wchar_t *const key_name, con
return TRUE;
}
static const wchar_t *detect_java_runtime(const DWORD required_bitness, const ULONGLONG required_ver_min, const ULONGLONG required_ver_max)
static const wchar_t *detect_java_runtime(const DWORD required_bitness, const ULONGLONG required_ver_min, const ULONGLONG required_ver_max, DWORD *const bitness_out, ULONGLONG *const version_out)
{
typedef struct { UINT mode; const wchar_t *path; } reg_key_t;
static const reg_key_t REG_KEYS[] =
{
{ 1U, L"SOFTWARE\\JavaSoft\\Java Runtime Environment" }, { 1U, L"SOFTWARE\\JavaSoft\\JRE" }, { 2U, L"SOFTWARE\\AdoptOpenJDK\\JRE" },
{ 1U, L"SOFTWARE\\JavaSoft\\Java Development Kit" }, { 1U, L"SOFTWARE\\JavaSoft\\JDK" }, { 2U, L"SOFTWARE\\AdoptOpenJDK\\JDK" },
{ 1U, L"SOFTWARE\\Eclipse Adoptium\\JRE" }, { 1U, L"SOFTWARE\\AdoptOpenJDK\\JRE" },
{ 1U, L"SOFTWARE\\Eclipse Adoptium\\JDK" }, { 1U, L"SOFTWARE\\AdoptOpenJDK\\JDK" },
{ 2U, L"SOFTWARE\\JavaSoft\\Java Runtime Environment" }, { 2U, L"SOFTWARE\\JavaSoft\\JRE" },
{ 2U, L"SOFTWARE\\JavaSoft\\Java Development Kit" }, { 2U, L"SOFTWARE\\JavaSoft\\JDK" },
{ 3U, L"SOFTWARE\\BellSoft\\Liberica" },
{ 3U, L"SOFTWARE\\Azul Systems\\Zulu" }, { 0U, NULL }
};
const wchar_t *runtime_path = NULL;
DWORD bitness = 0U;
ULONGLONG version = 0U;
*bitness_out = 0U;
*version_out = 0U;
for (UINT i = running_on_64bit() ? 0U : 1U; i < 2U; ++i)
{
@ -1030,15 +1070,15 @@ static const wchar_t *detect_java_runtime(const DWORD required_bitness, const UL
{
{ required_bitness, required_ver_min, required_ver_max },
{ HKEY_LOCAL_MACHINE, REG_KEYS[j].path, reg_view_64bit },
{ bitness, version, NULL }
{ *bitness_out, *version_out, NULL }
};
switch(REG_KEYS[j].mode)
{
case 1U:
reg_enum_subkeys(HKEY_LOCAL_MACHINE, REG_KEYS[j].path, reg_view_64bit, detect_java_runtime_scan_javasoft, (ULONG_PTR)&search_state);
reg_enum_subkeys(HKEY_LOCAL_MACHINE, REG_KEYS[j].path, reg_view_64bit, detect_java_runtime_scan_adoptium, (ULONG_PTR)&search_state);
break;
case 2U:
reg_enum_subkeys(HKEY_LOCAL_MACHINE, REG_KEYS[j].path, reg_view_64bit, detect_java_runtime_scan_adoptjdk, (ULONG_PTR)&search_state);
reg_enum_subkeys(HKEY_LOCAL_MACHINE, REG_KEYS[j].path, reg_view_64bit, detect_java_runtime_scan_javasoft, (ULONG_PTR)&search_state);
break;
case 3U:
reg_enum_subkeys(HKEY_LOCAL_MACHINE, REG_KEYS[j].path, reg_view_64bit, detect_java_runtime_scan_liberica, (ULONG_PTR)&search_state);
@ -1046,14 +1086,14 @@ static const wchar_t *detect_java_runtime(const DWORD required_bitness, const UL
}
if(search_state.result.runtime_path)
{
bitness = search_state.result.bitness;
version = search_state.result.version;
*bitness_out = search_state.result.bitness;
*version_out = search_state.result.version;
SET_STRING(runtime_path, search_state.result.runtime_path);
}
}
}
if (((required_bitness == 0U) || (bitness == required_bitness)) && (version >= required_ver_min) && (version < required_ver_max) && runtime_path)
if (((required_bitness == 0U) || (*bitness_out == required_bitness)) && (*version_out >= required_ver_min) && (*version_out < required_ver_max) && runtime_path)
{
return runtime_path;
}
@ -1087,13 +1127,32 @@ static DWORD load_java_bitness(const HINSTANCE hinstance, const UINT id)
static const wchar_t *get_java_full_path(const wchar_t *const jre_base_path, const wchar_t *const jre_relative_path)
{
const wchar_t *const relative_path_ptr = AVAILABLE(jre_relative_path) ? skip_leading_separator(jre_relative_path) : NULL;
return aswprintf(L"%s\\%s", jre_base_path, NOT_EMPTY(relative_path_ptr) ? relative_path_ptr: JRE_RELATIVE_PATH_DEFAULT);
return aswprintf(L"%s\\%s\\%s", jre_base_path, NOT_EMPTY(relative_path_ptr) ? relative_path_ptr: JRE_RELATIVE_PATH_DEFAULT, JRE_EXECUTABLE_NAME);
}
/* ======================================================================== */
/* Command-line */
/* ======================================================================== */
static const wchar_t *get_commandline_args(const wchar_t *cmd_line)
{
BOOL double_quote = FALSE;
if (NOT_EMPTY(cmd_line))
{
cmd_line = skip_leading_spaces(cmd_line);
for (; (*cmd_line) && ((*cmd_line > SPACE_CHAR) || double_quote); ++cmd_line)
{
if (*cmd_line == L'"') double_quote = (!double_quote);
if (_ismbblead(*cmd_line) && cmd_line[1U]) ++cmd_line;
}
return skip_leading_spaces(cmd_line);
}
else
{
return L""; /*no args*/
}
}
static wchar_t *encode_commandline_args(const int argc, const LPWSTR *const argv)
{
if (!(argv && (argc > 0)))
@ -1169,6 +1228,29 @@ static const wchar_t *encode_commandline_str(const wchar_t *const command_line)
return encoded;
}
const wchar_t *create_heap_size_parameters(const DWORD jvm_heap_percent_min, const DWORD jvm_heap_percent_max, const wchar_t *const jvm_extra_args, const DWORD heap_size_limit)
{
const ULONGLONG physical_memory_size = get_physical_memory_size();
if (physical_memory_size > 33554432ULL)
{
const DWORD heap_size_mbytes_min = jvm_heap_percent_min ? bound_value(16U, (DWORD)div_ceil((ULONGLONG)(PERCENT(jvm_heap_percent_min) * physical_memory_size), BYTES_PER_MEGABYTE), heap_size_limit) : 0U;
const DWORD heap_size_mbytes_max = jvm_heap_percent_max ? bound_value(16U, (DWORD)div_ceil((ULONGLONG)(PERCENT(jvm_heap_percent_max) * physical_memory_size), BYTES_PER_MEGABYTE), heap_size_limit) : 0U;
if ((heap_size_mbytes_min > 0U) && (heap_size_mbytes_max >= heap_size_mbytes_min))
{
return AVAILABLE(jvm_extra_args)
? aswprintf(L"-Xms%um -Xmx%um %s", heap_size_mbytes_min, heap_size_mbytes_max, jvm_extra_args)
: aswprintf(L"-Xms%um -Xmx%um", heap_size_mbytes_min, heap_size_mbytes_max);
}
else if ((heap_size_mbytes_min > 0U) || (heap_size_mbytes_max > 0U))
{
return AVAILABLE(jvm_extra_args)
? aswprintf(L"-Xm%c%um %s", (heap_size_mbytes_max > 0U) ? L'x' : L's', (heap_size_mbytes_max > 0U) ? heap_size_mbytes_max : heap_size_mbytes_min, jvm_extra_args)
: aswprintf(L"-Xm%c%um", (heap_size_mbytes_max > 0U) ? L'x' : L's', (heap_size_mbytes_max > 0U) ? heap_size_mbytes_max : heap_size_mbytes_min);
}
}
return NULL;
}
static const wchar_t *build_commandline(const DWORD pid, const wchar_t *const java_runtime_path, const wchar_t *const jar_file_path, const wchar_t *const jvm_extra_args, const wchar_t *const cmd_extra_args, const wchar_t *const cmd_input_args)
{
const wchar_t *command_line;
@ -1344,7 +1426,11 @@ static const wchar_t *describe_system_error(const DWORD error_code)
return error_test;
}
#if L5J_ENABLE_GUI
#define show_message(HWND, FLAGS, TITLE, TEXT) MessageBoxW((HWND), (TEXT), (TITLE), (FLAGS))
#else
#define show_message(HWND, FLAGS, TITLE, TEXT) ({ __ms_fwprintf(stderr, L"[%s]\n\n%s\n", (TITLE), (TEXT)); fflush(stderr); IDCANCEL; })
#endif
static int show_message_format(HWND hwnd, const DWORD flags, const wchar_t *const title, const wchar_t *const format, ...)
{
@ -1355,7 +1441,7 @@ static int show_message_format(HWND hwnd, const DWORD flags, const wchar_t *cons
const wchar_t *const text = vaswprintf(format, ap );
if(NOT_EMPTY(text))
{
result = MessageBoxW(hwnd, text, title, flags);
result = show_message(hwnd, flags, title, text);
}
free((void*)text);
@ -1404,17 +1490,17 @@ static void show_about_dialogue(const HWND hwnd)
const wchar_t *const CPU_ARCH = L"x86";
#endif
show_message_format(hwnd, MB_ICONINFORMATION, L"About Launch5j",
L"Launch5j (%s), by LoRd_MuldeR <MuldeR2@GMX.de>\n"
L"v%u.%u.%u, build %u, created %s %s\n\n"
L"Launch5j, by LoRd_MuldeR <MuldeR2@GMX.de>\n"
L"Version: %u.%u.%u (%s), Build: #%u, %s\n\n"
L"This work has been released under the MIT license.\n"
L"For details, please see:\n"
L"https://opensource.org/licenses/MIT\n\n"
L"Check the project website for news and updates:\n"
L"https://github.com/lordmulder/\n\n"
L"Build options:\n"
L"JAR_FILE_WRAPPED=%d, DETECT_REGISTRY=%d, ENABLE_SPLASH=%d, STAY_ALIVE=%d, ENCODE_ARGS=%d, WAIT_FOR_WINDOW=%d",
CPU_ARCH, L5J_VERSION_MAJOR, L5J_VERSION_MINOR, L5J_VERSION_PATCH, L5J_BUILDNO, TEXT(__DATE__), TEXT(__TIME__),
L5J_JAR_FILE_WRAPPED, L5J_DETECT_REGISTRY, L5J_ENABLE_SPLASH, L5J_STAY_ALIVE, L5J_ENCODE_ARGS, L5J_WAIT_FOR_WINDOW);
L"L5J_ENABLE_GUI=%d, JAR_FILE_WRAPPED=%d, DETECT_REGISTRY=%d, ENABLE_SPLASH=%d, STAY_ALIVE=%d, ENCODE_ARGS=%d, WAIT_FOR_WINDOW=%d",
L5J_VERSION_MAJOR, L5J_VERSION_MINOR, L5J_VERSION_PATCH, CPU_ARCH, L5J_BUILDNO, TEXT(__DATE__),
L5J_ENABLE_GUI, L5J_JAR_FILE_WRAPPED, L5J_DETECT_REGISTRY, L5J_ENABLE_SPLASH, L5J_STAY_ALIVE, L5J_ENCODE_ARGS, L5J_WAIT_FOR_WINDOW);
}
static void enable_slunk_mode(const HWND hwnd)
@ -1439,25 +1525,31 @@ static void enable_slunk_mode(const HWND hwnd)
/* Single instance */
/* ======================================================================== */
static ULONGLONG hash_code(const BYTE *const message, const size_t message_len)
static void hash_update(ULONGLONG *const hash, const BYTE *const data, const size_t length)
{
for (size_t iter = 0U; iter < length; ++iter)
{
*hash ^= data[iter];
*hash *= 0x00000100000001B3ull;
}
}
static ULONGLONG hash_code(const DWORD salt, const BYTE *const message, const size_t message_len)
{
ULONGLONG hash = 0xCBF29CE484222325ull;
for (size_t iter = 0U; iter < message_len; ++iter)
{
hash ^= message[iter];
hash *= 0x00000100000001B3ull;
}
hash_update(&hash, (BYTE*)&salt, sizeof(DWORD));
hash_update(&hash, message, message_len);
return hash;
}
static BOOL initialize_mutex(HANDLE *const handle, const wchar_t *const mutex_name)
{
static const char *const BUILD_TIME = __DATE__ " " __TIME__;
const size_t name_length = sizeof(wchar_t) * wcslen(mutex_name);
const ULONGLONG hashcode_0 = hash_code((const BYTE*)BUILD_TIME, sizeof(wchar_t) * strlen(BUILD_TIME));
const ULONGLONG hashcode_1 = hash_code((const BYTE*)mutex_name, sizeof(wchar_t) * wcslen(mutex_name));
const ULONGLONG hash_0 = hash_code(0x6CAD7ECA, (const BYTE*)mutex_name, name_length);
const ULONGLONG hash_1 = hash_code(0xE2503816, (const BYTE*)mutex_name, name_length);
const wchar_t *const mutex_uuid = aswprintf(L"l5j.%016llX%016llX", hashcode_0, hashcode_1);
const wchar_t *const mutex_uuid = aswprintf(L"l5j.%016I64x%016I64x", hash_0, hash_1);
if (!mutex_uuid)
{
return TRUE; /*better safe than sorry*/
@ -1514,21 +1606,23 @@ static void destroy_window(HWND *const hwnd)
static wchar_t *const DEFAULT_HEADING = L"Launch5j";
#define APP_HEADING (AVAILABLE(app_heading) ? app_heading : DEFAULT_HEADING)
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLine, int _nCmdShow)
static int launch5j_main(const HINSTANCE hinstance, const wchar_t *const cmd_line_args)
{
int result = -1;
const wchar_t *app_heading = NULL, *mutex_name = NULL, *executable_path = NULL, *executable_directory = NULL, *jarfile_path = NULL,
*java_runtime_path = NULL, *jre_relative_path = NULL, *jvm_extra_args = NULL, *cmd_extra_args = NULL, *command_line = NULL;
HANDLE mutex_handle = NULL;
DWORD java_required_bitness = 0U;
ULONGLONG java_required_ver_min = 0ULL, java_required_ver_max = 0ULL;
DWORD java_required_bitness = 0U, jvm_heap_percent_min = 0U, jvm_heap_percent_max = 0U, jvm_bitness = 0U;
ULONGLONG java_required_ver_min = 0ULL, java_required_ver_max = 0ULL, jvm_version = 0ULL;
HGDIOBJ splash_image = NULL;
BOOL have_screen_created = FALSE;
BOOL have_screen_created = FALSE, set_current_directory_enabled = TRUE;
PROCESS_INFORMATION process_info;
STARTUPINFOW startup_info;
// Ensure that the ComCtl32 DLL is loaded
#if L5J_ENABLE_GUI
InitCommonControls();
#endif
// Initialize
SecureZeroMemory(&startup_info, sizeof(STARTUPINFOW));
@ -1538,18 +1632,18 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
const DWORD pid = GetCurrentProcessId();
// Load title
app_heading = load_string(hInstance, ID_STR_HEADING);
app_heading = load_string(hinstance, ID_STR_HEADING);
// Create the window
HWND hwnd = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, L"STATIC", APP_HEADING, WS_POPUP | SS_BITMAP, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
HWND hwnd = L5J_ENABLE_GUI ? CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, L"STATIC", APP_HEADING, WS_POPUP | SS_BITMAP, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hinstance, NULL) : NULL;
// Show about screen?
if (starts_with(pCmdLine, L"--l5j-about"))
if (starts_with(cmd_line_args, L"--l5j-about"))
{
show_about_dialogue(hwnd);
return 0;
}
if (starts_with(pCmdLine, L"--l5j-slunk"))
if (starts_with(cmd_line_args, L"--l5j-slunk"))
{
enable_slunk_mode(hwnd);
return 0;
@ -1557,7 +1651,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
// Single instance
#if L5J_STAY_ALIVE
mutex_name = load_string(hInstance, ID_STR_MUTEXID);
mutex_name = load_string(hinstance, ID_STR_MUTEXID);
if (AVAILABLE(mutex_name) && (wcslen(mutex_name) >= MIN_MUTEXID_LENGTH + ((mutex_name[0U] == L'@') ? 0U : 1U)))
{
if(!initialize_mutex(&mutex_handle, (mutex_name[0U] == L'@') ? mutex_name + 1U : mutex_name))
@ -1574,7 +1668,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
// Show the splash screen
#if L5J_ENABLE_SPLASH
if ((splash_image = LoadImage(hInstance, MAKEINTRESOURCE(ID_BITMAP_SPLASH), IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE)))
if ((splash_image = LoadImage(hinstance, MAKEINTRESOURCE(ID_BITMAP_SPLASH), IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE)))
{
if (create_splash_screen(hwnd, splash_image))
{
@ -1599,7 +1693,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
}
// Set the current directory
if (_wcsicmp(executable_directory, L".") != 0)
if (set_current_directory_enabled = (!BOOLIFY(load_uint32(hinstance, ID_STR_NSETCWD, 0U))))
{
set_current_directory(executable_directory);
}
@ -1622,23 +1716,23 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
// Find the Java runtime executable path (possibly from the registry)
#if L5J_DETECT_REGISTRY
java_required_ver_min = load_java_version(hInstance, ID_STR_JAVAMIN, (8ull << 48));
java_required_ver_max = load_java_version(hInstance, ID_STR_JAVAMAX, MAXULONGLONG);
java_required_bitness = load_java_bitness(hInstance, ID_STR_BITNESS);
if (!(java_runtime_path = detect_java_runtime(java_required_bitness, java_required_ver_min, java_required_ver_max)))
java_required_ver_min = load_java_version(hinstance, ID_STR_JAVAMIN, (8ull << 48));
java_required_ver_max = load_java_version(hinstance, ID_STR_JAVAMAX, MAXULONGLONG);
java_required_bitness = load_java_bitness(hinstance, ID_STR_BITNESS);
if (!(java_runtime_path = detect_java_runtime(java_required_bitness, java_required_ver_min, java_required_ver_max, &jvm_bitness, &jvm_version)))
{
show_message(hwnd, MB_ICONERROR | MB_TOPMOST, APP_HEADING, L"Java Runtime Environment (JRE) could not be found!");
show_jre_download_notice(hInstance, hwnd, APP_HEADING, java_required_bitness, java_required_ver_min);
show_jre_download_notice(hinstance, hwnd, APP_HEADING, java_required_bitness, java_required_ver_min);
goto cleanup;
}
#else
jre_relative_path = load_string(hInstance, ID_STR_JREPATH);
if (!(java_runtime_path = get_java_full_path(executable_path, jre_relative_path)))
jre_relative_path = load_string(hinstance, ID_STR_JREPATH);
if (!(java_runtime_path = get_java_full_path(executable_directory, jre_relative_path)))
{
show_message(hwnd, MB_ICONERROR | MB_TOPMOST, APP_HEADING, L"The path of the Java runtime could not be determined!");
goto cleanup;
}
if (!BOOLIFY(file_is_executable(java_runtime_path)))
if (!BOOLIFY(jvm_bitness = file_is_executable(java_runtime_path)))
{
show_message_format(hwnd, MB_ICONERROR | MB_TOPMOST, APP_HEADING, L"The Java runtime could not be found or is invalid:\n\n%s\n\n\nRe-installing the application may fix the problem!", java_runtime_path);
goto cleanup;
@ -1646,11 +1740,24 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
#endif
// Load additional options
jvm_extra_args = load_string(hInstance, ID_STR_JVMARGS);
cmd_extra_args = load_string(hInstance, ID_STR_CMDARGS);
jvm_extra_args = load_string(hinstance, ID_STR_JVMARGS);
cmd_extra_args = load_string(hinstance, ID_STR_CMDARGS);
// Set minimum/maximum Java heap size
jvm_heap_percent_min = bound_value(0U, load_uint32(hinstance, ID_STR_HEAPMIN, 0U), 100U);
jvm_heap_percent_max = bound_value(0U, load_uint32(hinstance, ID_STR_HEAPMAX, 0U), 100U);
if ((jvm_heap_percent_min > 0U) || (jvm_heap_percent_max > 0U))
{
const wchar_t *const jvm_heap_size_args = create_heap_size_parameters(jvm_heap_percent_min, jvm_heap_percent_max, jvm_extra_args, (jvm_bitness && (jvm_bitness < 64U)) ? 1024U : MAXDWORD);
if (jvm_heap_size_args)
{
free((void*)jvm_extra_args);
jvm_extra_args = jvm_heap_size_args;
}
}
// Make sure command-line was created
command_line = build_commandline(pid, java_runtime_path, jarfile_path, jvm_extra_args, cmd_extra_args, pCmdLine);
command_line = build_commandline(pid, java_runtime_path, jarfile_path, jvm_extra_args, cmd_extra_args, cmd_line_args);
if (!command_line)
{
show_message(hwnd, MB_ICONERROR | MB_TOPMOST, APP_HEADING, L"The Java command-line could not be generated!");
@ -1663,7 +1770,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin
#endif
// Now actually start the process!
if (!CreateProcessW(NULL, (LPWSTR)command_line, NULL, NULL, FALSE, 0U, NULL, executable_directory, &startup_info, &process_info))
if (!CreateProcessW(NULL, (LPWSTR)command_line, NULL, NULL, FALSE, 0U, NULL, set_current_directory_enabled ? executable_directory : NULL, &startup_info, &process_info))
{
const wchar_t *const error_text = describe_system_error(GetLastError());
if (error_text)
@ -1714,8 +1821,10 @@ cleanup:
close_handle(&process_info.hProcess);
close_handle(&mutex_handle);
#if L5J_ENABLE_GUI
destroy_window(&hwnd);
delete_object(&splash_image);
#endif
free((void*)jvm_extra_args);
free((void*)cmd_extra_args);
@ -1730,3 +1839,49 @@ cleanup:
return result;
}
/* ======================================================================== */
/* Entry points */
/* ======================================================================== */
extern IMAGE_DOS_HEADER __ImageBase;
extern LPWSTR _wcmdln;
#define UNHANDELED_EXCEPTION_ERROR 666
static LONG WINAPI unhandeled_exception(EXCEPTION_POINTERS *ExceptionInfo)
{
static const wchar_t *const ERROR_MESSAGE = L"\nUnhandeled exception error encountered. Exiting!";
#if L5J_ENABLE_GUI
FatalAppExitW(0U, ERROR_MESSAGE);
#else
DWORD chars_written;
WriteConsoleW(GetStdHandle(STD_ERROR_HANDLE), ERROR_MESSAGE, lstrlenW(ERROR_MESSAGE), &chars_written, NULL);
#endif
TerminateProcess(GetCurrentProcess(), UNHANDELED_EXCEPTION_ERROR);
return EXCEPTION_EXECUTE_HANDLER;
}
#if L5J_ENABLE_GUI
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
#ifdef NDEBUG
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
SetUnhandledExceptionFilter(unhandeled_exception);
#endif
return launch5j_main(hInstance, get_commandline_args(_wcmdln));
}
#else /*L5J_ENABLE_GUI*/
int wmain(int argc, wchar_t **argv, wchar_t **envp)
{
#ifdef NDEBUG
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
SetUnhandledExceptionFilter(unhandeled_exception);
#endif
_setmode(_fileno(stderr), _O_U8TEXT);
return launch5j_main((HINSTANCE) &__ImageBase, get_commandline_args(_wcmdln));
}
#endif /*L5J_ENABLE_GUI*/

View File

@ -39,10 +39,7 @@ else
SUFFIX = g.exe
endif
CFLAGS += -municode -mwindows -march=$(MARCH) -mtune=$(MTUNE)
LDFLAGS = -lcomctl32
MANIFEST := tmp/assets/manifest.$(CPU_ARCH).xml
CFLAGS += -municode -march=$(MARCH) -mtune=$(MTUNE)
# ==========================================================
# Targets
@ -57,20 +54,25 @@ initialize:
mkdir -p obj
mkdir -p tmp
.PHONY: resources
resources: initialize $(MANIFEST)
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/common.$(CPU_ARCH).o res/common.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/registry.$(CPU_ARCH).o res/registry.rc
.PHONY: manifests
manifests: initialize
@mkdir -p tmp/assets
sed -e 's/$${{version}}/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(BUILDNO)/g' -e 's/$${{processorArchitecture}}/$(CPU_ARCH)/g' res/assets/manifest-console.xml > tmp/assets/manifest-console.$(CPU_ARCH).xml
sed -e 's/$${{version}}/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(BUILDNO)/g' -e 's/$${{processorArchitecture}}/$(CPU_ARCH)/g' res/assets/manifest-windows.xml > tmp/assets/manifest-windows.$(CPU_ARCH).xml
$(MANIFEST):
mkdir -p $(@D)
sed -e 's/$${{version}}/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH).$(BUILDNO)/g' -e 's/$${{processorArchitecture}}/$(CPU_ARCH)/g' res/assets/manifest.xml > $@
.PHONY: resources
resources: manifests
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/common.$(CPU_ARCH).o res/common.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/manifest-console.$(CPU_ARCH).o res/manifest-console.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/manifest-windows.$(CPU_ARCH).o res/manifest-windows.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/registry.$(CPU_ARCH).o res/registry.rc
windres -DL5J_CPU_ARCH=$(CPU_ARCH) -DL5J_BUILDNO=$(BUILDNO) -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc
.PHONY: clean
clean: init
$(RM) bin/*.$(SUFFIX)
$(RM) obj/*.o
clean: initialize
find bin -type f -delete
find obj -type f -delete
find tmp -type f -delete
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Binaries

View File

@ -21,9 +21,8 @@ import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.regex.Pattern;
/*
@ -31,22 +30,34 @@ import java.util.regex.Pattern;
*/
public class Generator {
private final static String EMPTY = "";
private final static Pattern RTRIM = Pattern.compile("\\s+$");
private static final String EMPTY = "";
private static final Pattern RTRIM = Pattern.compile("\\s+$");
private static final MessageDigest SHA256;
static {
try {
SHA256 = MessageDigest.getInstance("SHA-256");
} catch (final NoSuchAlgorithmException e) {
throw new Error(e);
}
}
public static void main(String[] args) throws IOException {
final List<String> targets = new ArrayList<String>();
final String salt = Instant.now().toString();
final PrintStream out = new PrintStream(System.out, true, StandardCharsets.UTF_8.name());
outputTemplate(out, "header");
for (int wrapped = 0; wrapped < 2; ++wrapped) {
for (int registry = 0; registry < 2; ++registry) {
for (int stayAlive = 1; stayAlive > -1; --stayAlive) {
for (int enableSplash = 1; enableSplash > -1; --enableSplash) {
for (int encArgs = 1; encArgs > -1; --encArgs) {
out.println(generateCommand(targets, salt, wrapped, registry, stayAlive, enableSplash, encArgs));
final LinkedHashSet<String> targets = new LinkedHashSet<String>();
for (int enableGui = 1; enableGui > -1; --enableGui) {
for (int wrapped = 0; wrapped < 2; ++wrapped) {
for (int registry = 0; registry < 2; ++registry) {
for (int stayAlive = 1; stayAlive > -1; --stayAlive) {
for (int enableSplash = 1; enableSplash > -1; --enableSplash) {
if((enableSplash > 0) && (enableGui == 0)) {
continue;
}
for (int encArgs = 1; encArgs > -1; --encArgs) {
out.println(generateCommand(targets, enableGui, wrapped, registry, stayAlive, enableSplash, encArgs));
}
}
}
}
@ -94,43 +105,59 @@ public class Generator {
out.println();
}
private static String generateCommand(final List<String> targets, final String salt, final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) {
final String nameSuffix = generateNameSuffix(wrapped, registry, stayAlive, enableSplash, encArgs);
final String targetName = "l5j_" + hash(nameSuffix, salt);
targets.add(targetName);
private static String generateCommand(final Set<String> targets, final int enableGui, final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) {
final String nameSuffix = generateNameSuffix(enableGui, wrapped, registry, stayAlive, enableSplash, encArgs);
final String targetName = "launch5j_" + hash(nameSuffix);
if(!targets.add(targetName)) {
throw new Error("Hash collision detected!");
}
final String exeType = (enableGui > 0) ? "windows" : "console";
final StringBuilder cmdLine = new StringBuilder();
cmdLine.append(String.format(".PHONY: %s\n", targetName));
cmdLine.append(String.format("%s: resources\n", targetName));
cmdLine.append(String.format("\t$(CC) $(CFLAGS) " +
"-m%s " +
"-DL5J_BUILDNO=$(BUILDNO) " +
"-DL5J_ENABLE_GUI=%d " +
"-DL5J_JAR_FILE_WRAPPED=%d " +
"-DL5J_DETECT_REGISTRY=%d " +
"-DL5J_STAY_ALIVE=%d " +
"-DL5J_ENABLE_SPLASH=%d " +
"-DL5J_ENCODE_ARGS=%d " +
"-o bin/launch5j_$(CPU_ARCH)%s.exe " +
"src/head.c obj/common.$(CPU_ARCH).o",
"src/head.c " +
"obj/common.$(CPU_ARCH).o " +
"obj/manifest-%s.$(CPU_ARCH).o",
exeType,
enableGui,
wrapped,
registry,
stayAlive,
enableSplash,
encArgs,
nameSuffix));
nameSuffix,
exeType));
if (enableSplash > 0) {
cmdLine.append(" obj/splash_screen.$(CPU_ARCH).o");
}
if (registry > 0) {
cmdLine.append(" obj/registry.$(CPU_ARCH).o");
}
cmdLine.append(" $(LDFLAGS)\n");
if (enableGui > 0) {
cmdLine.append(" -lcomctl32");
}
cmdLine.append('\n');
cmdLine.append("ifeq ($(DEBUG),0)\n");
cmdLine.append(String.format("\tstrip bin/launch5j_$(CPU_ARCH)%s.exe\n", nameSuffix));
cmdLine.append("endif\n");
return cmdLine.toString();
}
private static String generateNameSuffix(final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) {
private static String generateNameSuffix(final int enableGui, final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) {
final StringBuilder builder = new StringBuilder();
if (enableGui == 0) {
append(builder, '_', "nogui");
}
if (wrapped > 0) {
append(builder, '_', "wrapped");
}
@ -140,7 +167,7 @@ public class Generator {
if (stayAlive == 0) {
append(builder, '_', "nowait");
}
if (enableSplash == 0) {
if ((enableGui > 0) && (enableSplash == 0)) {
append(builder, '_', "nosplash");
}
if (encArgs == 0) {
@ -156,15 +183,8 @@ public class Generator {
builder.append(string);
}
private static String hash(final String str, final String salt) {
final MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA-256");
} catch (final NoSuchAlgorithmException e) {
throw new Error(e);
}
digest.update(salt.getBytes(StandardCharsets.UTF_8));
final byte[] hash = digest.digest(str.getBytes(StandardCharsets.UTF_8));
return String.format("%02X%02X%02X%02X", hash[31], hash[30], hash[29], hash[28]);
private static String hash(final String str) {
final byte[] hash = SHA256.digest(str.getBytes(StandardCharsets.UTF_8));
return String.format("%02X%02X", hash[30], hash[31]);
}
}

View File

@ -21,8 +21,8 @@
// VERSION
#define L5J_VERSION_MAJOR 0
#define L5J_VERSION_MINOR 6
#define L5J_VERSION_PATCH 2
#define L5J_VERSION_MINOR 8
#define L5J_VERSION_PATCH 1
// ICON
#define ID_ICON_MAIN 1
@ -31,14 +31,17 @@
#define ID_BITMAP_SPLASH 1
// STRINGS
#define ID_STR_HEADING 1
#define ID_STR_JVMARGS 2
#define ID_STR_CMDARGS 3
#define ID_STR_JREPATH 4
#define ID_STR_MUTEXID 5
#define ID_STR_JAVAMIN 6
#define ID_STR_JAVAMAX 7
#define ID_STR_BITNESS 8
#define ID_STR_JAVAURL 9
#define ID_STR_HEADING 0x1
#define ID_STR_JVMARGS 0x2
#define ID_STR_CMDARGS 0x3
#define ID_STR_JREPATH 0x4
#define ID_STR_MUTEXID 0x5
#define ID_STR_HEAPMIN 0x6
#define ID_STR_HEAPMAX 0x7
#define ID_STR_NSETCWD 0x8
#define ID_STR_JAVAMIN 0x9
#define ID_STR_JAVAMAX 0xA
#define ID_STR_BITNESS 0xB
#define ID_STR_JAVAURL 0xC
#endif