Skip to content
Permalink
Browse files
8244758: DMG bundler ignores --install-dir option
Reviewed-by: asemenyuk, almatvee
  • Loading branch information
Andy Herrick committed May 12, 2020
1 parent 382e5dc commit fe46f44bd1be02470b74841389e0a7380410b434
@@ -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",
@@ -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 @@ private void prepareDMGSetupScript(Map<String, ? super Object> params)
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"))
@@ -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",
@@ -17,15 +17,15 @@ tell application "Finder"
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
set theFilePath to POSIX path of theFile
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

0 comments on commit fe46f44

Please sign in to comment.