Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8326447

jpackage creates Windows installers that cannot be signed

XMLWordPrintable

    • b12
    • x86_64
    • windows

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 or 11
      JDK 21.0.2 (Temurin)

      A DESCRIPTION OF THE PROBLEM :
      I have recently upgraded from Java 18 to Java 21, and noticed that there has been a change in jpackage which is causing signtool (the Microsoft code signing tool) to fail when signing the installer. Even though the installer .exe can be run on the system, the signtool command fails with:

      SignTool Error: SignedCode::Sign returned error: 0x800700C1

      This rather cryptic message refers to ERROR_BAD_EXE_FORMAT. Note that the same build run with Java 18 produces an .exe installer which does not have this problem.

      If I compare the .exe produced by Java 21 with that produced by Java 18 with dumpfile and pestudio, I notice two differences:

      1. There is a 'version' section containing application name and version information in the Java 18 installer which is no longer present
      2. The linker version has changed from 1.27 to 1.37


      REGRESSION : Last worked in version 18

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a Windows installer using jpackage from JDK 21
      2. Attempt to sign the installer .exe using Windows signtool

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The .exe should be successfully code signed.
      ACTUAL -
      signtool returns the following error:

      SignTool Error: SignedCode::Sign returned error: 0x800700C1

      FREQUENCY : always


            asemenyuk Alexey Semenyuk
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: