changeset 59268:0c9f3396f515

8244758: DMG bundler ignores --install-dir option. Reviewed-by: asemenyuk, almatvee
author herrick
date Tue, 12 May 2020 19:20:28 -0400
parents 0bb101fbeb10
children 8639621c8a18
files src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacBaseInstallerBundler.java src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/DMGsetup.scpt
diffstat 4 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacBaseInstallerBundler.java	Wed May 13 09:36:12 2020 +0000
+++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacBaseInstallerBundler.java	Tue May 12 19:20:28 2020 -0400
@@ -83,6 +83,17 @@
             params -> "",
             null);
 
+    public static final BundlerParamInfo<String> MAC_INSTALL_DIR =
+            new StandardBundlerParam<>(
+            "mac-install-dir",
+            String.class,
+             params -> {
+                 String dir = INSTALL_DIR.fetchFrom(params);
+                 return (dir != null) ? dir : "/Applications";
+             },
+            (s, p) -> s
+    );
+
     public static final BundlerParamInfo<String> INSTALLER_NAME =
             new StandardBundlerParam<> (
             "mac.installerName",
--- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java	Wed May 13 09:36:12 2020 +0000
+++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java	Tue May 12 19:20:28 2020 -0400
@@ -31,6 +31,7 @@
 import java.text.MessageFormat;
 import java.util.*;
 import static jdk.incubator.jpackage.internal.MacAppImageBuilder.ICON_ICNS;
+import static jdk.incubator.jpackage.internal.MacAppImageBuilder.MAC_CF_BUNDLE_IDENTIFIER;
 import static jdk.incubator.jpackage.internal.OverridableResource.createResource;
 
 import static jdk.incubator.jpackage.internal.StandardBundlerParam.*;
@@ -116,8 +117,8 @@
         data.put("DEPLOY_VOLUME_PATH", volumePath.toString());
         data.put("DEPLOY_APPLICATION_NAME", APP_NAME.fetchFrom(params));
 
-        data.put("DEPLOY_INSTALL_LOCATION", "(path to applications folder)");
-        data.put("DEPLOY_INSTALL_NAME", "Applications");
+        data.put("DEPLOY_INSTALL_LOCATION", MAC_INSTALL_DIR.fetchFrom(params));
+        data.put("DEPLOY_INSTALL_NAME", MAC_INSTALL_DIR.fetchFrom(params));
 
         createResource(DEFAULT_DMG_SETUP_SCRIPT, params)
                 .setCategory(I18N.getString("resource.dmg-setup-script"))
--- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java	Wed May 13 09:36:12 2020 +0000
+++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java	Tue May 12 19:20:28 2020 -0400
@@ -101,17 +101,6 @@
                 },
             (s, p) -> s);
 
-    public static final BundlerParamInfo<String> MAC_INSTALL_DIR =
-            new StandardBundlerParam<>(
-            "mac-install-dir",
-            String.class,
-             params -> {
-                 String dir = INSTALL_DIR.fetchFrom(params);
-                 return (dir != null) ? dir : "/Applications";
-             },
-            (s, p) -> s
-    );
-
     public static final BundlerParamInfo<String> INSTALLER_SUFFIX =
             new StandardBundlerParam<> (
             "mac.pkg.installerName.suffix",
--- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/DMGsetup.scpt	Wed May 13 09:36:12 2020 +0000
+++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/DMGsetup.scpt	Tue May 12 19:20:28 2020 -0400
@@ -17,7 +17,7 @@
   set background picture of theViewOptions to POSIX file "DEPLOY_BG_FILE"
 
   -- Create alias for install location
-  make new alias file at POSIX file "DEPLOY_VOLUME_PATH" to DEPLOY_INSTALL_LOCATION with properties {name:"DEPLOY_INSTALL_NAME"}
+  make new alias file at POSIX file "DEPLOY_VOLUME_PATH" to POSIX file "DEPLOY_INSTALL_LOCATION" with properties {name:"DEPLOY_INSTALL_NAME"}
 
   set allTheFiles to the name of every item of theWindow
   repeat with theFile in allTheFiles
@@ -25,7 +25,7 @@
     if theFilePath is "/DEPLOY_APPLICATION_NAME.app" then
       -- Position application location
       set position of item theFile of theWindow to {120, 130}
-    else if theFilePath is "/DEPLOY_INSTALL_NAME" then
+    else if theFilePath is "DEPLOY_INSTALL_NAME" then
       -- Position install location
       set position of item theFile of theWindow to {390, 130}
     else