Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

feat: 60s service start timeout on every bottle (CW HACK 20218 equivalent, via registry)

Gauthier Piarrette45b7d796a6a3
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index be6edce..a9f6a99 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -325,6 +325,7 @@ final class AppState {
throw HighballError.processFailed(command: "wineboot -u", status: r.exitStatus, output: "see \(r.log.path)")
}
try? await runner.setGpuIdentity()
+ try? await runner.setServiceTimeout()
await MainActor.run { self.appendLog("bottle repaired — Windows environment refreshed") }
}
}
diff --git a/Sources/HighballKit/BottleStore.swift b/Sources/HighballKit/BottleStore.swift
index 9e9a717..bd1e1fc 100644
--- a/Sources/HighballKit/BottleStore.swift
+++ b/Sources/HighballKit/BottleStore.swift
@@ -64,6 +64,7 @@ public struct BottleStore: Sendable {
}
if windowsVersion != .win10 { try await runner.setWindowsVersion(windowsVersion) }
try? await runner.setGpuIdentity()
+ try? await runner.setServiceTimeout()
return bottle
}
diff --git a/Sources/HighballKit/WineRunner.swift b/Sources/HighballKit/WineRunner.swift
index 43b43b8..e829478 100644
--- a/Sources/HighballKit/WineRunner.swift
+++ b/Sources/HighballKit/WineRunner.swift
@@ -154,6 +154,17 @@ public struct WineRunner: Sendable {
/// GPU table silently reverts bottles to the fake-NVIDIA identity (the 0.7.1 bug).
public static let gpuIdentity: (vendor: Int, device: Int) = (0x1002, 0x73bf)
+ /// Windows services translated cold by Rosetta can take 20+ seconds to reach RUNNING;
+ /// upstream Wine's SCM gives up after 10. CrossOver quadruples the timeout in code
+ /// (CW HACK 20218, for the Rockstar service); upstream honors this registry override.
+ /// 60 s ceiling, no cost when services start fast. Applied at bottle creation and Repair.
+ public static let servicesPipeTimeoutMs = 60000
+
+ public func setServiceTimeout() async throws {
+ try await regAdd(key: #"HKLM\System\CurrentControlSet\Control"#, name: "ServicesPipeTimeout",
+ type: "REG_SZ", data: String(Self.servicesPipeTimeoutMs))
+ }
+
public func setGpuIdentity() async throws {
try await regAdd(key: #"HKCU\Software\Wine\Direct3D"#, name: "VideoPciVendorID", type: "REG_DWORD", data: String(Self.gpuIdentity.vendor))
try await regAdd(key: #"HKCU\Software\Wine\Direct3D"#, name: "VideoPciDeviceID", type: "REG_DWORD", data: String(Self.gpuIdentity.device))
diff --git a/Sources/highball/main.swift b/Sources/highball/main.swift
index e93b403..7c33401 100644
--- a/Sources/highball/main.swift
+++ b/Sources/highball/main.swift
@@ -171,6 +171,7 @@ struct Bottle: AsyncParsableCommand {
try? await Task.sleep(for: .seconds(2))
let r = try await runner.wineboot()
try? await runner.setGpuIdentity()
+ try? await runner.setServiceTimeout()
print(r.exitStatus == 0 ? "repaired \(name)" : "wineboot exited with \(r.exitStatus) — see \(r.log.path)")
}
}
diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swift
index 758e948..41083f5 100644
--- a/Tests/HighballKitTests/RegressionTests.swift
+++ b/Tests/HighballKitTests/RegressionTests.swift
@@ -113,3 +113,12 @@ final class RegressionTests: XCTestCase {
XCTAssertEqual(back, p)
}
}
+
+extension RegressionTests {
+ // Rosetta-cold services need more than upstream's 10 s SCM window (CW HACK 20218
+ // uses 40 s). Shrinking this re-deadlocks the Rockstar installer and slows GOG's
+ // and Battle.net's service starts.
+ func testServiceTimeoutAtLeastCrossOvers() {
+ XCTAssertGreaterThanOrEqual(WineRunner.servicesPipeTimeoutMs, 40000)
+ }
+}