Compare commits

..

3 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
6 changed files with 134 additions and 14 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 2023 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 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 this software and associated documentation files (the "Software"), to deal in

View File

@ -147,7 +147,12 @@ Some options can be configured via the launcher executable's [STRINGTABLE](https
(If `ID_STR_HEAPMIN` is specified too, then this value **must** be greater than or equal to `ID_STR_HEAPMIN`). (If `ID_STR_HEAPMIN` is specified too, then this value **must** be greater than or equal to `ID_STR_HEAPMIN`).
* **`ID_STR_JAVAMIN` (0x8)** * **`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`). 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. 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. If not specified, then the *default* minimum supported JRE version `8.0.0.0` applies.
@ -156,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) (This option only applies to the “registry” variant of Launch5j)
* **`ID_STR_JAVAMAX` (0x9)** * **`ID_STR_JAVAMAX` (0xA)**
Specifies the ***maximum*** supported JRE version, in the **`w.x.y.z`** format (e.g. `12.0.0.0`). 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. 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. If not specified, then there is **no** upper limit on the supported JRE version.
@ -165,13 +170,13 @@ Some options can be configured via the launcher executable's [STRINGTABLE](https
(This option only applies to the “registry” variant of Launch5j) (This option only applies to the “registry” variant of Launch5j)
* **`ID_STR_BITNESS` (0xA)** * **`ID_STR_BITNESS` (0xB)**
Specifies the required ***bitness*** of the JRE. This can be either **`32`** (x86, aka i586) or **`64`** (x86-64). 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. 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) (This option only applies to the “registry” variant of Launch5j)
* **`ID_STR_JAVAURL` (0xB)** * **`ID_STR_JAVAURL` (0xC)**
The Java download URL that will ne suggested, if **no** suitable JRE could be detected on the machine. 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 [Eclipse Adoptium](https://adoptium.net/) project. If not specified, wes suggest downloading OpenJDK, as provided by the [Eclipse Adoptium](https://adoptium.net/) project.
@ -296,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: This work has been released under the MIT license:
Copyright 2023 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 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 this software and associated documentation files (the "Software"), to deal in

View File

@ -44,6 +44,7 @@ BEGIN
ID_STR_MUTEXID L"?" /*single instance mutex ID*/ ID_STR_MUTEXID L"?" /*single instance mutex ID*/
ID_STR_HEAPMIN L"?" /*min. heap size, in percent of phys. memory*/ 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_HEAPMAX L"?" /*max. heap size, in percent of phys. memory*/
ID_STR_NSETCWD L"?" /*do not set current working directory*/
END END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@ -1615,7 +1615,7 @@ static int launch5j_main(const HINSTANCE hinstance, const wchar_t *const cmd_lin
DWORD java_required_bitness = 0U, jvm_heap_percent_min = 0U, jvm_heap_percent_max = 0U, jvm_bitness = 0U; 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; ULONGLONG java_required_ver_min = 0ULL, java_required_ver_max = 0ULL, jvm_version = 0ULL;
HGDIOBJ splash_image = NULL; HGDIOBJ splash_image = NULL;
BOOL have_screen_created = FALSE; BOOL have_screen_created = FALSE, set_current_directory_enabled = TRUE;
PROCESS_INFORMATION process_info; PROCESS_INFORMATION process_info;
STARTUPINFOW startup_info; STARTUPINFOW startup_info;
@ -1693,7 +1693,7 @@ static int launch5j_main(const HINSTANCE hinstance, const wchar_t *const cmd_lin
} }
// Set the current directory // 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); set_current_directory(executable_directory);
} }
@ -1770,7 +1770,7 @@ static int launch5j_main(const HINSTANCE hinstance, const wchar_t *const cmd_lin
#endif #endif
// Now actually start the process! // 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()); const wchar_t *const error_text = describe_system_error(GetLastError());
if (error_text) if (error_text)

View File

@ -22,7 +22,7 @@
// VERSION // VERSION
#define L5J_VERSION_MAJOR 0 #define L5J_VERSION_MAJOR 0
#define L5J_VERSION_MINOR 8 #define L5J_VERSION_MINOR 8
#define L5J_VERSION_PATCH 0 #define L5J_VERSION_PATCH 1
// ICON // ICON
#define ID_ICON_MAIN 1 #define ID_ICON_MAIN 1
@ -38,9 +38,10 @@
#define ID_STR_MUTEXID 0x5 #define ID_STR_MUTEXID 0x5
#define ID_STR_HEAPMIN 0x6 #define ID_STR_HEAPMIN 0x6
#define ID_STR_HEAPMAX 0x7 #define ID_STR_HEAPMAX 0x7
#define ID_STR_JAVAMIN 0x8 #define ID_STR_NSETCWD 0x8
#define ID_STR_JAVAMAX 0x9 #define ID_STR_JAVAMIN 0x9
#define ID_STR_BITNESS 0xA #define ID_STR_JAVAMAX 0xA
#define ID_STR_JAVAURL 0xB #define ID_STR_BITNESS 0xB
#define ID_STR_JAVAURL 0xC
#endif #endif