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