diff --git a/Makefile b/Makefile index 92e5c6d..cb7089b 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ ############################################################ MACHINE := $(patsubst %-w64-mingw32,[%],$(shell $(CXX) -dumpmachine)) +BUILDNO := $(shell git rev-list --count HEAD 2>&- || echo 0) ifeq ($(MACHINE),[i686]) CPU_ARCH := x86 @@ -51,9 +52,9 @@ init: .PHONY: resources resources: init - windres -o obj/common.$(CPU_ARCH).o res/common.rc - windres -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc - windres -o obj/registry.$(CPU_ARCH).o res/registry.rc + windres -DL5J_BUILDNO=$(BUILDNO) -o obj/common.$(CPU_ARCH).o res/common.rc + windres -DL5J_BUILDNO=$(BUILDNO) -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc + windres -DL5J_BUILDNO=$(BUILDNO) -o obj/registry.$(CPU_ARCH).o res/registry.rc .PHONY: clean clean: init @@ -64,226 +65,226 @@ clean: init # Binaries # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.PHONY: l5j -l5j: resources - $(CC) $(CFLAGS) -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: l5j_F9F9A1F5 +l5j_F9F9A1F5: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH).exe endif -.PHONY: l5j_noenc -l5j_noenc: resources - $(CC) $(CFLAGS) -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: l5j_387BDF25 +l5j_387BDF25: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_noenc.exe endif -.PHONY: l5j_nosplash -l5j_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_31F684B4 +l5j_31F684B4: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_nosplash.exe endif -.PHONY: l5j_nosplash_noenc -l5j_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_6A985F3B +l5j_6A985F3B: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_nosplash_noenc.exe endif -.PHONY: l5j_nowait -l5j_nowait: resources - $(CC) $(CFLAGS) -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: l5j_A813D876 +l5j_A813D876: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_nowait.exe endif -.PHONY: l5j_nowait_noenc -l5j_nowait_noenc: resources - $(CC) $(CFLAGS) -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: l5j_F8EC1E57 +l5j_F8EC1E57: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_nowait_noenc.exe endif -.PHONY: l5j_nowait_nosplash -l5j_nowait_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_5E261357 +l5j_5E261357: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash.exe endif -.PHONY: l5j_nowait_nosplash_noenc -l5j_nowait_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_07A9F8CB +l5j_07A9F8CB: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_nowait_nosplash_noenc.exe endif -.PHONY: l5j_registry -l5j_registry: resources - $(CC) $(CFLAGS) -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: l5j_43E42BBF +l5j_43E42BBF: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry.exe endif -.PHONY: l5j_registry_noenc -l5j_registry_noenc: resources - $(CC) $(CFLAGS) -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: l5j_0A5615A8 +l5j_0A5615A8: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_noenc.exe endif -.PHONY: l5j_registry_nosplash -l5j_registry_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_6BF2F1D5 +l5j_6BF2F1D5: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_nosplash.exe endif -.PHONY: l5j_registry_nosplash_noenc -l5j_registry_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_42DD17AD +l5j_42DD17AD: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_nosplash_noenc.exe endif -.PHONY: l5j_registry_nowait -l5j_registry_nowait: resources - $(CC) $(CFLAGS) -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: l5j_7C2731CC +l5j_7C2731CC: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_nowait.exe endif -.PHONY: l5j_registry_nowait_noenc -l5j_registry_nowait_noenc: resources - $(CC) $(CFLAGS) -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: l5j_A101EF16 +l5j_A101EF16: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_nowait_noenc.exe endif -.PHONY: l5j_registry_nowait_nosplash -l5j_registry_nowait_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_7ADBDAB1 +l5j_7ADBDAB1: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash.exe endif -.PHONY: l5j_registry_nowait_nosplash_noenc -l5j_registry_nowait_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_37115C1A +l5j_37115C1A: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_registry_nowait_nosplash_noenc.exe endif -.PHONY: l5j_wrapped -l5j_wrapped: resources - $(CC) $(CFLAGS) -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: l5j_44D8B4F3 +l5j_44D8B4F3: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped.exe endif -.PHONY: l5j_wrapped_noenc -l5j_wrapped_noenc: resources - $(CC) $(CFLAGS) -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: l5j_61D7AF7F +l5j_61D7AF7F: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_noenc.exe endif -.PHONY: l5j_wrapped_nosplash -l5j_wrapped_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_043C058B +l5j_043C058B: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash.exe endif -.PHONY: l5j_wrapped_nosplash_noenc -l5j_wrapped_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_614431D9 +l5j_614431D9: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_nosplash_noenc.exe endif -.PHONY: l5j_wrapped_nowait -l5j_wrapped_nowait: resources - $(CC) $(CFLAGS) -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: l5j_DD3611A9 +l5j_DD3611A9: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait.exe endif -.PHONY: l5j_wrapped_nowait_noenc -l5j_wrapped_nowait_noenc: resources - $(CC) $(CFLAGS) -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: l5j_C267A006 +l5j_C267A006: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_noenc.exe endif -.PHONY: l5j_wrapped_nowait_nosplash -l5j_wrapped_nowait_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_C15BE671 +l5j_C15BE671: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash.exe endif -.PHONY: l5j_wrapped_nowait_nosplash_noenc -l5j_wrapped_nowait_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_E8DDCABF +l5j_E8DDCABF: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_nowait_nosplash_noenc.exe endif -.PHONY: l5j_wrapped_registry -l5j_wrapped_registry: resources - $(CC) $(CFLAGS) -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: l5j_3645B652 +l5j_3645B652: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry.exe endif -.PHONY: l5j_wrapped_registry_noenc -l5j_wrapped_registry_noenc: resources - $(CC) $(CFLAGS) -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: l5j_45BDFACE +l5j_45BDFACE: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_noenc.exe endif -.PHONY: l5j_wrapped_registry_nosplash -l5j_wrapped_registry_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_C1FDBA19 +l5j_C1FDBA19: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash.exe endif -.PHONY: l5j_wrapped_registry_nosplash_noenc -l5j_wrapped_registry_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_0DD7490D +l5j_0DD7490D: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nosplash_noenc.exe endif -.PHONY: l5j_wrapped_registry_nowait -l5j_wrapped_registry_nowait: resources - $(CC) $(CFLAGS) -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: l5j_25375FF3 +l5j_25375FF3: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait.exe endif -.PHONY: l5j_wrapped_registry_nowait_noenc -l5j_wrapped_registry_nowait_noenc: resources - $(CC) $(CFLAGS) -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: l5j_988AA638 +l5j_988AA638: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_noenc.exe endif -.PHONY: l5j_wrapped_registry_nowait_nosplash -l5j_wrapped_registry_nowait_nosplash: resources - $(CC) $(CFLAGS) -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: l5j_939A7B9C +l5j_939A7B9C: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash.exe endif -.PHONY: l5j_wrapped_registry_nowait_nosplash_noenc -l5j_wrapped_registry_nowait_nosplash_noenc: resources - $(CC) $(CFLAGS) -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: l5j_F2A93271 +l5j_F2A93271: 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) ifeq ($(DEBUG),0) strip bin/launch5j_$(CPU_ARCH)_wrapped_registry_nowait_nosplash_noenc.exe endif @@ -294,36 +295,36 @@ endif .PHONY: all all: \ - l5j \ - l5j_noenc \ - l5j_nosplash \ - l5j_nosplash_noenc \ - l5j_nowait \ - l5j_nowait_noenc \ - l5j_nowait_nosplash \ - l5j_nowait_nosplash_noenc \ - l5j_registry \ - l5j_registry_noenc \ - l5j_registry_nosplash \ - l5j_registry_nosplash_noenc \ - l5j_registry_nowait \ - l5j_registry_nowait_noenc \ - l5j_registry_nowait_nosplash \ - l5j_registry_nowait_nosplash_noenc \ - l5j_wrapped \ - l5j_wrapped_noenc \ - l5j_wrapped_nosplash \ - l5j_wrapped_nosplash_noenc \ - l5j_wrapped_nowait \ - l5j_wrapped_nowait_noenc \ - l5j_wrapped_nowait_nosplash \ - l5j_wrapped_nowait_nosplash_noenc \ - l5j_wrapped_registry \ - l5j_wrapped_registry_noenc \ - l5j_wrapped_registry_nosplash \ - l5j_wrapped_registry_nosplash_noenc \ - l5j_wrapped_registry_nowait \ - l5j_wrapped_registry_nowait_noenc \ - l5j_wrapped_registry_nowait_nosplash \ - l5j_wrapped_registry_nowait_nosplash_noenc + l5j_F9F9A1F5 \ + l5j_387BDF25 \ + l5j_31F684B4 \ + l5j_6A985F3B \ + l5j_A813D876 \ + l5j_F8EC1E57 \ + l5j_5E261357 \ + l5j_07A9F8CB \ + l5j_43E42BBF \ + l5j_0A5615A8 \ + l5j_6BF2F1D5 \ + l5j_42DD17AD \ + l5j_7C2731CC \ + l5j_A101EF16 \ + l5j_7ADBDAB1 \ + l5j_37115C1A \ + l5j_44D8B4F3 \ + l5j_61D7AF7F \ + l5j_043C058B \ + l5j_614431D9 \ + l5j_DD3611A9 \ + l5j_C267A006 \ + l5j_C15BE671 \ + l5j_E8DDCABF \ + l5j_3645B652 \ + l5j_45BDFACE \ + l5j_C1FDBA19 \ + l5j_0DD7490D \ + l5j_25375FF3 \ + l5j_988AA638 \ + l5j_939A7B9C \ + l5j_F2A93271 diff --git a/README.md b/README.md index b5bbc5d..4340c3b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ **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. - # Usage There currently are two different ways to use Launch5j with your application code: @@ -37,7 +36,7 @@ There currently are two different ways to use Launch5j with your application cod # Variants -Launch5j executables come in a number of variants, allowing you to pick the most suitable one for you project: +Launch5j executables come in a number of variants, allowing you to pick the most suitable one for your project: * **`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. @@ -50,6 +49,9 @@ Launch5j executables come in a number of variants, allowing you to pick the most - [AdoptOpenJDK](https://adoptopenjdk.net/) - [Liberica OpenJDK](https://bell-sw.com/) + 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) + * **`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. @@ -59,7 +61,7 @@ Launch5j executables come in a number of variants, allowing you to pick the most * **`noenc`** Does **not** apply [URL encoding](https://en.wikipedia.org/wiki/Percent-encoding) to the given command-line arguments; default variant *does* apply URL encoding to all given command-line arguments in order to work around a long standing bug in Java. -## Platforms +## 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® Windows™, whereas the `x64` (64-Bit) executables require a *64-Bit* version of Microsoft® Windows™. 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 – if it is available. @@ -178,10 +180,20 @@ public class YourMainClass { ## JAR file name -Be aware that the same problem of “mangled” Unicode characters applies when the path of the JAR file is passed to the Java executable. In other words, the Java runtime *fails* to execute any JAR files whose path – file name or directory name anywhere in the path – contains any Unicode characters that cannot be represented in the computer's *local* ANSI codepage! Unfortunately, we can **not** encode the path of the JAR file as we do with the other command-line arguments, because the Jave executable requires the path of the JAR file to be passed in a non-encoded form. +Be aware that the same problem of “mangled” Unicode characters applies when the path of the JAR file is passed to the Java executable. In other words, the Java runtime *fails* to execute any JAR files whose path – file name or any directory name in the path – contains any Unicode characters that cannot be represented in the computer's *local* ANSI codepage! Unfortunately, we can **not** encode the path of the JAR file as we do with the other command-line arguments, because the Java executable requires the path of the JAR file to be passed in a non-encoded form. Therefore, it is recommended to ***only*** use ASCII characters in the name of your JAR file and in the “install” path !!! +# Command-line options + +The launcher executable recognizes the following “special” command-line options: + +* **`--l5j-about`**: + Display Launch5j about dialogue; includes version information and build configuration + +* **`--l5j-slunk`**: + Enable experimental “slunk” mode; this is for experts only! + # Source code @@ -198,11 +210,11 @@ The source code of **Launch5j** is available from the official Git mirrors at: 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. -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* and *GNU make*. +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*. Please make sure that the essential development tools and the MinGW-w64 toolchains are installed: - $ pacman -S base-devel + $ pacman -S base-devel git $ pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain Once the build environment has been set up, just run the provided Makefile: diff --git a/README.yaml b/README.yaml index eb045ba..b7b5f6a 100644 --- a/README.yaml +++ b/README.yaml @@ -1,3 +1,4 @@ --- title: "Launch5j – README" +lang: en --- diff --git a/build.cmd b/build.cmd index 9cb3725..4c61f68 100644 --- a/build.cmd +++ b/build.cmd @@ -5,6 +5,7 @@ cd /d "%~dp0" set "MSYS2_DIR=C:\msys64" set "JAVA_HOME=C:\Java\jdk-8.0.265.01-hotspot" set "ANT_HOME=C:\Program Files (x86)\Ant" +set "PANDOC_DIR=C:\Program Files (x86)\Pandoc" if not exist "%MSYS2_DIR%\msys2_shell.cmd" ( echo MSYS2 SHELL not found. Please check MSYS2_DIR and try again^^! @@ -24,6 +25,12 @@ if not exist "%ANT_HOME%\bin\ant.bat" ( goto:eof ) +if not exist "%PANDOC_DIR%\pandoc.exe" ( + echo Pandoc not found. Please check PANDOC_DIR and try again^^! + pause + goto:eof +) + REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REM Build! REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -51,6 +58,15 @@ echo ======================================================================== echo. set "PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%" call "%ANT_HOME%\bin\ant.bat" -f "%~dp0.\src\example\build.xml" +echo. + +echo ======================================================================== +echo Generate docs +echo ======================================================================== +echo. +echo "%~dp0.\README.md" --^> "%~dp0.\README.html" +"%PANDOC_DIR%\pandoc.exe" --verbose -f markdown-implicit_figures -t html5 --standalone --ascii --toc --toc-depth=2 --css="etc/style/gh-pandoc.css" -o "%~dp0.\README.html" "%~dp0.\README.yaml" "%~dp0.\README.md" +echo. echo. echo BUILD COMPLETED. diff --git a/package.cmd b/package.cmd index 06ae254..d3b6e8d 100644 --- a/package.cmd +++ b/package.cmd @@ -2,14 +2,6 @@ setlocal enabledelayedexpansion cd /d "%~dp0" -set "PANDOC_DIR=C:\Program Files (x86)\Pandoc" - -if not exist "%PANDOC_DIR%\pandoc.exe" ( - echo Pandoc not found. Please check PANDOC_DIR and try again^^! - pause - goto:eof -) - REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REM Get current date REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -41,10 +33,11 @@ if exist "%OUTFILE%" ( goto:eof ) -rmdir /Q /S "%~dp0.\out\~package" 2> NUL +set "PACK_PATH=%~dp0.\out\~package%RANDOM%" +rmdir /Q /S "%PACK_PATH%" 2> NUL -if exist "%~dp0.\out\~package" ( - echo Failed to delete existing "%~dp0.\out\~package" directory! +if exist "%PACK_PATH%" ( + echo Failed to delete existing "%PACK_PATH%" directory! pause goto:eof ) @@ -66,34 +59,30 @@ REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REM Copy binaries REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -mkdir "%~dp0.\out\~package" -mkdir "%~dp0.\out\~package\x64" +mkdir "%PACK_PATH%" +mkdir "%PACK_PATH%\x64" +mkdir "%PACK_PATH%\etc" +mkdir "%PACK_PATH%\etc\img" +mkdir "%PACK_PATH%\etc\style" +mkdir "%PACK_PATH%\example" -copy /Y "%~dp0.\*.txt" "%~dp0.\out\~package" -copy /Y "%~dp0.\bin\launch5j_x86*.exe" "%~dp0.\out\~package" -copy /Y "%~dp0.\bin\launch5j_x64*.exe" "%~dp0.\out\~package\x64" +copy /Y "%~dp0.\*.txt" "%PACK_PATH%" +copy /Y "%~dp0.\*.html" "%PACK_PATH%" +copy /Y "%~dp0.\bin\launch5j_x86*.exe" "%PACK_PATH%" +copy /Y "%~dp0.\bin\launch5j_x64*.exe" "%PACK_PATH%\x64" +copy /Y "%~dp0.\etc\img\*.png" "%PACK_PATH%\etc\img" +copy /Y "%~dp0.\etc\style\*.css" "%PACK_PATH%\etc\style" +copy /Y /B "%~dp0.\bin\launch5j_x86_wrapped_registry.exe" + "%~dp0.\src\example\dist\example.jar" "%PACK_PATH%\example\example.exe" +copy /Y "%~dp0.\src\example\src\com\muldersoft\l5j\example\Main.java" "%PACK_PATH%\example\example.java" -mkdir "%~dp0.\out\~package\etc" -mkdir "%~dp0.\out\~package\etc\img" -mkdir "%~dp0.\out\~package\etc\style" -mkdir "%~dp0.\out\~package\example" - -copy /Y "%~dp0.\etc\img\*.png" "%~dp0.\out\~package\etc\img" -copy /Y "%~dp0.\etc\style\*.css" "%~dp0.\out\~package\etc\style" - -copy /Y /B "%~dp0.\bin\launch5j_x86_wrapped_registry.exe" + "%~dp0.\src\example\dist\example.jar" "%~dp0.\out\~package\example\example.exe" -copy /Y "%~dp0.\src\example\src\com\muldersoft\l5j\example\Main.java" "%~dp0.\out\~package\example\example.java" - -"%PANDOC_DIR%\pandoc.exe" -f markdown-implicit_figures -t html5 --standalone --ascii --toc --toc-depth=2 --css="etc/style/gh-pandoc.css" "%~dp0.\README.yaml" "%~dp0.\README.md" > "%~dp0.\out\~package\README.html" - -attrib +R "%~dp0.\out\~package\*.*" /S +attrib +R "%PACK_PATH%\*.*" /S REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REM Create ZIP package REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -pushd "%~dp0.\out\~package" +pushd "%PACK_PATH%" if not "%ERRORLEVEL%"=="0" ( pause @@ -113,8 +102,7 @@ if not "%ERRORLEVEL%"=="0" ( popd -rmdir /Q /S "%~dp0.\out\~package" 2> NUL - +rmdir /Q /S "%PACK_PATH%" 2> NUL attrib +R "%OUTFILE%" echo. diff --git a/res/common.rc b/res/common.rc index e085f31..c271203 100644 --- a/res/common.rc +++ b/res/common.rc @@ -48,9 +48,13 @@ END // Version ///////////////////////////////////////////////////////////////////////////// +#define L5J_VERSION_GLUE1(W,X,Y,Z) #W "." #X "." #Y "_r" #Z +#define L5J_VERSION_GLUE2(W,X,Y,Z) L5J_VERSION_GLUE1(W,X,Y,Z) +#define L5J_VERSION_STR L5J_VERSION_GLUE2(L5J_VERSION_MAJOR,L5J_VERSION_MINOR,L5J_VERSION_PATCH,L5J_BUILDNO) + VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,0,0 - PRODUCTVERSION 0,6,0,0 + FILEVERSION L5J_VERSION_MAJOR,L5J_VERSION_MINOR,L5J_VERSION_PATCH,L5J_BUILDNO + PRODUCTVERSION L5J_VERSION_MAJOR,L5J_VERSION_MINOR,L5J_VERSION_PATCH,L5J_BUILDNO FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x3L @@ -67,8 +71,8 @@ BEGIN BEGIN VALUE "ProductName", "Launch5j" VALUE "FileDescription", "Launch5j" - VALUE "ProductVersion", "0.6.0" - VALUE "FileVersion", "0.6.0" + VALUE "ProductVersion", L5J_VERSION_STR + VALUE "FileVersion", L5J_VERSION_STR VALUE "InternalName", "Launch5j" VALUE "OriginalFilename", "launch5j.exe" VALUE "LegalCopyright", "Created by LoRd_MuldeR " diff --git a/src/head.c b/src/head.c index e2c1b84..0fd8c17 100644 --- a/src/head.c +++ b/src/head.c @@ -11,6 +11,7 @@ /* https://sourceforge.net/p/launch4j/ */ /************************************************************/ +#define UNICODE 1 #define WIN32_LEAN_AND_MEAN 1 // CRT @@ -55,6 +56,11 @@ static const wchar_t *const JRE_RELATIVE_PATH_DEFAULT = L"runtime\\bin\\javaw.ex static const size_t MIN_MUTEXID_LENGTH = 5U; static const DWORD SPLASH_SCREEN_TIMEOUT = 30000U; +// Check platform +#if !defined(_M_X64) && !defined(_M_IX86) +#error Unknown target platform! +#endif + /* ======================================================================== */ /* String routines */ /* ======================================================================== */ @@ -126,6 +132,30 @@ 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) +{ + if (NOT_EMPTY(str)) + { + const wchar_t *result; + for (result = str; (*result) && iswspace(*result); ++result); + return result; + } + return str; +} + +static BOOL starts_with(const wchar_t *const str, const wchar_t *const prefix) +{ + const size_t prefix_len = wcslen(prefix); + if (wcsnicmp(skip_leading_spaces(str), prefix, prefix_len) == 0) + { + if ((!str[prefix_len]) || iswspace(str[prefix_len])) + { + return TRUE; + } + } + return FALSE; +} + static wchar_t *wcstrim(wchar_t *const str) { if (NOT_EMPTY(str)) @@ -251,19 +281,6 @@ static const wchar_t *url_encode_str(const CHAR *const input) return buffer; } -static const wchar_t *url_encode_wcs(const wchar_t *const input, const UINT code_page) -{ - const CHAR *byte_string = utf16_to_bytes(input, code_page); - if (!byte_string) - { - return NULL; - } - - const wchar_t *encoded = url_encode_str(byte_string); - free((void*)byte_string); - return encoded; -} - /* ======================================================================== */ /* System information */ /* ======================================================================== */ @@ -1066,44 +1083,60 @@ static DWORD load_java_bitness(const HINSTANCE hinstance, const UINT id) static wchar_t *encode_commandline_args(const int argc, const LPWSTR *const argv) { - wchar_t *result_buffer = NULL; - if (argv && (argc > 0)) + if (!(argv && (argc > 0))) { - const wchar_t **encoded_argv = (const wchar_t**) malloc(sizeof(wchar_t*) * argc); - if (encoded_argv) + return NULL; + } + + const CHAR **argv_utf8 = (const CHAR**) malloc(sizeof(CHAR*) * argc); + if(!argv_utf8) + { + return NULL; + } + + size_t total_len = 0U; + for (int i = 0; i < argc; ++i) + { + argv_utf8[i] = utf16_to_bytes(argv[i], CP_UTF8); + if (argv_utf8[i]) { - size_t total_len = 0U; - for (int i = 0; i < argc; ++i) - { - if (NOT_EMPTY(encoded_argv[i] = url_encode_wcs(argv[i], CP_UTF8))) - { - total_len += (wcslen(encoded_argv[i]) + 1U); - } - } - if (total_len > 0U) - { - if ((result_buffer = (wchar_t*) calloc( total_len, sizeof(wchar_t)))) - { - for(int i = 0; i < argc; ++i) - { - if (NOT_EMPTY(encoded_argv[i])) - { - if(result_buffer[0U]) - { - wcscat(result_buffer, L" "); - } - wcscat(result_buffer, encoded_argv[i]); - } - } - } - } - for (int i = 0; i < argc; ++i) - { - free((void*)encoded_argv[i]); - } - free(encoded_argv); + total_len += argv_utf8[i][0U] ? url_encoded_length(argv_utf8[i]) : 3U; } } + + wchar_t *result_buffer = NULL; + if (total_len > 0U) + { + if ((result_buffer = (wchar_t*) calloc(total_len, sizeof(wchar_t)))) + { + for (int i = 0; i < argc; ++i) + { + if (argv_utf8[i]) + { + if (result_buffer[0U]) + { + wcscat(result_buffer, L" "); + } + if (argv_utf8[i][0U]) + { + const wchar_t *const arg_encoded = url_encode_str(argv_utf8[i]); + if (arg_encoded) + { + wcscat(result_buffer, arg_encoded); + free((void*)arg_encoded); + } + } + else + { + wcscat(result_buffer, L"\"\""); + } + free((void*)argv_utf8[i]); + } + } + } + } + + free(argv_utf8); return result_buffer; } @@ -1317,6 +1350,45 @@ static void show_jre_download_notice(const HINSTANCE hinstance, const HWND hwnd, free(jre_download_link); } +static void show_about_dialogue(const HWND hwnd) +{ +#ifdef _M_X64 + const wchar_t *const CPU_ARCH = L"x64"; +#else + const wchar_t *const CPU_ARCH = L"x86"; +#endif + show_message_format(hwnd, MB_ICONINFORMATION, L"About Launch5j", + L"Launch5j (%s), by LoRd_MuldeR \n" + L"v%u.%u.%u, build %u, created %s %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); +} + +static void enable_slunk_mode(const HWND hwnd) +{ + const WORD DATA[45U] = + { + 0x1924, 0x82AB, 0x5252, 0xC021, 0xE1A3, 0x3969, 0xFEE5, 0x4A4A, 0x93E3, 0x3470, 0xDED9, 0x3A97, 0x12E1, 0xC694, 0xF5A7, + 0x8539, 0x82A9, 0x864D, 0x8853, 0x5E0F, 0x4803, 0x45CC, 0x19B7, 0x391A, 0x0753, 0x1936, 0x6ECA, 0xCAEA, 0xA340, 0x5574, + 0x8A94, 0x0620, 0x405A, 0x8D0B, 0xB221, 0x1FC5, 0x42A4, 0x95BB, 0x689A, 0x8C61, 0x4EEC, 0x82CA, 0x728B, 0xFE59, 0x47B8 + }; + UINT32 mask = 0xB499E87D; + wchar_t slunk[45U]; + for(size_t i = 0; i < 45U; ++i) + { + mask = mask * 214013U + 2531011U; + slunk[i] = (wchar_t) ((DATA[i] ^ mask) & 0xFFFF); + } + ShellExecute(hwnd, NULL, slunk, NULL, NULL, SW_SHOW); +} + /* ======================================================================== */ /* Single instance */ /* ======================================================================== */ @@ -1425,6 +1497,18 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE _hPrevInstance, PWSTR pCmdLin // 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); + // Show about screen? + if (starts_with(pCmdLine, L"--l5j-about")) + { + show_about_dialogue(hwnd); + return 0; + } + if (starts_with(pCmdLine, L"--l5j-slunk")) + { + enable_slunk_mode(hwnd); + return 0; + } + // Single instance #if L5J_STAY_ALIVE mutex_name = load_string(hInstance, ID_STR_MUTEXID); diff --git a/src/makefile-generator/res/.assets/templates/header.mak b/src/makefile-generator/res/.assets/templates/header.mak index df39eca..bb5fdd6 100644 --- a/src/makefile-generator/res/.assets/templates/header.mak +++ b/src/makefile-generator/res/.assets/templates/header.mak @@ -12,6 +12,7 @@ ############################################################ MACHINE := $(patsubst %-w64-mingw32,[%],$(shell $(CXX) -dumpmachine)) +BUILDNO := $(shell git rev-list --count HEAD 2>&- || echo 0) ifeq ($(MACHINE),[i686]) CPU_ARCH := x86 @@ -51,9 +52,9 @@ init: .PHONY: resources resources: init - windres -o obj/common.$(CPU_ARCH).o res/common.rc - windres -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc - windres -o obj/registry.$(CPU_ARCH).o res/registry.rc + windres -DL5J_BUILDNO=$(BUILDNO) -o obj/common.$(CPU_ARCH).o res/common.rc + windres -DL5J_BUILDNO=$(BUILDNO) -o obj/splash_screen.$(CPU_ARCH).o res/splash_screen.rc + windres -DL5J_BUILDNO=$(BUILDNO) -o obj/registry.$(CPU_ARCH).o res/registry.rc .PHONY: clean clean: init diff --git a/src/makefile-generator/src/com/muldersoft/l5j/makefile/Generator.java b/src/makefile-generator/src/com/muldersoft/l5j/makefile/Generator.java index b405e66..44a0a97 100644 --- a/src/makefile-generator/src/com/muldersoft/l5j/makefile/Generator.java +++ b/src/makefile-generator/src/com/muldersoft/l5j/makefile/Generator.java @@ -19,6 +19,9 @@ import java.io.InputStream; import java.io.InputStreamReader; 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.regex.Pattern; @@ -33,6 +36,7 @@ public class Generator { public static void main(String[] args) throws IOException { final List targets = new ArrayList(); + final String salt = Instant.now().toString(); final PrintStream out = new PrintStream(System.out, true, StandardCharsets.UTF_8.name()); outputTemplate(out, "header"); @@ -42,7 +46,7 @@ public class Generator { 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, wrapped, registry, stayAlive, enableSplash, encArgs)); + out.println(generateCommand(targets, salt, wrapped, registry, stayAlive, enableSplash, encArgs)); } } } @@ -90,14 +94,15 @@ public class Generator { out.println(); } - private static String generateCommand(final List targets, final int wrapped, final int registry, final int stayAlive, final int enableSplash, final int encArgs) { + private static String generateCommand(final List 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" + nameSuffix; + final String targetName = "l5j_" + hash(nameSuffix, salt); targets.add(targetName); 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) " + + "-DL5J_BUILDNO=$(BUILDNO) " + "-DL5J_JAR_FILE_WRAPPED=%d " + "-DL5J_DETECT_REGISTRY=%d " + "-DL5J_STAY_ALIVE=%d " + @@ -151,4 +156,15 @@ 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]); + } } diff --git a/src/resource.h b/src/resource.h index 2006cc0..2f1d975 100644 --- a/src/resource.h +++ b/src/resource.h @@ -11,6 +11,19 @@ /* https://sourceforge.net/p/launch4j/ */ /************************************************************/ +#ifndef L5J_RESOURCE_H +#define L5J_RESOURCE_H + +// BUILD NO +#ifndef L5J_BUILDNO +#error L5J_BUILDNO is not defined! +#endif + +// VERSION +#define L5J_VERSION_MAJOR 0 +#define L5J_VERSION_MINOR 6 +#define L5J_VERSION_PATCH 1 + // ICON #define ID_ICON_MAIN 1 @@ -27,3 +40,5 @@ #define ID_STR_JAVAMAX 7 #define ID_STR_BITNESS 8 #define ID_STR_JAVAURL 9 + +#endif