Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add MSI package for Windows to enable per-machine installs. #739

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/scripts/jpackage-per-machine.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
for /F %%i in ('%JAVA_HOME%\bin\jdeps --module-path %JAVAFX_HOME% --print-module-deps --ignore-missing-deps %GITHUB_WORKSPACE%/app/target/lib/scenebuilder-%APP_VERSION%-all.jar') do SET JDEPS_MODULES=%%i

REM jdeps doesn't include JavaFX modules in Windows
set JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web

%JAVA_HOME%\bin\jlink ^
--module-path %JAVAFX_HOME% ^
--add-modules %JDEPS_MODULES%,%JAVAFX_MODULES% ^
--output app/target/runtime ^
--strip-debug --compress 2 --no-header-files --no-man-pages

%JPACKAGE_HOME%\bin\jpackage ^
--app-version %APP_VERSION% ^
--input app/target/lib ^
--license-file LICENSE.txt ^
--main-jar scenebuilder-%APP_VERSION%-all.jar ^
--main-class %MAIN_CLASS% ^
--name SceneBuilder ^
--description "Scene Builder" ^
--vendor Gluon ^
--verbose ^
--runtime-image app/target/runtime ^
--dest %INSTALL_DIR% ^
--type msi ^
--java-options "--add-opens=javafx.fxml/javafx.fxml=ALL-UNNAMED" ^
--java-options "-Djava.library.path=runtime\bin;runtime\lib" ^
--icon app/assets/windows/icon-windows.ico ^
--win-dir-chooser ^
--win-menu ^
--win-menu-group "Scene Builder" ^
--win-shortcut
33 changes: 31 additions & 2 deletions .github/workflows/bundles-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
env:
APP_VERSION: ${{ inputs.app-version }}

- name: Create Bundle using JPackage
- name: Create per-user Bundle using JPackage
shell: cmd
run: |
call .github\scripts\jpackage.bat
Expand All @@ -93,8 +93,37 @@ jobs:
certificatename: '${{ secrets.WINDOWS_CERTNAME }}'
folder: 'app/target/install'

- name: Upload Artifact
- name: Upload Artifact (per user)
uses: actions/upload-artifact@v4
with:
name: SceneBuilder-${{ inputs.project-version }}.msi
path: app/target/install/*.msi

- name: Create per-machine Bundle using JPackage
shell: cmd
run: |
call .github\scripts\jpackage-per-machine.bat
call ren ${{ env.INSTALL_DIR }}\SceneBuilder-${{ env.APP_VERSION }}.msi SceneBuilder-per-machine-${{ env.PROJECT_VERSION }}.msi
call dir ${{ env.INSTALL_DIR }}
env:
MAIN_CLASS: com.oracle.javafx.scenebuilder.app.SceneBuilderApp
JAVAFX_HOME: D:\javafx-jmods-${{ steps.javafx.outputs.JAVAFX_MAJOR_VERSION }}
JPACKAGE_HOME: ${{ env.JAVA_HOME }}
PROJECT_VERSION: ${{ inputs.project-version }}
APP_VERSION: ${{ inputs.app-version }}
INSTALL_DIR: app\target\install

- name: Codesign
uses: erwin1/code-sign-action@master
if: false
with:
certificate: '${{ secrets.WINDOWS_CERTIFICATE }}'
password: '${{ secrets.WINDOWS_PASSWORD }}'
certificatename: '${{ secrets.WINDOWS_CERTNAME }}'
folder: 'app/target/install'

- name: Upload Artifact (per machine)
uses: actions/upload-artifact@v4
with:
name: SceneBuilder-per-machine-${{ inputs.project-version }}.msi
path: app/target/install/*.msi