feat: 每次安装前先终结掉安装程序,尝试修复错误代码103的问题

This commit is contained in:
X1a0He
2025-07-11 16:37:40 +08:00
parent 785be094a5
commit 9d6b0efd41

View File

@@ -35,6 +35,16 @@ actor InstallManager {
private var progressHandler: ((Double, String) -> Void)?
private let setupPath = "/Library/Application Support/Adobe/Adobe Desktop Common/HDBox/Setup"
private func terminateSetupProcesses() async {
let _ = await withCheckedContinuation { continuation in
PrivilegedHelperManager.shared.executeCommand("pkill -f Setup") { result in
continuation.resume(returning: result)
}
}
try? await Task.sleep(nanoseconds: 500_000_000)
}
actor InstallationState {
var isCompleted = false
var error: Error?
@@ -136,6 +146,8 @@ actor InstallManager {
progressHandler(0.0, String(localized: "正在清理安装环境..."))
}
await terminateSetupProcesses()
let logFiles = [
"/Library/Logs/Adobe/Installers/Install.log",
]