diff --git a/Mist/Helpers/InstallerCreator.swift b/Mist/Helpers/InstallerCreator.swift index 0712884..76c985f 100644 --- a/Mist/Helpers/InstallerCreator.swift +++ b/Mist/Helpers/InstallerCreator.swift @@ -41,14 +41,15 @@ enum InstallerCreator { ["installer", "-pkg", packageURL.path, "-target", mountPoint.path] ] - // workaround for macOS High Sierra - if installer.version.range(of: "^10\\.13\\.", options: .regularExpression) != nil { + // workaround for macOS High Sierra 10.13, macOS Mojave 10.14 and macOS Catalina 10.15 + if installer.highSierraOrNewer, !installer.bigSurOrNewer { argumentsArrays += [ ["ditto", "/Applications/Install \(installer.name).app", "\(mountPoint.path)/Applications/Install \(installer.name).app"], ["rm", "-r", "/Applications/Install \(installer.name).app"] ] } + // workaround for macOS Catalina 10.15 and newer if installer.catalinaOrNewer { argumentsArrays += [ ["ditto", "\(mountPoint.path)Applications", "\(mountPoint.path)/Applications"], diff --git a/Mist/Model/Installer.swift b/Mist/Model/Installer.swift index 0a14eb7..028fa5b 100644 --- a/Mist/Model/Installer.swift +++ b/Mist/Model/Installer.swift @@ -769,6 +769,10 @@ struct Installer: Decodable, Hashable, Identifiable { 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 }