Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,21 @@ protected File doApply(MacPackager packager) throws Exception {
Logger.info("Copying icon file: " + iconFile.getAbsolutePath());
File volumeIcon = (macConfig.getVolumeIcon() != null) ? macConfig.getVolumeIcon() : iconFile;
FileUtils.copyFileToFile(volumeIcon, new File(appFolder, ".VolumeIcon.icns"));




// creates image
Logger.info("Creating image: " + tempDmgFile.getAbsolutePath());
execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", "HFS+", "-format", "UDRW", tempDmgFile);
String osArchitecture = System.getProperty("os.arch");
if (osArchitecture.toLowerCase().equals("aarch64")) {

execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", "APFS", "-format", "UDRW", tempDmgFile);

} else {

execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", "HFS+", "-format", "UDRW", tempDmgFile);

}

if (mountFolder.exists()) {
Logger.info("Unmounting volume: " + mountFolder);
Expand Down Expand Up @@ -126,10 +137,12 @@ protected File doApply(MacPackager packager) throws Exception {
// makes sure it's not world writeable and user readable
Logger.info("Fixing permissions...");
execute("chmod", "-Rf", "u+r,go-w", mountFolder);

// makes the top window open itself on mount:
Logger.info("Blessing ...");
execute("bless", "--folder", mountFolder, "--openfolder", mountFolder);

if (!osArchitecture.toLowerCase().equals("aarch64")) {
// makes the top window open itself on mount:
Logger.info("Blessing ...");
execute("bless", "--folder", mountFolder, "--openfolder", mountFolder);
}

// tells the volume that it has a special file attribute
execute("SetFile", "-a", "C", mountFolder);
Expand Down