I am using JPackage to install my Java application on Windows, I have my own application icon and I would also like this to also be used when I run the installer.
I have followed the general approach described here to run jpackage twice, once creating a resources-dir and once using a resources-dir.
e.g
jpackage @jpackage.txt --temp target/jpackage
jpackage @jpackage.txt --resource-dir target/jpackage
However between the two calls I cannot see any installer icon to modify within target/jpackage resources dir created. Actually I can't see anything in particular I can sensibly change, I would be interested to know what people have changed for a Windows install.
A few years and OpenJDK releases later - and https://bugs.openjdk.org/browse/JDK-8236127 is set to be resolved in Java 17.
Indeed I used JPackage on Linux using the --icon
parameter with some .ico file in OpenJDK 17 and see the icon being used both on the installer (.exe) as well as on the desktop icon.
BTW, you do not create a resources-dir running JPackage. If you go for a one-step process you directly create the installer. See https://docs.oracle.com/en/java/javase/19/jpackage/basic-packaging.html#GUID-1E2A4F61-1390-4FC3-955B-BD69A16FCA2C
If you go for a two step process, you create an app-image. Then in the second step start from the app-image and create the installer. The two step process allows you to add/modify the files that will later go into the installer. See https://docs.oracle.com/en/java/javase/19/jpackage/image-and-runtime-modifications.html#GUID-70F25F63-DE4C-4DC0-83D5-76EB5C55BEF0
The resources directory however is just used to grab resources like (default) icons, text templates etc. See https://docs.oracle.com/en/java/javase/19/jpackage/override-jpackage-resources.html#GUID-1B718F8B-B68D-4D46-B1DB-003D7729AAB6