From e315b54b1439d48577e922233ae8f4078040118e Mon Sep 17 00:00:00 2001 From: Oliver-Loeffler Date: Tue, 1 Oct 2024 12:33:10 +0200 Subject: [PATCH 1/9] Added a new msi package for Windows to enable per machine installs. --- .github/scripts/jpackage-per-machine.bat | 33 ++++++++++++++++++++++++ .github/scripts/jpackage.bat | 1 - .github/workflows/bundles-windows.yml | 25 ++++++++++++++++-- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 .github/scripts/jpackage-per-machine.bat diff --git a/.github/scripts/jpackage-per-machine.bat b/.github/scripts/jpackage-per-machine.bat new file mode 100644 index 000000000..809e6b381 --- /dev/null +++ b/.github/scripts/jpackage-per-machine.bat @@ -0,0 +1,33 @@ +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 +REM set MODULES=java.desktop,java.logging,java.naming,java.prefs,java.security.jgss,java.sql,java.xml,javafx.fxml,javafx.media,javafx.swing,javafx.web,jdk.unsupported + +%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-per-user-install ^ +--win-shortcut \ No newline at end of file diff --git a/.github/scripts/jpackage.bat b/.github/scripts/jpackage.bat index 809e6b381..18c8a8d75 100644 --- a/.github/scripts/jpackage.bat +++ b/.github/scripts/jpackage.bat @@ -29,5 +29,4 @@ REM set MODULES=java.desktop,java.logging,java.naming,java.prefs,java.security.j --win-dir-chooser ^ --win-menu ^ --win-menu-group "Scene Builder" ^ ---win-per-user-install ^ --win-shortcut \ No newline at end of file diff --git a/.github/workflows/bundles-windows.yml b/.github/workflows/bundles-windows.yml index a4009f006..92f8c658f 100644 --- a/.github/workflows/bundles-windows.yml +++ b/.github/workflows/bundles-windows.yml @@ -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 @@ -84,6 +84,21 @@ jobs: APP_VERSION: ${{ inputs.app-version }} INSTALL_DIR: app\target\install + - 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 @@ -93,8 +108,14 @@ 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: Upload Artifact (per machine) + uses: actions/upload-artifact@v4 + with: + name: SceneBuilder-per-machine-${{ inputs.project-version }}.msi + path: app/target/install/*.msi From bb4e45a8dc9504191ea783d8cd9ef4b6981afbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:05:25 +0200 Subject: [PATCH 2/9] Update jpackage.bat Corrected the per-user flow. --- .github/scripts/jpackage.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/jpackage.bat b/.github/scripts/jpackage.bat index 18c8a8d75..3a28150a3 100644 --- a/.github/scripts/jpackage.bat +++ b/.github/scripts/jpackage.bat @@ -29,4 +29,5 @@ REM set MODULES=java.desktop,java.logging,java.naming,java.prefs,java.security.j --win-dir-chooser ^ --win-menu ^ --win-menu-group "Scene Builder" ^ ---win-shortcut \ No newline at end of file +--win-per-user-install ^ +--win-shortcut From fab5b8f507e9b64fda6129b571f42e0929e621f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:05:50 +0200 Subject: [PATCH 3/9] Update jpackage-per-machine.bat Per machine now really is setup as intended. --- .github/scripts/jpackage-per-machine.bat | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/jpackage-per-machine.bat b/.github/scripts/jpackage-per-machine.bat index 809e6b381..7d016bfe9 100644 --- a/.github/scripts/jpackage-per-machine.bat +++ b/.github/scripts/jpackage-per-machine.bat @@ -29,5 +29,4 @@ REM set MODULES=java.desktop,java.logging,java.naming,java.prefs,java.security.j --win-dir-chooser ^ --win-menu ^ --win-menu-group "Scene Builder" ^ ---win-per-user-install ^ ---win-shortcut \ No newline at end of file +--win-shortcut From de5dfbf1c24c0b3af2d8af6bb1854ec85fe9ae7d Mon Sep 17 00:00:00 2001 From: Oliver-Loeffler Date: Tue, 1 Oct 2024 13:26:47 +0200 Subject: [PATCH 4/9] Signing and upload must actually happen immediately after artifact creation. --- .github/workflows/bundles-windows.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bundles-windows.yml b/.github/workflows/bundles-windows.yml index 92f8c658f..40f08b7c9 100644 --- a/.github/workflows/bundles-windows.yml +++ b/.github/workflows/bundles-windows.yml @@ -84,6 +84,21 @@ jobs: 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 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: | @@ -98,7 +113,6 @@ jobs: APP_VERSION: ${{ inputs.app-version }} INSTALL_DIR: app\target\install - - name: Codesign uses: erwin1/code-sign-action@master if: false @@ -108,12 +122,6 @@ jobs: certificatename: '${{ secrets.WINDOWS_CERTNAME }}' folder: 'app/target/install' - - name: Upload Artifact (per user) - uses: actions/upload-artifact@v4 - with: - name: SceneBuilder-${{ inputs.project-version }}.msi - path: app/target/install/*.msi - - name: Upload Artifact (per machine) uses: actions/upload-artifact@v4 with: From 76ddf164a57bdc5e9980d4e1d2b45fccb4bd66eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:37:16 +0200 Subject: [PATCH 5/9] Update jpackage.bat From d6338f6ed37e98711ddb71bcd49e67ab8b4b8d35 Mon Sep 17 00:00:00 2001 From: Oliver-Loeffler Date: Tue, 1 Oct 2024 13:38:34 +0200 Subject: [PATCH 6/9] Reverted to original state. --- .github/scripts/jpackage.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/jpackage.bat b/.github/scripts/jpackage.bat index 3a28150a3..809e6b381 100644 --- a/.github/scripts/jpackage.bat +++ b/.github/scripts/jpackage.bat @@ -30,4 +30,4 @@ REM set MODULES=java.desktop,java.logging,java.naming,java.prefs,java.security.j --win-menu ^ --win-menu-group "Scene Builder" ^ --win-per-user-install ^ ---win-shortcut +--win-shortcut \ No newline at end of file From 2af7b34554282eefa7982e977a02d18b48238c78 Mon Sep 17 00:00:00 2001 From: Oliver-Loeffler Date: Tue, 1 Oct 2024 13:40:42 +0200 Subject: [PATCH 7/9] Removed unused set statement. --- .github/scripts/jpackage-per-machine.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/scripts/jpackage-per-machine.bat b/.github/scripts/jpackage-per-machine.bat index 7d016bfe9..bdac78885 100644 --- a/.github/scripts/jpackage-per-machine.bat +++ b/.github/scripts/jpackage-per-machine.bat @@ -2,7 +2,6 @@ for /F %%i in ('%JAVA_HOME%\bin\jdeps --module-path %JAVAFX_HOME% --print-module REM jdeps doesn't include JavaFX modules in Windows set JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web -REM set MODULES=java.desktop,java.logging,java.naming,java.prefs,java.security.jgss,java.sql,java.xml,javafx.fxml,javafx.media,javafx.swing,javafx.web,jdk.unsupported %JAVA_HOME%\bin\jlink ^ --module-path %JAVAFX_HOME% ^ From cd27fb68110e423e3e4ccd61fc9d3c6819073a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:00:07 +0200 Subject: [PATCH 8/9] Update jpackage-per-machine.bat --- .github/scripts/jpackage-per-machine.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/jpackage-per-machine.bat b/.github/scripts/jpackage-per-machine.bat index bdac78885..257788815 100644 --- a/.github/scripts/jpackage-per-machine.bat +++ b/.github/scripts/jpackage-per-machine.bat @@ -7,7 +7,7 @@ set JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web --module-path %JAVAFX_HOME% ^ --add-modules %JDEPS_MODULES%,%JAVAFX_MODULES% ^ --output app/target/runtime ^ ---strip-debug --compress 2 --no-header-files --no-man-pages +--strip-debug --compress zip-9 --no-header-files --no-man-pages %JPACKAGE_HOME%\bin\jpackage ^ --app-version %APP_VERSION% ^ From 5d3ee5cfd4d0068447dda2095b1139787d1d28a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:00:42 +0200 Subject: [PATCH 9/9] Update jpackage-per-machine.bat --- .github/scripts/jpackage-per-machine.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/jpackage-per-machine.bat b/.github/scripts/jpackage-per-machine.bat index 257788815..bdac78885 100644 --- a/.github/scripts/jpackage-per-machine.bat +++ b/.github/scripts/jpackage-per-machine.bat @@ -7,7 +7,7 @@ set JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web --module-path %JAVAFX_HOME% ^ --add-modules %JDEPS_MODULES%,%JAVAFX_MODULES% ^ --output app/target/runtime ^ ---strip-debug --compress zip-9 --no-header-files --no-man-pages +--strip-debug --compress 2 --no-header-files --no-man-pages %JPACKAGE_HOME%\bin\jpackage ^ --app-version %APP_VERSION% ^