Question Details

No question body available.

Tags

java signtool jpackage

Answers (1)

Accepted Answer Available
Accepted Answer
March 31, 2025 Score: 3 Rep: 16,323 Quality: Expert Completeness: 80%

jpackage can be run in two stages to allow you to apply changes to the app image structure before generating the installer.

First stage use target jpackage --type app-image with --dest and --name parameters to generate the application image as yourstage1.dir\Your App Name:

jpackage --type app-image --dest yourstage1.dir --name "Your App Name" ... etc

Modify the contents of the output folder as needed, such as signing executables. I have a Windows screensaver, so my build renames one .EXE with .SCR extension in this step.

Finally apply jpackage again with the target type appropriate for your environment using --type exe/msi/dmg with --app-image to read the app image folder created in the first stage. Example:

jpackage --type msi --app-image "yourstage1.dir/Your App Name" ... etc

You can add --dest dir to change where the MSI file is created.