is there a way to change icon of the installer file using jpackage?
Asked Answered
C

1

8

I have a simple modular javafx application.

i compile it using

dir /s /b src\*.java > sources.txt & javac --module-path %PATH_TO_FX% -d mods/hellofx @sources.txt & del sources.txt

This creates mods directory

I then create runtime image using the command

jlink --module-path "%PATH_TO_FX_MODS%;mods" --add-modules hellofx --output hellofx

This creates the runtime image in hellofx directory

Now i use the jpackage command to create the windows installer. In the directory i have an icon for the application.

jpackage --runtime-image hellofx --module hellofx/hellofx.HelloFX --win-shortcut --win-menu --icon smile.ico

This icon was used for the installed application but is there a way to create an icon for the installer file itself? The installer file named HelloFX-1.0 doesnt have an icon. Is there a way to configure jpackage to also change icon of this file? Thanks for the help!

enter image description here

Croy answered 6/6, 2020 at 5:24 Comment(0)
I
7

Under the hood the jpackage tool uses platform-specific tooling to create the various package types. The customization of the packaging is therefore also very platform-specific and has to be handled individually for each supported platform and package type. However, there are two common features of jpackage that you can use to make this task easier.

The first one is the option --temp some_temp_dir which asks jpackage to copy all scripts and resources needed to create the selected package type into a directory some_temp_dir. These are the scripts and resources that jpackage would use by default.

The second one is the option --resource-dir some_resource_dir which asks jpackage to first look for resources in the directory some_resource_dir and then use its defaults only for the ones it does not find there.

With these two options you can first generate a set of default resources from which you can pick the ones you want to modify and copy them over to the directory some_resource_dir. In a second run of jpackage you can then apply these changes. The most likely changes you can make this way is to exchange the default icons, used by the various package types, with your own ones.

Inca answered 6/6, 2020 at 8:13 Comment(2)
thank you. can you also look into this issue ? #62228480 thanks for help!Croy
Sorry, I can't help you with that because I have not much experience with Windows. I only tried this on my Mac.Inca

© 2022 - 2024 — McMap. All rights reserved.