Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
winetricks joins a running server's sync mode, so .NET installs no longer fail in 0 s while Steam is open.
Gauthier Piarrettea1d0713d2840
diff --git a/Sources/HighballKit/Recipe.swift b/Sources/HighballKit/Recipe.swiftindex 15bd09c..631da29 100644--- a/Sources/HighballKit/Recipe.swift+++ b/Sources/HighballKit/Recipe.swift@@ -582,6 +582,11 @@ public struct RecipeRunner: Sendable {// (verified 2026-08-25, issue #16). bash rather than sh for the same reason winetricks// documents on macOS.var env = try bottle.environment(engine: engine, renderer: .wined3d, extra: Self.winetricksExtras(engine: engine))+ // winetricks starts its own wine processes, so it joins a running server's sync mode+ // the way a launch does, or each of them dies on the spot (highball#241, #336).+ let joined = WineRunner.joiningLiveServer(env, prefix: bottle.url)+ if joined != env { log?("[\(recipe.id)] the environment runs with sync \(SyncMode(environment: joined).rawValue), so winetricks uses it too") }+ env = joined// winetricks shells out to cabextract for Microsoft's cabinet installers (the core// fonts among them) and macOS does not ship it, so the app bundles one under// Resources/tools (highball#96). HIGHBALL_TOOLS names another directory, for the CLI.diff --git a/Sources/HighballKit/WineRunner.swift b/Sources/HighballKit/WineRunner.swiftindex 9a5e1c7..bc08750 100644--- a/Sources/HighballKit/WineRunner.swift+++ b/Sources/HighballKit/WineRunner.swift@@ -84,6 +84,22 @@ public struct WineRunner: Sendable {return actual == settings.sync ? actual.rawValue : "\(actual.rawValue) (bottle asks \(settings.sync.rawValue))"}+ /// `env` with the sync mode of the prefix's running wineserver, when one runs with another.+ /// Wine fixes the mode when the server starts, and a process started with a different one+ /// dies before doing anything (issue #32). Every way into a prefix goes through this, the+ /// winetricks step included: it skipped it, so winetricks' first `wine cmd /c echo %AppData%`+ /// printed nothing and .NET 4.8 failed in 0 s whenever a Steam window, started with sync+ /// off, was open (highball#241, #336, reproduced on an M4 2026-10-22).+ public static func joiningLiveServer(_ env: [String: String], prefix: URL) -> [String: String] {+ joining(env, liveSync: ProcessTable.liveServerSync(forPrefix: prefix))+ }++ /// Pure core of `joiningLiveServer`, for tests.+ static func joining(_ env: [String: String], liveSync: SyncMode?) -> [String: String] {+ guard let live = liveSync, live != SyncMode(environment: env) else { return env }+ return env.merging(live.environment) { $1 }+ }+/// The log's opening block. Beyond the command line it records the few settings that decide/// which graphics and synchronization stack the process actually got.///@@ -178,9 +194,7 @@ public struct WineRunner: Sendable {// launch that joins a running server takes that server's mode, whatever the bottle or// the caller asked for; the bottle's setting applies to the next cold start. The header// below records the adoption ("bottle asks ...").- if let live = ProcessTable.liveServerSync(forPrefix: bottle.url), live != SyncMode(environment: env) {- env.merge(live.environment) { $1 }- }+ env = Self.joiningLiveServer(env, prefix: bottle.url)let stamp = ISO8601DateFormatter().string(from: Date()).replacingOccurrences(of: ":", with: "")let logURL = Self.uniqueLogURL(in: paths.logs, named: "\(stamp)-\(bottle.name)-\(label ?? args.first ?? "wine")")FileManager.default.createFile(atPath: logURL.path, contents: nil)diff --git a/Sources/highball/main.swift b/Sources/highball/main.swiftindex 39c71a3..047aa89 100644--- a/Sources/highball/main.swift+++ b/Sources/highball/main.swift@@ -531,7 +531,7 @@ struct Tricks: AsyncParsableCommand {let b = try BottleStore().get(bottle)let eng = try EngineStore().engine(b.settings.engineID)guard let wt = eng.winetricks else { fail("winetricks not installed in engine \(eng.id)") }- var env = try b.environment(engine: eng, renderer: .wined3d)+ var env = WineRunner.joiningLiveServer(try b.environment(engine: eng, renderer: .wined3d), prefix: b.url)env["WINE"] = eng.wineBinary.pathenv["WINE_BIN"] = eng.wineBinary.pathenv["WINESERVER_BIN"] = eng.wineserverBinary.pathdiff --git a/Tests/HighballKitTests/LaunchChecksTests.swift b/Tests/HighballKitTests/LaunchChecksTests.swiftindex 583f313..c1ee707 100644--- a/Tests/HighballKitTests/LaunchChecksTests.swift+++ b/Tests/HighballKitTests/LaunchChecksTests.swift@@ -52,6 +52,16 @@ final class LaunchChecksTests: XCTestCase {XCTAssertFalse(SteamRestart.windowNeedsRestart(live: d3dmetal, window: nil), "the window keeps the environment's mode")}+ /// highball#241, #336: winetricks started its wine processes with the environment's msync while+ /// a Steam window, started with sync off, held the server, and each of them died at once.+ func testEveryWayIntoARunningPrefixTakesItsSyncMode() {+ let msync = ["WINEMSYNC": "1", "WINEESYNC": "0", "WINEPREFIX": "/p"]+ XCTAssertEqual(WineRunner.joining(msync, liveSync: SyncMode.none), ["WINEMSYNC": "0", "WINEESYNC": "0", "WINEPREFIX": "/p"])+ XCTAssertEqual(WineRunner.joining(msync, liveSync: .msync), msync, "same mode, nothing changes")+ XCTAssertEqual(WineRunner.joining(msync, liveSync: nil), msync, "no server running, the environment's own mode starts it")+ XCTAssertEqual(WineRunner.joining(["WINEMSYNC": "0", "WINEESYNC": "0"], liveSync: .esync), ["WINEMSYNC": "0", "WINEESYNC": "1"])+ }+/// A DualSense player had "Controllers through SDL" installed and no way back but regedit.func testRegistryOnlyTweaksCanBeRemoved() throws {let sdl = try JSONDecoder.highball.decode(Recipe.self, from: Data("""