Skip to content

Commit

Permalink
launch4j
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfleischer committed Sep 4, 2024
1 parent 2593de8 commit 48f1404
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,31 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt' # Optional, you can choose other JDK providers (e.g., zulu)
distribution: 'adopt'
java-version: '17'

- name: Build with Maven
run: mvn package

- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- name: Install Launch4j using Chocolatey
run: |
choco install launch4j -y
- name: Create EXE using Launch4j
run: |
curl -L https://github.com/launch4j/launch4j/releases/download/3.14/launch4j-3.14-win32.msi --output launch4j.msi
msiexec /i launch4j.msi /quiet
launch4j --output target/MDCstudentSIMULATOR.exe --jar target/gs-maven-0.1.0.jar --outfile target/MDCstudentSIMULATOR.exe
"C:\ProgramData\chocolatey\lib\launch4j\tools\launch4j.exe" launch4j.xml
shell: bash

- name: Upload EXE artifact
uses: actions/upload-artifact@v2
with:
name: app_executable
name: MDCstudentSIMULATOR_executable
path: target/MDCstudentSIMULATOR.exe

- name: Create Release
Expand Down
26 changes: 26 additions & 0 deletions launch4j.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<launch4jConfig>
<!-- The jar file that you want to convert to an EXE -->
<jar>target/gs-maven-0.1.0.jar</jar>

<!-- The output EXE file that will be generated -->
<outfile>target/MDCstudentSIMULATOR.exe</outfile>

<!-- Main class that contains the 'public static void main(String[] args)' method -->
<manifest>
<mainClass>com.example.MainClass</mainClass> <!-- Replace with your actual main class -->
</manifest>

<!-- Settings related to the generated EXE file -->
<headerType>gui</headerType> <!-- 'gui' if it's a graphical application, 'console' for command-line -->
<errTitle>Application Error</errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl></downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>

<!-- Optionally, you can specify an icon for the EXE -->
<icon></icon> <!-- Path to a .ico file if you want a custom icon for your EXE -->
</launch4jConfig>

0 comments on commit 48f1404

Please sign in to comment.