Add ISO support for Lion + Mountain Lion (#101)

* Add support for Lion + Mountain Lion ISOs on Intel

* Fix typo

* Update compatibility logic
This commit is contained in:
Nindi Gill 2023-10-28 23:30:38 +11:00 committed by GitHub
parent f17690b98b
commit b72c3e29d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 48 deletions

View file

@ -433,6 +433,7 @@ class TaskManager: ObservableObject {
let temporaryCDRURL: URL = temporaryDirectoryURL.appendingPathComponent("\(installer.id).cdr")
let isoURL: URL = destinationURL.appendingPathComponent(filename.stringWithSubstitutions(name: installer.name, version: installer.version, build: installer.build))
if installer.mavericksOrNewer {
return [
MistTask(type: .create, description: "temporary Disk Image") {
try await DiskImageCreator.create(temporaryImageURL, size: installer.isoSize)
@ -472,6 +473,17 @@ class TaskManager: ObservableObject {
try await FileMover.move(temporaryCDRURL, to: isoURL)
}
]
} else {
let installESDURL: URL = installer.temporaryInstallerURL.appendingPathComponent("/Contents/SharedSupport/InstallESD.dmg")
return [
MistTask(type: .convert, description: "Installer Disk Image to ISO") {
try await ISOConverter.convert(installESDURL, destination: temporaryCDRURL)
},
MistTask(type: .save, description: "ISO to destination") {
try await FileMover.move(temporaryCDRURL, to: isoURL)
}
]
}
}
// swiftlint:disable:next function_parameter_count

View file

@ -23,20 +23,10 @@ struct InstallerExportView: View {
return false
}
return (architecture == .intel && installer.mavericksOrNewer) || (architecture == .appleSilicon && installer.bigSurOrNewer)
return architecture == .intel || (architecture == .appleSilicon && installer.bigSurOrNewer)
}
private var compatibilityMessage: String {
guard let architecture: Architecture = Hardware.architecture else {
return ""
}
switch architecture {
case .appleSilicon:
return "**Note:** ISOs are unavailable for building **macOS Catalina 10.15 and older** on [Apple Silicon Macs](https://support.apple.com/en-us/HT211814)."
case .intel:
return "**Note:** ISOs are unavailable for building **OS X Mountain Lion 10.8 and older** on Intel-based Macs."
}
"**Note:** ISOs are unavailable for building **macOS Catalina 10.15 and older** on [Apple Silicon Macs](https://support.apple.com/en-us/HT211814)."
}
var body: some View {