Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
fix(winecx): keep notproton-winecx on 11.15, give 11.17 its own tool
raymondchins86894c3c18d4
diff --git a/app/Sources/NotProtonApp/Model/FreeEngineWinecx.swift b/app/Sources/NotProtonApp/Model/FreeEngineWinecx.swiftindex fe9460c..1b9cde4 100644--- a/app/Sources/NotProtonApp/Model/FreeEngineWinecx.swift+++ b/app/Sources/NotProtonApp/Model/FreeEngineWinecx.swift@@ -65,8 +65,9 @@ enum FreeEngineWinecx {static let step = "Download free WineCX engine"- // What the WineCX row installs and what the notproton-winecx tool runs once it is- // installed. The 11.15 release stays a separate build with its own runner and tool.+ // What the WineCX row installs. It gets its own tool, notproton-winecx-11.17, beside+ // the 11.15 release, which keeps notproton-winecx: every existing prefix is claimed by+ // winecx-11.15, so the default tool only moves once 11.17 is verified on real games.static let current = v1117static let previous = v1115static let releases = [current, previous]@@ -155,7 +156,7 @@ enum FreeEngineWinecx {.i386Windows: "8ad83740df2da5e79ed435e4bc57e82b4b6a4b984fbec73e1160ca81dfce1b44",],tools: [- CompatTool(name: "notproton-winecx", flavor: .rosetta, display: "WineCX 11.17 (msync, D3DMetal)"),+ CompatTool(name: "notproton-winecx-11.17", flavor: .rosetta, display: "WineCX 11.17 (msync, D3DMetal)"),],isFree: true),@@ -198,8 +199,7 @@ enum FreeEngineWinecx {// runtime 4.5.125 is the last wine1115 build (winecx 5b45f45, built from winecx-gptk// 7a0349b, minos 26.0). The same bytes are mirrored on dappermint/Whisky, which is what- // Whisky itself downloads. Its tool is notproton-winecx-11.15, and it answers to- // notproton-winecx while 11.17 is not installed (CompatTool.standsInFor).+ // Whisky itself downloads. It keeps the notproton-winecx tool.static let v1115 = WinecxRelease(build: "winecx-11.15",runtime: "4.5.125",@@ -244,8 +244,7 @@ enum FreeEngineWinecx {.i386Windows: "23ee72664f172d38d76ecb8969d5c5af7e6828864dfe298338ed0e773910bc5d",],tools: [- CompatTool(name: "notproton-winecx-11.15", flavor: .rosetta, display: "WineCX 11.15 (msync, D3DMetal)",- standsInFor: "notproton-winecx"),+ CompatTool(name: "notproton-winecx", flavor: .rosetta, display: "WineCX 11.15 (msync, D3DMetal)"),],isFree: true),diff --git a/app/Sources/NotProtonApp/Model/SupportedRunner.swift b/app/Sources/NotProtonApp/Model/SupportedRunner.swiftindex a43a122..a18be54 100644--- a/app/Sources/NotProtonApp/Model/SupportedRunner.swift+++ b/app/Sources/NotProtonApp/Model/SupportedRunner.swift@@ -73,10 +73,6 @@ struct CompatTool: Sendable, Hashable, Identifiable {let flavor: Flavorlet display: String- // A tool name this one serves while no installed build serves it, so games mapped to it- // keep their tool when the build that now owns the name is not installed yet.- var standsInFor: String? = nil-var id: String { name }var prefixArch: PrefixArch { flavor == .fex ? .arm64 : .x86_64 }@@ -97,7 +93,7 @@ enum SupportedRunners {static let toolPreference = [legacyToolName, "notproton-fex", "notproton-fex-rosetta", "notproton-preview","notproton-fex-41069", "notproton-fex-rosetta-41069", "notproton-preview-41069", "notproton-26.3", "notproton-winecx",- "notproton-winecx-11.15", "notproton-winehq",+ "notproton-winecx-11.17", "notproton-winehq",]static let legacyToolName = "notproton"@@ -116,12 +112,9 @@ enum SupportedRunners {case .build(let id): idcase .nobody: nil}- let builds = all.filter { installed.contains($0.id) }- let owned = Set(builds.flatMap(\.tools).map(\.name))- let served = builds.flatMap { build in+ let served = all.filter { installed.contains($0.id) }.flatMap { build inbuild.tools.enumerated().map { index, tool in- var name = build.id == holder && index == 0 ? legacyToolName : tool.name- if let standIn = tool.standsInFor, !owned.contains(standIn) { name = standIn }+ let name = build.id == holder && index == 0 ? legacyToolName : tool.namereturn InstalledTool(tool: CompatTool(name: name, flavor: tool.flavor, display: tool.display), build: build.id)diff --git a/app/Tests/NotProtonAppTests/FreeEngineWinecxTests.swift b/app/Tests/NotProtonAppTests/FreeEngineWinecxTests.swiftindex 643dbc2..a96a667 100644--- a/app/Tests/NotProtonAppTests/FreeEngineWinecxTests.swift+++ b/app/Tests/NotProtonAppTests/FreeEngineWinecxTests.swift@@ -28,27 +28,23 @@ struct FreeEngineWinecxTests {#expect(release.bundleName == "\(build.releaseVersion).app")}- @Test("11.17 is the current release and owns notproton-winecx; 11.15 stays selectable beside it")+ @Test("11.17 is the current release with its own tool; 11.15 keeps notproton-winecx")func currentAndPrevious() throws {#expect(FreeEngineWinecx.current.build == "winecx-11.17")#expect(FreeEngineWinecx.previous.build == "winecx-11.15")#expect(FreeEngineWinecx.runnerBuild == FreeEngineWinecx.current.runner)- #expect(FreeEngineWinecx.current.runner.tools.map(\.name) == ["notproton-winecx"])- #expect(FreeEngineWinecx.previous.runner.tools.map(\.name) == ["notproton-winecx-11.15"])+ #expect(FreeEngineWinecx.current.runner.tools.map(\.name) == ["notproton-winecx-11.17"])+ #expect(FreeEngineWinecx.previous.runner.tools.map(\.name) == ["notproton-winecx"])let current = FreeEngineWinecx.current.runnerlet previous = FreeEngineWinecx.previous.runner- // Both installed: each serves its own tool, the current one first.- let both = SupportedRunners.tools(for: [previous, current])- #expect(both.map(\.name) == ["notproton-winecx", "notproton-winecx-11.15"])- #expect(both.map(\.build) == ["winecx-11.17", "winecx-11.15"])- // Only 11.15 installed: it keeps answering to notproton-winecx, so games mapped to- // that name keep their tool until 11.17 is set up.- let old = SupportedRunners.tools(for: [previous])- #expect(old.map(\.name) == ["notproton-winecx"])- #expect(old.map(\.build) == ["winecx-11.15"])- #expect(old.first?.display == "WineCX 11.15 (msync, D3DMetal)")- #expect(SupportedRunners.tools(for: [current]).map(\.name) == ["notproton-winecx"])+ // Installing 11.17 adds a tool and never moves notproton-winecx, which every+ // existing prefix's build record ties to winecx-11.15.+ let both = SupportedRunners.tools(for: [current, previous])+ #expect(both.map(\.name) == ["notproton-winecx", "notproton-winecx-11.17"])+ #expect(both.map(\.build) == ["winecx-11.15", "winecx-11.17"])+ #expect(SupportedRunners.tools(for: [previous]).map(\.build) == ["winecx-11.15"])+ #expect(SupportedRunners.tools(for: [current]).map(\.name) == ["notproton-winecx-11.17"])}@Test("Both free engines stay separate builds with their own loaders and tools")diff --git a/docs/WINECX.md b/docs/WINECX.mdindex 671de5a..1bf5f67 100644--- a/docs/WINECX.md+++ b/docs/WINECX.md@@ -9,15 +9,15 @@ Two releases are pinned side by side (`FreeEngineWinecx.releases`):| Build | Runtime | winecx | Wine | Tool | Bundle ||---|---|---|---|---|---|-| `winecx-11.17` (current) | 4.7.3 | `e0aa380` | 11.17 | `notproton-winecx` | `WineCX 11.17.app` |-| `winecx-11.15` | 4.5.125 | `5b45f45` | 11.15 | `notproton-winecx-11.15` | `WineCX 11.15.app` |+| `winecx-11.17` (current) | 4.7.3 | `e0aa380` | 11.17 | `notproton-winecx-11.17` | `WineCX 11.17.app` |+| `winecx-11.15` | 4.5.125 | `5b45f45` | 11.15 | `notproton-winecx` | `WineCX 11.15.app` |The WineCX row installs the current one. Each release is its own runner build with its own-pins, ntdll detours and Steam tool, so the 11.15 engine stays installed and selectable. While-11.17 is not installed, the 11.15 build answers to `notproton-winecx` (`CompatTool.standsInFor`),-so games mapped to that name keep working until the update. A prefix claimed by one build is-refused by the other (`refuse_other_build` in `compat_run.sh`): rebuild it in NotProton, or pick-"WineCX 11.15" in the game's Compatibility settings.+pins, ntdll detours and Steam tool. `notproton-winecx` stays on 11.15: every existing prefix's+build record (`notproton-build`) names `winecx-11.15`, and `refuse_other_build` in+`compat_run.sh` refuses a prefix claimed by another build, so moving the default tool would+stop every WineCX game until its prefix is rebuilt. 11.17 is picked per game as "WineCX 11.17"+(`notproton-winecx-11.17`), on a rebuilt prefix.4.7.3 over 4.5.125: msync fixes (wake one waiter, skip wake syscalls nobody waits on, sleepinstead of spinning while a wait registers, unregister on contention), kernelbase@@ -36,8 +36,8 @@ Compared with the WineHQ 11.15 engine it adds:`e94c312` build as the WineHQ engine ([DXMT.md](DXMT.md)), not the archive's 0.80. Thebuiltin Direct3D is Wine's own, or D3DMetal once a Game Porting Toolkit is linked.-In NotProton the current build is `winecx-11.17`, tool `notproton-winecx`, shown as "WineCX-11.17 (msync, D3DMetal)". Like the WineHQ engine it needs no CrossOver license. The licence check+In NotProton the current build is `winecx-11.17`, tool `notproton-winecx-11.17`, shown as+"WineCX 11.17 (msync, D3DMetal)". Like the WineHQ engine it needs no CrossOver license. The licence checktreats it as free only because the loader hash matches the pinned one, so a CrossOver installcan never pass as it.