Skip to content

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

Review fixes: attribution matches real Wine output, 416 restarts, size cap holds, preflight never blocks a launch

Gauthier Piarrette70c2283f6bfa
diff --git a/Scripts/render-smoke.sh b/Scripts/render-smoke.sh
index 442a1dc..a0bff4d 100755
--- a/Scripts/render-smoke.sh
+++ b/Scripts/render-smoke.sh
@@ -16,6 +16,8 @@ HEAVEN_URL="https://assets.unigine.com/d/Unigine_Heaven-4.0.exe"
HEAVEN_SHA="497865a09af205a7d2e8812bfc2dd54870216cc1e95541b63cef89a4433b0e5f"
HOLD=45
BOTTLE=rsmoke
+# ENGINE=<id> runs the matrix on that installed engine; default is the newest installed.
+ENGINE="${ENGINE:-}"
swift build --product highball
HB=.build/debug/highball
@@ -28,7 +30,7 @@ if [ ! -f "$DL" ] || [ "$(shasum -a 256 "$DL" | awk '{print $1}')" != "$HEAVEN_S
fi
"$HB" bottle delete "$BOTTLE" 2>/dev/null || true
-"$HB" bottle create "$BOTTLE"
+"$HB" bottle create "$BOTTLE" ${ENGINE:+--engine "$ENGINE"}
"$HB" run "$BOTTLE" "$DL" -- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
EXE="$HOME/Library/Application Support/Highball/bottles/$BOTTLE/drive_c/Program Files (x86)/Unigine/Heaven Benchmark 4.0/bin/Heaven.exe"
test -f "$EXE" || { echo "Heaven install failed"; exit 1; }
@@ -89,7 +91,7 @@ run_case "dxmt-d3d9" dxmt direct3d9 "-"
"$HB" bottle kill "$BOTTLE" >/dev/null 2>&1 || true
"$HB" bottle delete "$BOTTLE" || true
-ENGINE_ID=$("$HB" engine list | head -1 | cut -f1)
+ENGINE_ID="${ENGINE:-$(python3 -c "import json,os;print(json.load(open(os.path.expanduser(\"~/Library/Application Support/Highball/bottles/$BOTTLE/bottle.json\")))[\"engineID\"])" 2>/dev/null || "$HB" engine list | head -1 | cut -f1)}"
mkdir -p private/render-smoke
python3 - "$ENGINE_ID" "$ALL" "${RESULTS%,}" <<'PY'
import json, sys, time
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index e36be44..526a059 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -535,6 +535,7 @@ final class AppState {
// A Steam client left running by a game launch answers a new steam.exe by swallowing
// it (issue #33). Ask it to show its window instead, and leave the wineserver alone:
// a game may still be running under it.
+ await BottleStore.preflight(runner: runner, bottle: bottle) { line in Task { @MainActor in self.appendLog(line) } }
if isSteamUI(pin), let shown = try await runner.showRunningSteam(onOutput: { line in Task { @MainActor in self.appendLog(line) } }) {
await MainActor.run { self.appendLog("Steam was already running; asked it to show its window") }
if shown.crashedEarly { /* the forward exits at once by design; not a crash */ }
@@ -558,7 +559,6 @@ final class AppState {
result = r
if resumed { await MainActor.run { self.appendLog("resumed after the known crash") } }
} else {
- try await BottleStore.preflight(runner: runner, bottle: bottle) { line in Task { @MainActor in self.appendLog(line) } }
result = try await runner.start(pin: pin, extraEnvironment: extra) { line in Task { @MainActor in self.appendLog(line) } }
}
if result.crashedEarly {
@@ -872,6 +872,18 @@ final class AppState {
return urls.compactMap { try? EngineManifest.load(from: $0) }.filter { seen.insert($0.id).inserted }
}
+ /// Installed-marker results per bottle, keyed by system.reg's modification time so the
+ /// registry text (12 MB on a busy bottle) is read once per change, not on every render.
+ private var installedTweaksCache: [String: (regModified: Date, ids: Set<String>)] = [:]
+ func tweakIsInstalled(_ recipe: HighballKit.Recipe, in bottle: Bottle) -> Bool {
+ let reg = bottle.url.appending(path: "system.reg")
+ let modified = (try? FileManager.default.attributesOfItem(atPath: reg.path)[.modificationDate] as? Date) ?? .distantPast
+ if let hit = installedTweaksCache[bottle.name], hit.regModified == modified { return hit.ids.contains(recipe.id) }
+ let ids = Set(Self.tweakRecipes().filter { $0.isInstalled(in: bottle) }.map(\.id))
+ installedTweaksCache[bottle.name] = (modified, ids)
+ return ids.contains(recipe.id)
+ }
+
/// What the bottle's Engine picker lists: installed engines, then known ones to download.
func offeredEngines(for bottle: Bottle) -> [EngineStore.OfferedEngine] {
EngineStore.offeredEngines(installed: engines, known: Self.knownManifests, current: bottle.settings.engineID)
diff --git a/Sources/HighballApp/BottleView.swift b/Sources/HighballApp/BottleView.swift
index 35457ec..3bf01d9 100644
--- a/Sources/HighballApp/BottleView.swift
+++ b/Sources/HighballApp/BottleView.swift
@@ -406,7 +406,7 @@ struct BottleSettingsSheet: View {
Text(r.title)
Spacer()
let live = state.bottles.first { $0.name == bottle.name } ?? bottle
- if live.settings.recipes.contains(r.id) || r.isInstalled(in: live) {
+ if live.settings.recipes.contains(r.id) || state.tweakIsInstalled(r, in: live) {
Label(L("Installed"), systemImage: "checkmark.circle.fill").foregroundStyle(.green).labelStyle(.titleAndIcon)
} else {
Button(L("Install")) {
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swift
index 86f8704..9cc2e49 100644
--- a/Sources/HighballKit/Bottle.swift
+++ b/Sources/HighballKit/Bottle.swift
@@ -256,6 +256,8 @@ public struct BottleSettings: Codable, Sendable {
public var recipes: [String] = []
public var created: Date = Date()
+ enum CodingKeys: String, CodingKey { case formatVersion, name, engineID, renderer, rendererExplicit, windowsVersion, sync, metalHUD, advertiseAVX, dxvkAsync, fpsCap, commandIsControl, commandIsControlSynced, dpiScale, dllOverrides, dxvkAppConfig, dllOverridesSynced, environment, pins, recipes, created }
+
public init(name: String, engineID: String) {
self.name = name
self.engineID = engineID
@@ -388,8 +390,11 @@ public struct Bottle: Sendable {
// program out; the CrossOver-tree engine ships it, and three launcher installers put
// shortcuts on the Desktop during its first day of testing (2026-09-04). Off everywhere:
// a bottle's programs belong in Highball's library, not on the user's Desktop.
- merge(&env, ["WINEDLLOVERRIDES+": "winemenubuilder.exe=d"])
+ // merge prepends, and Wine's last entry for a DLL wins, so Highball's default goes in
+ // after the bottle's own overrides to end up first in the string: a user who lists
+ // winemenubuilder.exe themselves gets their way.
if !settings.dllOverrides.isEmpty { merge(&env, ["WINEDLLOVERRIDES+": settings.dllOverrides]) }
+ merge(&env, ["WINEDLLOVERRIDES+": "winemenubuilder.exe=d"])
merge(&env, settings.environment)
merge(&env, try (renderer ?? settings.renderer).environment(engine: engine))
merge(&env, extra)
diff --git a/Sources/HighballKit/BottleStore.swift b/Sources/HighballKit/BottleStore.swift
index e182e0e..9198ca1 100644
--- a/Sources/HighballKit/BottleStore.swift
+++ b/Sources/HighballKit/BottleStore.swift
@@ -100,10 +100,18 @@ public struct BottleStore: Sendable {
/// Quiet self-heal before a launch: when the 32-bit half is missing, re-run the first boot
/// (with the mscoree set-aside and the 32-bit seeding refreshPrefix carries) instead of
/// letting the launch fail and sending the user to find "Repair bottle".
- public static func preflight(runner: WineRunner, bottle: Bottle, log: ((String) -> Void)? = nil) async throws {
+ public static func preflight(runner: WineRunner, bottle: Bottle, log: ((String) -> Void)? = nil) async {
guard needsPreflightRepair(bottle) else { return }
+ // A first boot under a running wineserver would fight it; a live bottle is left alone
+ // and the next launch from a stopped state repairs it. A failed repair is logged, not
+ // thrown: a 64-bit game that never needed the 32-bit half must still launch.
+ guard ProcessTable.processes(ofPrefix: bottle.url).isEmpty else {
+ log?("bottle '\(bottle.name)': 32-bit half missing; will repair at the next launch from a stopped bottle")
+ return
+ }
log?("bottle '\(bottle.name)': 32-bit half missing, repairing before launch")
- try await refreshPrefix(runner: runner, bottle: bottle)
+ do { try await refreshPrefix(runner: runner, bottle: bottle) }
+ catch { log?("bottle '\(bottle.name)': repair before launch failed (\(error)); launching anyway") }
}
/// Re-runs the Windows first boot on an existing bottle and the per-bottle setup that boot
diff --git a/Sources/HighballKit/DownloadResume.swift b/Sources/HighballKit/DownloadResume.swift
index 7015e04..0a5eeb0 100644
--- a/Sources/HighballKit/DownloadResume.swift
+++ b/Sources/HighballKit/DownloadResume.swift
@@ -16,12 +16,15 @@ public enum DownloadResume {
}
/// 206 with a partial on disk means append; 200 means the server sent the whole thing (no
- /// range support, or the ETag changed), so start over; anything else is a failure. A 206
+ /// range support, or the ETag changed), so start over; 416 means the range was past the end
+ /// (a partial that is already complete, or an asset that shrank), so start over rather than
+ /// asking for the same impossible range on every retry; anything else is a failure. A 206
/// without a partial cannot happen with our request and is treated as a restart.
public static func decide(status: Int, partialBytes: Int64) -> Decision {
switch status {
case 206: return partialBytes > 0 ? .append : .restart
case 200..<300: return .restart
+ case 416: return .restart
default: return .failed
}
}
diff --git a/Sources/HighballKit/EngineStore.swift b/Sources/HighballKit/EngineStore.swift
index 9f49860..1139053 100644
--- a/Sources/HighballKit/EngineStore.swift
+++ b/Sources/HighballKit/EngineStore.swift
@@ -162,8 +162,10 @@ public struct EngineStore: Sendable {
if FileManager.default.fileExists(atPath: dest.path), try sha256(of: dest) == component.sha256.lowercased() {
return dest
}
- let partial = dest.appendingPathExtension("partial")
- let etagFile = dest.appendingPathExtension("etag")
+ // Named by checksum so two installs sharing a basename (or an asset that changed under
+ // the same name) never append into each other's file.
+ let partial = dest.appendingPathExtension("\(component.sha256.prefix(12)).partial")
+ let etagFile = dest.appendingPathExtension("\(component.sha256.prefix(12)).etag")
let expected = Int64(component.size ?? 0)
let cfg = URLSessionConfiguration.ephemeral
cfg.timeoutIntervalForRequest = 60
@@ -189,6 +191,12 @@ public struct EngineStore: Sendable {
try? FileManager.default.removeItem(at: dest)
try FileManager.default.moveItem(at: partial, to: dest)
try? FileManager.default.removeItem(at: etagFile)
+ // Partials of other versions of the same file are dead weight once this one verified.
+ if let siblings = try? FileManager.default.contentsOfDirectory(at: paths.downloads, includingPropertiesForKeys: nil) {
+ for f in siblings where f.lastPathComponent.hasPrefix(dest.lastPathComponent + ".") && (f.pathExtension == "partial" || f.pathExtension == "etag") {
+ try? FileManager.default.removeItem(at: f)
+ }
+ }
let actual = try sha256(of: dest)
guard actual == component.sha256.lowercased() else {
try? FileManager.default.removeItem(at: dest)
@@ -224,7 +232,8 @@ public struct EngineStore: Sendable {
defer { try? handle.close() }
try handle.seekToEnd()
var written = decision == .append ? have : 0
- let total = decision == .append ? have + http.expectedContentLength : http.expectedContentLength
+ // A chunked response reports -1; then the caller's manifest size drives the bar.
+ let total: Int64 = http.expectedContentLength < 0 ? 0 : (decision == .append ? have + http.expectedContentLength : http.expectedContentLength)
var buffer = Data(); buffer.reserveCapacity(1 << 20)
var lastReported: Int64 = written
for try await byte in bytes {
@@ -375,6 +384,3 @@ public struct InstalledEngine: Sendable {
return env
}
}
-
-/// URLSessionDownloadDelegate that streams byte progress (~every 2 MB) and moves the finished
-/// file into place before resuming its continuation. State is confined to the session's own
diff --git a/Sources/HighballKit/LogPruner.swift b/Sources/HighballKit/LogPruner.swift
index d1a6d22..92bbbc6 100644
--- a/Sources/HighballKit/LogPruner.swift
+++ b/Sources/HighballKit/LogPruner.swift
@@ -15,11 +15,11 @@ public enum LogPruner {
static let keepAlways: Set<String> = ["verify-results.jsonl"]
/// Deletes, in order: anything older than `keepDays` beyond the newest `keepNewest` files,
- /// then the oldest of what remains until the total is at most `maxTotalBytes`. The newest
- /// `keepNewest` files are never removed by the size rule either, so the log a user is about
- /// to attach to a report still exists.
+ /// then the oldest of what remains until the total is at most `maxTotalBytes`. The size rule
+ /// spares only the newest `protectNewest` files, so a handful of huge traces cannot hide
+ /// behind the age rule's allowance; the log a user is about to attach still exists.
public static func plan(_ entries: [Entry], now: Date = Date(), keepDays: Int = 14,
- maxTotalBytes: Int64 = 300 * 1024 * 1024, keepNewest: Int = 50) -> [URL] {
+ maxTotalBytes: Int64 = 300 * 1024 * 1024, keepNewest: Int = 50, protectNewest: Int = 5) -> [URL] {
let candidates = entries.filter { !keepAlways.contains($0.url.lastPathComponent) }
.sorted { $0.modified > $1.modified } // newest first
var remove: [URL] = []
@@ -30,7 +30,7 @@ public enum LogPruner {
}
var total = kept.reduce(Int64(0)) { $0 + $1.size }
for e in kept.reversed() where total > maxTotalBytes { // oldest first
- guard let idx = kept.firstIndex(of: e), idx >= keepNewest else { break }
+ guard let idx = kept.firstIndex(of: e), idx >= protectNewest else { break }
remove.append(e.url); total -= e.size
}
return remove
diff --git a/Sources/HighballKit/RegistryText.swift b/Sources/HighballKit/RegistryText.swift
index 9122c5d..5d2107b 100644
--- a/Sources/HighballKit/RegistryText.swift
+++ b/Sources/HighballKit/RegistryText.swift
@@ -9,14 +9,17 @@ public enum RegistryText {
/// `key` is written the way it appears in the file, with doubled backslashes, or with single
/// backslashes, which are doubled here.
public static func value(in text: String, key: String, name: String) -> String? {
- let wanted = "[" + key.replacingOccurrences(of: "\\\\", with: "\\").replacingOccurrences(of: "\\", with: "\\\\") + "]"
+ // The registry is case-insensitive; installers write SOFTWARE and Software alike.
+ let wanted = ("[" + key.replacingOccurrences(of: "\\\\", with: "\\").replacingOccurrences(of: "\\", with: "\\\\") + "]").lowercased()
+ let wantedValue = ("\"" + name + "\"=").lowercased()
var inKey = false
for line in text.split(separator: "\n", omittingEmptySubsequences: false) {
if line.hasPrefix("[") {
- inKey = line.hasPrefix(wanted + " ") || line == Substring(wanted)
+ let lower = line.lowercased()
+ inKey = lower.hasPrefix(wanted + " ") || lower == wanted
continue
}
- guard inKey, line.hasPrefix("\"" + name + "\"=") else { continue }
+ guard inKey, line.lowercased().hasPrefix(wantedValue) else { continue }
return String(line.dropFirst(name.count + 3))
}
return nil
diff --git a/Sources/HighballKit/Verifier.swift b/Sources/HighballKit/Verifier.swift
index 7621bfe..a1d65b7 100644
--- a/Sources/HighballKit/Verifier.swift
+++ b/Sources/HighballKit/Verifier.swift
@@ -84,7 +84,15 @@ public struct Verifier {
// Tear down.
try? WineRunner(paths: paths, engine: engine, bottle: bottle).kill()
launch.cancel()
- let launchLog = (try? await launch.value)?.log
+ // The launch task returns when steam.exe exits, which kill() just arranged; bound the
+ // wait anyway so a client that lingers cannot hold the verifier.
+ let launchLog: URL? = await withTaskGroup(of: URL?.self) { group in
+ group.addTask { (try? await launch.value)?.log }
+ group.addTask { try? await Task.sleep(for: .seconds(30)); return nil }
+ let first = await group.next() ?? nil
+ group.cancelAll()
+ return first
+ }
let served = launchLog.flatMap { try? String(contentsOf: $0, encoding: .utf8) }.map(Self.servedImplementation(fromLog:)) ?? "unknown"
// Every renderer but wined3d routes Direct3D 9 through the d9vk overlay, so "dxvk" under a
// dxmt run is still an overlay; only Wine's own implementation means the ask was ignored.
@@ -117,9 +125,12 @@ public struct Verifier {
public static func servedImplementation(fromLog log: String) -> String {
for line in log.split(separator: "\n") {
guard line.contains("loaddll"), line.contains("Loaded L\""),
- let range = line.range(of: #"Loaded L"([^"]+\\(d3d11|d3d9|d3d10core|d3d12|dxgi)\.dll)""#, options: .regularExpression)
+ let range = line.range(of: #"Loaded L"([^"]+\\+(d3d11|d3d9|d3d10core|d3d12|dxgi)\.dll)""#, options: .regularExpression)
else { continue }
- let path = line[range].lowercased()
+ // Wine's debugstr doubles backslashes ("C:\\windows\\system32\\d3d11.dll"); fold them
+ // so one set of patterns matches real output (a first version matched only the
+ // hand-written fixture and never attributed a real run).
+ let path = line[range].lowercased().replacingOccurrences(of: "\\\\", with: "\\")
if path.contains("\\dxmt\\") { return "dxmt" }
if path.contains("\\dxvk\\") || path.contains("\\d9vk\\") { return "dxvk" }
if path.contains("\\d3dmetal\\") { return "d3dmetal" }
diff --git a/Sources/highball/main.swift b/Sources/highball/main.swift
index d35bf9f..73d283c 100644
--- a/Sources/highball/main.swift
+++ b/Sources/highball/main.swift
@@ -316,7 +316,7 @@ struct Run: AsyncParsableCommand {
let b = try BottleStore().get(bottle)
let eng = try EngineStore().engine(b.settings.engineID)
let runner = WineRunner(engine: eng, bottle: b)
- try await BottleStore.preflight(runner: runner, bottle: b) { print($0) }
+ await BottleStore.preflight(runner: runner, bottle: b) { print($0) }
let echo: @Sendable (String) -> Void = { print($0) }
let out: (@Sendable (String) -> Void)? = verbose ? echo : nil
let result: LaunchResult
diff --git a/Tests/HighballKitTests/EnvironmentTests.swift b/Tests/HighballKitTests/EnvironmentTests.swift
index 7ba65bd..9f43ea8 100644
--- a/Tests/HighballKitTests/EnvironmentTests.swift
+++ b/Tests/HighballKitTests/EnvironmentTests.swift
@@ -46,6 +46,8 @@ final class EnvironmentTests: XCTestCase {
let (engine, bottle) = try fixtures()
let env = try bottle.environment(engine: engine, renderer: .wined3d)
XCTAssertEqual(env["WINEDLLOVERRIDES"], "winemenubuilder.exe=d", "present with no bottle overrides at all")
+ var b2 = bottle; b2.settings.dllOverrides = "winemenubuilder.exe=b"
+ XCTAssertEqual(try b2.environment(engine: engine, renderer: .wined3d)["WINEDLLOVERRIDES"], "winemenubuilder.exe=d;winemenubuilder.exe=b", "a user's own entry comes last and therefore wins")
}
func testPrefixAndDebugAlwaysSet() throws {
@@ -61,7 +63,7 @@ final class EnvironmentTests: XCTestCase {
var (engine, bottle) = try fixtures()
bottle.settings.dllOverrides = "version=n,b"
var env = try bottle.environment(engine: engine, renderer: .wined3d)
- XCTAssertEqual(env["WINEDLLOVERRIDES"], "version=n,b;winemenubuilder.exe=d", "the bottle's overrides sit in front of Highball's own")
+ XCTAssertEqual(env["WINEDLLOVERRIDES"], "winemenubuilder.exe=d;version=n,b", "Highball's default first, the bottle's overrides after it: Wine's last entry wins, so the user can re-enable anything")
bottle.settings.environment["WINEDLLOVERRIDES+"] = "libglesv2=d"
env = try bottle.environment(engine: engine, renderer: .wined3d)
diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swift
index e65fd34..1782c60 100644
--- a/Tests/HighballKitTests/RegressionTests.swift
+++ b/Tests/HighballKitTests/RegressionTests.swift
@@ -942,11 +942,14 @@ extension RegressionTests {
e("verify-results.jsonl", daysOld: 100, mb: 1), e("big-old", daysOld: 10, mb: 400), e("big-new", daysOld: 0.5, mb: 400)]
let byAge = LogPruner.plan(entries, now: now, keepDays: 14, maxTotalBytes: 10_000 * 1_048_576, keepNewest: 2)
XCTAssertEqual(Set(byAge.map(\.lastPathComponent)), ["old1", "old2"], "older than 14 days and not among the newest two")
- let bySize = LogPruner.plan(entries, now: now, keepDays: 14, maxTotalBytes: 500 * 1_048_576, keepNewest: 2)
+ let bySize = LogPruner.plan(entries, now: now, keepDays: 14, maxTotalBytes: 500 * 1_048_576, keepNewest: 2, protectNewest: 2)
XCTAssertTrue(bySize.map(\.lastPathComponent).contains("big-old"), "size rule removes the oldest big file")
XCTAssertFalse(bySize.map(\.lastPathComponent).contains("big-new"), "the newest files are never removed for size")
XCTAssertFalse(bySize.map(\.lastPathComponent).contains("verify-results.jsonl"))
XCTAssertEqual(LogPruner.plan(entries, now: now, keepDays: 14, maxTotalBytes: 10_000 * 1_048_576, keepNewest: 10).count, 0, "everything within the newest ten stays")
+ let fewHuge = (0..<40).map { e("t\($0)", daysOld: Double($0), mb: 100) }
+ let bySizeFew = LogPruner.plan(fewHuge, now: now, keepDays: 14, maxTotalBytes: 300 * 1_048_576, keepNewest: 50)
+ XCTAssertEqual(bySizeFew.count, 35, "the size cap holds even with fewer files than the age rule's allowance; the newest five stay")
}
// Preflight: the 32-bit half check is a file test, so it is free on the happy path.
@@ -970,7 +973,7 @@ extension RegressionTests {
XCTAssertEqual(DownloadResume.decide(status: 200, partialBytes: 1234), .restart, "the server ignored the range or the asset changed: start over")
XCTAssertEqual(DownloadResume.decide(status: 206, partialBytes: 0), .restart)
XCTAssertEqual(DownloadResume.decide(status: 404, partialBytes: 0), .failed)
- XCTAssertEqual(DownloadResume.decide(status: 416, partialBytes: 5), .failed)
+ XCTAssertEqual(DownloadResume.decide(status: 416, partialBytes: 5), .restart, "a complete or stale partial must not wedge every retry")
}
// Dependencies detect by artifacts, not by "our recipe ran" (plan Phase 0.3).
@@ -992,6 +995,7 @@ extension RegressionTests {
XCTAssertEqual(RegistryText.value(in: reg, key: "Software\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64", name: "Version"), "\"v14.44.35211.00\"")
XCTAssertNil(RegistryText.value(in: reg, key: "Software\\Nothing", name: "Release"))
XCTAssertEqual(RegistryText.dword("dword:00082348"), 533320)
+ XCTAssertEqual(RegistryText.value(in: reg, key: "SOFTWARE\\microsoft\\NET Framework Setup\\NDP\\v4\\Full", name: "release"), "dword:00082348", "the registry is case-insensitive")
let dir = FileManager.default.temporaryDirectory.appending(path: "hb-markers-\(UUID().uuidString)")
try FileManager.default.createDirectory(at: dir.appending(path: "drive_c/windows/system32"), withIntermediateDirectories: true)
@@ -1028,6 +1032,14 @@ extension RegressionTests {
XCTAssertEqual(plain.headline, "Steam is already running."); XCTAssertNil(plain.actionTitle)
}
+ // The decoder's migration flag is transient and must not appear in bottle.json.
+ func testNeedsSaveIsNotEncoded() throws {
+ var s = BottleSettings(name: "b", engineID: "e"); s.needsSave = true
+ let json = String(decoding: try JSONEncoder().encode(s), as: UTF8.self)
+ XCTAssertFalse(json.contains("needsSave"))
+ XCTAssertTrue(json.contains("\"formatVersion\":3"))
+ }
+
func testDefaultEnginePrefersBundledManifestID() throws {
func engine(_ id: String) throws -> InstalledEngine {
let json = #"{"id":"\#(id)","displayName":"e","arch":"x86_64","minMacOS":"14.0","components":{}}"#