Skip to content

Commit

Permalink
Merge app installer bundles for 10.13-10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
ninxsoft committed Oct 5, 2024
1 parent 356cbe6 commit 1475f07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Mist/Helpers/InstallerCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 4 additions & 0 deletions Mist/Model/Installer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1475f07

Please sign in to comment.