From 5491ae6cf58fa555f82304549e5cd9595a140fb0 Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Sat, 10 Jun 2023 00:14:17 +1000 Subject: [PATCH] Fix ISO unmounting for macOS betas --- Mist/Helpers/TaskManager.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Mist/Helpers/TaskManager.swift b/Mist/Helpers/TaskManager.swift index 3e914a5..9ea6c27 100644 --- a/Mist/Helpers/TaskManager.swift +++ b/Mist/Helpers/TaskManager.swift @@ -406,7 +406,19 @@ class TaskManager: ObservableObject { try await InstallMediaCreator.create(createInstallMediaURL, mountPoint: installer.temporaryISOMountPointURL) }, MistTask(type: .unmount, description: "temporary Disk Image") { - try await DiskImageUnmounter.unmount(installer.temporaryISOMountPointURL) + if FileManager.default.fileExists(atPath: installer.temporaryISOMountPointURL.path) { + try await DiskImageUnmounter.unmount(installer.temporaryISOMountPointURL) + } + + guard let major: Substring = installer.version.split(separator: ".").first else { + return + } + + let url: URL = URL(fileURLWithPath: "/Volumes/Install macOS \(major) beta") + + if FileManager.default.fileExists(atPath: url.path) { + try await DiskImageUnmounter.unmount(url) + } }, MistTask(type: .convert, description: "temporary Disk Image to ISO") { try await ISOConverter.convert(temporaryImageURL, destination: temporaryCDRURL)