8231858:[macos] App does not run if installed with pkg JDK-8200758-branch
authorherrick
Mon, 14 Oct 2019 11:04:06 -0400
branchJDK-8200758-branch
changeset 58581 657e25d9e4e4
parent 58539 327232be010c
child 58582 558a0842c5aa
8231858:[macos] App does not run if installed with pkg Submitted-by: almatvee Reviewed-by: aherrick, asemenyuk
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/postinstall.template
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java	Thu Oct 10 10:57:42 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java	Mon Oct 14 11:04:06 2019 -0400
@@ -190,7 +190,11 @@
 
         Map<String, String> data = new HashMap<>();
 
+        Path appLocation = Path.of(MAC_INSTALL_DIR.fetchFrom(params),
+                         APP_NAME.fetchFrom(params) + ".app", "Contents", "app");
+
         data.put("INSTALL_LOCATION", MAC_INSTALL_DIR.fetchFrom(params));
+        data.put("APP_LOCATION", appLocation.toString());
 
         try (Writer w = Files.newBufferedWriter(
                 getScripts_PreinstallFile(params).toPath())) {
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/postinstall.template	Thu Oct 10 10:57:42 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/postinstall.template	Mon Oct 14 11:04:06 2019 -0400
@@ -2,5 +2,6 @@
 
 chown root:wheel "INSTALL_LOCATION"
 chmod a+rX "INSTALL_LOCATION"
+chmod +r "APP_LOCATION/"*.jar
 
 exit 0