From 47ba95c6b9eb7df9caaf4b1b28191f28c9013011 Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Sat, 15 Feb 2025 20:20:34 +1100 Subject: [PATCH 1/3] Stitch High Sierra, Mojave and Catalina installers --- Mist/Helpers/InstallerCreator.swift | 7 +++++++ Mist/Model/Installer.swift | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Mist/Helpers/InstallerCreator.swift b/Mist/Helpers/InstallerCreator.swift index 55c8525..26ab5ac 100644 --- a/Mist/Helpers/InstallerCreator.swift +++ b/Mist/Helpers/InstallerCreator.swift @@ -67,6 +67,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) diff --git a/Mist/Model/Installer.swift b/Mist/Model/Installer.swift index fcaf983..e981c33 100644 --- a/Mist/Model/Installer.swift +++ b/Mist/Model/Installer.swift @@ -610,6 +610,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 } From 020acbf691ccde2b96ab0d016f6467f614a86958 Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Sat, 15 Feb 2025 20:21:16 +1100 Subject: [PATCH 2/3] Remove temporaryInstallerWithAdHocCodeSignaturesURL just-in-time --- Mist/Helpers/Generator.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mist/Helpers/Generator.swift b/Mist/Helpers/Generator.swift index cf1f747..88f3c5a 100644 --- a/Mist/Helpers/Generator.swift +++ b/Mist/Helpers/Generator.swift @@ -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) From d63f8fd5b3caf2d44b59c960a1749d25eb0b1aca Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Sat, 15 Feb 2025 20:21:50 +1100 Subject: [PATCH 3/3] Target correct volume when creating bootable installers --- Mist/Helpers/Generator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mist/Helpers/Generator.swift b/Mist/Helpers/Generator.swift index 88f3c5a..0ff4025 100644 --- a/Mist/Helpers/Generator.swift +++ b/Mist/Helpers/Generator.swift @@ -404,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]