beryx / badass-runtime-plugin

Create a custom runtime image of your non-modular application
https://badass-runtime-plugin.beryx.org
Apache License 2.0
162 stars 21 forks source link

jPackage: "Error: Option [--icon] is not valid with type [exe]" #116

Closed Hely0n closed 2 years ago

Hely0n commented 2 years ago

I'm trying to set an icon, but it gives this error. Throws "Error: Option [--icon] is not valid with type [msi]" when setting type to msi.

Current config:

runtime {
    imageZip.set(project.file("${project.buildDir}/image-zip/hello-image.zip"))
    options.set(["--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages"])
    modules.set(["java.desktop", "jdk.unsupported", "java.scripting", "java.logging", "java.xml", "java.net.http"])

    jpackage {
        imageName = 'Name'
        skipInstaller = false
        installerName = 'Name 0.9'
        installerOptions = ['--icon', 'deploy/icon.ico', '--win-menu', '--win-dir-chooser']
    }
}
Hely0n commented 2 years ago

It work's when setting jpackager home to a JDK 17, but I know it worked with JDK 16 too as I used it in the last years. Is there something to note?

Hely0n commented 2 years ago

Got it! The icon option must be passed to "imageOptions", instead of "installerOptions". It works with JDK 17 because jpackage can add icons to the installer .exe too, which didn't work in prior versions.