JDK-8355651 : Issues with post-image hook
  • Type: Bug
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: 24,25
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows
  • CPU: generic
  • Submitted: 2025-04-26
  • Updated: 2025-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25Unresolved
Related Reports
Causes :  
Description
On Windows, when building MSI, the post-image hook is executed before "main.wxs" file is created. Reported at [1].

This is a regression from JDK-8319457.

Additionally, the following issues with the post-image hook were discovered.

On Linux:
 - The post-image hook handling is entirely missing.

On macOS:
 - The current directory is set to the current directory of the jpackage process; it should be set to the app image directory.
 - The "JpAppImageDir" env variable is not set; it should be set to the path of the app image directory.
 - When the "--launcher-as-service" CLI option is used, the PGK bundler will invoke the post-image script after the service package is created; it should be invoked before any package file is created.
 - The PGK bundler will invoke the post-image script before the CPL file is created; it should be invoked after.

On Windows:
  - The current directory is set to the parent directory of the app image directory; it should be set to the app image directory.
 - The "JpAppImageDir" env variable is set to the path of the parent directory of the app image directory; it should be set to the path of the app image directory.

[1] https://github.com/openjdk/jdk/pull/19318#issuecomment-2832153958
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24899 Date: 2025-04-26 21:31:35 +0000
27-04-2025

Call a custom post-image script after all sources required for msi packaging are created.
26-04-2025