Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion Mist/Helpers/Generator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@ enum Generator {
var arguments: [String] = ["\(installer.temporaryInstallerURL.path)/Contents/Resources/createinstallmedia"]

if !installer.bigSurOrNewer {

if FileManager.default.fileExists(atPath: installer.temporaryInstallerWithAdHocCodeSignaturesURL.path) {
try FileManager.default.removeItem(at: installer.temporaryInstallerWithAdHocCodeSignaturesURL)
}

// swiftlint:disable:next line_length
!options.quiet ? PrettyPrint.print("Copying '\(installer.temporaryInstallerURL.path)' to '\(installer.temporaryInstallerWithAdHocCodeSignaturesURL.path)'...", noAnsi: options.noAnsi) : Mist.noop()
try FileManager.default.copyItem(at: installer.temporaryInstallerURL, to: installer.temporaryInstallerWithAdHocCodeSignaturesURL)
Expand All @@ -399,7 +404,7 @@ enum Generator {
arguments = ["\(installer.temporaryInstallerWithAdHocCodeSignaturesURL.path)/Contents/Resources/createinstallmedia"]
}

arguments += ["--volume", installer.temporaryISOMountPointURL.path, "--nointeraction"]
arguments += ["--volume", volume, "--nointeraction"]

if installer.sierraOrOlder {
arguments += ["--applicationpath", installer.temporaryInstallerURL.path]
Expand Down
7 changes: 7 additions & 0 deletions Mist/Helpers/InstallerCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ enum InstallerCreator {
_ = try Shell.execute(arguments, environment: variables)
}

if installer.highSierraOrNewer, !installer.bigSurOrNewer {
arguments = ["ditto", "/Applications/Install \(installer.name).app", "\(installer.temporaryDiskImageMountPointURL.path)/Applications/Install \(installer.name).app"]
_ = try Shell.execute(arguments)
arguments = ["rm", "-r", "/Applications/Install \(installer.name).app"]
_ = try Shell.execute(arguments)
}

if installer.catalinaOrNewer {
arguments = ["ditto", "\(installer.temporaryDiskImageMountPointURL.path)Applications", "\(installer.temporaryDiskImageMountPointURL.path)/Applications"]
_ = try Shell.execute(arguments)
Expand Down
4 changes: 4 additions & 0 deletions Mist/Model/Installer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,10 @@ struct Installer: Decodable {
version.range(of: "^10\\.([7-9]|1[0-2])\\.", options: .regularExpression) != nil
}

var highSierraOrNewer: Bool {
bigSurOrNewer || version.range(of: "^10\\.1[3-5]\\.", options: .regularExpression) != nil
}

var catalinaOrNewer: Bool {
bigSurOrNewer || version.range(of: "^10\\.15\\.", options: .regularExpression) != nil
}
Expand Down