My Java application uses Oracles JPackage to build an installation, I then use ksigncmd to digitally sign the installer using a certificate provided by comodo
e.g.
c:\Code\jthink\SongKong>"C:\Program Files\Eclipse Adoptium\jdk-20.0.2.9-hotspot\bin\jpackage" --add-launcher SongKongDebug=songkongdebug.properties --add-launcher SongKongRemote=songkongremote.properties @jpackage.txt
c:\Code\jthink\SongKong>attrib -r SongKong-10.0.exe
c:\Code\jthink\SongKong>C:\Apps\Code\kSign\ksigncmd /d "SongKong Installer" /du "http://jthink.net/songkong" /f c:\code\signing\comodo.pfx /p password SongKong-10.0.exe
Been working for many years.
To resolve an issue with JPackage I would like to use the Java 21 version of JPackage but when I do that signing now fails with An unknown error has occured. Please contact your vendor for assistance
e.g.
c:\Code\jthink\SongKong>"C:\Program Files\Eclipse Adoptium\jdk-21.0.1.12-hotspot\bin\jpackage" --add-launcher SongKongDebug=songkongdebug.properties --add-launcher SongKongRemote=songkongremote.properties @jpackage.txt
c:\Code\jthink\SongKong>attrib -r SongKong-10.0.exe
c:\Code\jthink\SongKong>C:\Apps\Code\kSign\ksigncmd /d "SongKong Installer" /du "http://jthink.net/songkong" /f c:\code\signing\comodo.pfx /p password SongKong-10.0.exe
An unknown error has occured. Please contact your vendor for assistance
What could be the change in the Java 21 build that prevents ksigncmd working ?
As you are using
ksigncmd
you are not using the most current version of kSIgn (>=3.0.0) - because there they are no longer offering a commandline tool. (See K Softwares tutorial)The manufacturer of kSign recommends Microsofts own
signtool.exe
that is part of the free Windows SDK. It is a super huge download for just that small tool. It is also part of Visual Studio (probably not a smaller download), you find it's reference documentation also on the Microsoft homepage. That documentation is huge as signtool.exe is capable of many tasks.I also found this small guide how to use signtool.exe with jpackage but it's from Java 15 - so no guarantee that it will work with Java 21.
So while I cannot provide insight what changed from Java 20 to 21, I hope that the signtool replacement will also work for the latest version, or at least give a better error message.