44 static final String DEFAULT_LICENSE_PLIST="lic_template.plist";
45
46 public static final BundlerParamInfo<String> INSTALLER_SUFFIX =
47 new StandardBundlerParam<> (
48 "mac.dmg.installerName.suffix",
49 String.class,
50 params -> "",
51 (s, p) -> s);
52
53 public File bundle(Map<String, ? super Object> params,
54 File outdir) throws PackagerException {
55 Log.verbose(MessageFormat.format(I18N.getString("message.building-dmg"),
56 APP_NAME.fetchFrom(params)));
57
58 IOUtils.writableOutputDir(outdir.toPath());
59
60 File appImageDir = APP_IMAGE_TEMP_ROOT.fetchFrom(params);
61 try {
62 appImageDir.mkdirs();
63
64 if (prepareAppBundle(params, true) != null &&
65 prepareConfigFiles(params)) {
66 File configScript = getConfig_Script(params);
67 if (configScript.exists()) {
68 Log.verbose(MessageFormat.format(
69 I18N.getString("message.running-script"),
70 configScript.getAbsolutePath()));
71 IOUtils.run("bash", configScript);
72 }
73
74 return buildDMG(params, outdir);
75 }
76 return null;
77 } catch (IOException ex) {
78 Log.verbose(ex);
79 throw new PackagerException(ex);
80 }
81 }
82
83 private static final String hdiutil = "/usr/bin/hdiutil";
84
|
44 static final String DEFAULT_LICENSE_PLIST="lic_template.plist";
45
46 public static final BundlerParamInfo<String> INSTALLER_SUFFIX =
47 new StandardBundlerParam<> (
48 "mac.dmg.installerName.suffix",
49 String.class,
50 params -> "",
51 (s, p) -> s);
52
53 public File bundle(Map<String, ? super Object> params,
54 File outdir) throws PackagerException {
55 Log.verbose(MessageFormat.format(I18N.getString("message.building-dmg"),
56 APP_NAME.fetchFrom(params)));
57
58 IOUtils.writableOutputDir(outdir.toPath());
59
60 File appImageDir = APP_IMAGE_TEMP_ROOT.fetchFrom(params);
61 try {
62 appImageDir.mkdirs();
63
64 if (prepareAppBundle(params) != null &&
65 prepareConfigFiles(params)) {
66 File configScript = getConfig_Script(params);
67 if (configScript.exists()) {
68 Log.verbose(MessageFormat.format(
69 I18N.getString("message.running-script"),
70 configScript.getAbsolutePath()));
71 IOUtils.run("bash", configScript);
72 }
73
74 return buildDMG(params, outdir);
75 }
76 return null;
77 } catch (IOException ex) {
78 Log.verbose(ex);
79 throw new PackagerException(ex);
80 }
81 }
82
83 private static final String hdiutil = "/usr/bin/hdiutil";
84
|