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
Four fixes from the issue sweep of 2026-10-21.
Gauthier Piarrette596df2fbf758
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swiftindex 3aa45cd..5b765a5 100644--- a/Sources/HighballApp/AppState.swift+++ b/Sources/HighballApp/AppState.swift@@ -1093,7 +1093,10 @@ final class AppState {let m = try? EngineManifest.load(from: url),// An installed copy missing its Wine files counts as not installed: it fails every// launch (highball#118), and installing it again over itself is the repair.- !engines.contains(where: { $0.id == m.id && $0.isComplete }) else { return nil }+ !engines.contains(where: { $0.id == m.id && $0.isComplete }),+ // An install set up on the other architecture (the native line, where Rosetta could not+ // be installed: highball#413) has nothing the bundled engine would update.+ engines.contains(where: { $0.manifest.arch == m.arch }) else { return nil }return m}@@ -1372,11 +1375,20 @@ final class AppState {done: DoneState(title: L("Highball is ready"), ctaTitle: nil, cta: nil),stop: .cancelTask(label: L("Stop"))) { [self] infunnel(.installStarted)- let manifest = try EngineManifest.load(from: manifestURL)+ var manifest = try EngineManifest.load(from: manifestURL)if manifest.requiresRosetta, !rosettaInstalled {await MainActor.run { self.stage = L("Installing Rosetta, Apple's compatibility layer") }- try await Self.installRosetta()- await MainActor.run { self.rosettaInstalled = true; self.appendLog("Rosetta installed") }+ do {+ try await Self.installRosetta()+ await MainActor.run { self.rosettaInstalled = true; self.appendLog("Rosetta installed") }+ } catch {+ // An engine this install sees that needs no Rosetta (the native line, with the+ // preview key) sets the Mac up instead of a dead end (highball#413).+ guard engines.isEmpty, let native = EngineStore.startingEngineWithoutRosetta(known: Self.knownManifests) else { throw error }+ let id = native.id+ await MainActor.run { self.appendLog("Rosetta could not be installed, so setup uses \(id), which runs without it") }+ manifest = native+ }}if engines.isEmpty {_ = try await engineStore.install(manifest, accepted: []) { name, received, total in@@ -1417,7 +1429,13 @@ final class AppState {}.valuelet installed = rosettaWorks()guard out.0 == 0 || installed else {- throw HighballError.failed("Rosetta did not install. In Terminal, run: softwareupdate --install-rosetta --agree-to-license, then press Get started again. (\(out.1.trimmingCharacters(in: .whitespacesAndNewlines).suffix(200)))")+ let said = out.1.trimmingCharacters(in: .whitespacesAndNewlines)+ // "Rosetta 2 update is not available" comes back when macOS cannot load Apple's update+ // catalog at all; running the same command in Terminal then fails the same way (highball#413).+ if said.localizedCaseInsensitiveContains("is not available") || said.localizedCaseInsensitiveContains("software update server") {+ throw HighballError.failed("macOS could not get Rosetta from Apple's software update server. Check that this Mac can reach Apple's servers (a VPN, firewall or content filter can block them, and so can a managed Mac's settings), then press Get started again. (\(said.suffix(200)))")+ }+ throw HighballError.failed("Rosetta did not install. In Terminal, run: softwareupdate --install-rosetta --agree-to-license, then press Get started again. (\(said.suffix(200)))")}}@@ -1776,16 +1794,41 @@ final class AppState {catch { fail(error) }}- func createBottle(name: String, recipeID: String?) {- guard let engine = defaultEngine else {+ /// The engines New environment offers besides the default one (EngineStore.newEnvironmentAlternatives):+ /// none unless this install sees a line built for the other architecture.+ var newEnvironmentEngines: [String] {+ guard let fallback = defaultEngine else { return [] }+ return EngineStore.newEnvironmentAlternatives(defaultArch: fallback.manifest.arch, installed: engines, known: Self.knownManifests)+ }++ /// `engineID` is one of `newEnvironmentEngines`, nil for the default engine. One that is not+ /// installed downloads first, with the licences accepted on installed engines.+ func createBottle(name: String, recipeID: String?, engineID: String? = nil) {+ guard let fallback = defaultEngine else {fail(HighballError.failed("No engine is installed yet. Reinstall Highball, or restart it to finish setup.")); return}guard !busy else {fail(HighballError.failed("Highball is already busy. Wait for the current step to finish, then try again — its progress is on the strip at the bottom of the window.")); return}+ let chosen = engineID.flatMap { id in engines.first { $0.id == id } }+ let download = chosen == nil ? engineID.flatMap { id in Self.knownManifests.first { $0.id == id } } : nil+ if let engineID, chosen == nil, download == nil {+ fail(HighballError.failed("Engine \(engineID) is not offered by this version of Highball.")); return+ }+ let accepted = Set(engines.flatMap { $0.manifest.acceptedLicenses ?? [] })runBusy(String(format: L("Creating the %@ environment — first boot takes about 90 seconds"), name),done: DoneState(title: String(format: L("The %@ environment is ready"), name), ctaTitle: nil, cta: nil),stop: .cancelTask(label: L("Stop"))) { [self] in+ var fresh: InstalledEngine?+ if let download {+ await MainActor.run { self.stage = String(format: L("Downloading engine %@"), download.id) }+ let installed = try await engineStore.install(download, accepted: accepted) { name, received, total in+ Task { @MainActor in self.reportDownload(name, received: received, total: total) }+ }+ await MainActor.run { self.appendLog("engine \(installed.id) installed"); self.refresh() }+ fresh = installed+ }+ let engine = fresh ?? chosen ?? fallbacklet bottle = try await bottleStore.create(name: name, engine: engine)await MainActor.run { self.appendLog("bottle created") }if let recipeID, let recipe = Self.recipe(recipeID) {@@ -2519,6 +2562,16 @@ final class AppState {// 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) } }+ // A client a game's Play started under D3DMetal shows a black window; with no game+ // running it is restarted so the window gets the mode it draws with (highball#416).+ if isSteamUI(pin),+ let window = SteamRestart.windowRenderer(shortcut: pin.renderer, environment: bottle.settings.renderer,+ dxmtRuns: Renderer.dxmt.availability(in: engine) == .available),+ let live = runner.runningSteamEnvironment(), SteamRestart.windowNeedsRestart(live: live, window: window),+ !runner.steamGameIsRunning() {+ await MainActor.run { self.appendLog("Steam was running with D3DMetal, which leaves its window black, so it restarts with \(Renderer.displayName(window))") }+ try await runner.stopSteam()+ }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 */ }diff --git a/Sources/HighballApp/HighballApp.swift b/Sources/HighballApp/HighballApp.swiftindex 18cf094..a7256a5 100644--- a/Sources/HighballApp/HighballApp.swift+++ b/Sources/HighballApp/HighballApp.swift@@ -618,6 +618,8 @@ struct CreateBottleSheet: View {@Environment(\.dismiss) private var dismiss@State private var name = "play"@State private var installSteam = true+ /// nil is the default engine; the picker shows only when the other architecture's line is offered.+ @State private var engineID: String?var body: some View {VStack(alignment: .leading, spacing: 14) {@@ -626,6 +628,16 @@ struct CreateBottleSheet: View {if let problem = nameProblem, !name.trimmingCharacters(in: .whitespaces).isEmpty {Text(L(problem)).font(.caption).foregroundStyle(.orange).frame(maxWidth: 380, alignment: .leading)}+ let others = state.newEnvironmentEngines+ if !others.isEmpty, let standard = state.defaultEngine {+ Picker(L("Engine"), selection: $engineID) {+ Text(String(format: L("%@ (default)"), standard.id)).tag(String?.none)+ ForEach(others, id: \.self) { id in Text(id).tag(String?.some(id)) }+ }+ .frame(width: 380)+ Text(L("An environment can't switch later between engines that run through Rosetta and engines that run natively on Apple silicon, so that choice is made here."))+ .font(.caption).foregroundStyle(.secondary).frame(maxWidth: 380, alignment: .leading)+ }Toggle(L("Install Steam in it (recommended)"), isOn: $installSteam)Text(L("An environment is an isolated Windows install. First boot takes about 90 seconds; installing Steam adds a download and a slow one-time client update.")).font(.callout).foregroundStyle(.secondary).frame(maxWidth: 380, alignment: .leading)@@ -634,7 +646,7 @@ struct CreateBottleSheet: View {Button(L("Cancel")) { dismiss() }Button(state.busy ? L("Working…") : L("Create")) {dismiss()- state.createBottle(name: name, recipeID: installSteam ? "steam" : nil)+ state.createBottle(name: name, recipeID: installSteam ? "steam" : nil, engineID: engineID)}.keyboardShortcut(.defaultAction).disabled(nameProblem != nil || state.busy)diff --git a/Sources/HighballApp/L10n.swift b/Sources/HighballApp/L10n.swiftindex b0a9945..6e5d1f2 100644--- a/Sources/HighballApp/L10n.swift+++ b/Sources/HighballApp/L10n.swift@@ -631,6 +631,8 @@ enum L10n {"Open Troubleshooting": "Ouvrir le dépannage",// Added 2026-09-15: every L() key must have a French line (make-app refuses to build otherwise)"New environment": "Nouvel environnement",+ "%@ (default)": "%@ (par défaut)",+ "An environment can't switch later between engines that run through Rosetta and engines that run natively on Apple silicon, so that choice is made here.": "Un environnement ne peut pas passer plus tard d'un moteur qui passe par Rosetta à un moteur natif Apple silicon, ni l'inverse, donc ce choix se fait ici.","'%@' isn't a Windows program. Highball opens .exe, .msi and .bat files.": "« %@ » n'est pas un programme Windows. Highball ouvre les fichiers .exe, .msi et .bat.","Programs here start with %@ until this is resolved: %@": "Les programmes d'ici démarrent avec %@ tant que ce n'est pas résolu : %@","-dx11 -skiplauncher \"an argument with spaces\"": "-dx11 -skiplauncher \"un argument avec des espaces\"",diff --git a/Sources/HighballKit/EngineStore.swift b/Sources/HighballKit/EngineStore.swiftindex 6d0b02a..448797e 100644--- a/Sources/HighballKit/EngineStore.swift+++ b/Sources/HighballKit/EngineStore.swift@@ -194,6 +194,30 @@ public struct EngineStore: Sendable {return rows}+ /// The engines New environment offers besides the default: the newest revision of each line built+ /// for another architecture than the default engine's, installed or known. An environment never+ /// changes architecture (`sameArch`), so before this the native arm64 line was reachable only+ /// through a game recipe that pins it, whatever the preview key said (highball-db#537). Empty when+ /// every engine this install sees shares the default's architecture, which is nearly everyone,+ /// and New environment then asks nothing.+ public static func newEnvironmentAlternatives(defaultArch: String, installed: [InstalledEngine], known: [EngineManifest],+ macOS: String = EngineManifest.currentMacOS) -> [String] {+ var ids = Set(installed.filter { $0.manifest.arch != defaultArch }.map(\.id))+ ids.formUnion(known.filter { $0.arch != defaultArch && $0.runs(onMacOS: macOS) }.map(\.id))+ var lines = Set<String>()+ return ids.sorted { $0.compare($1, options: .numeric) == .orderedDescending }+ .filter { lines.insert(EngineManifest.line(of: $0) ?? $0).inserted }+ }++ /// The engine Get started sets up on when the bundled one needs Rosetta and Rosetta could not be+ /// installed: the newest engine this install sees that runs without it on this macOS, nil when it+ /// sees none (no preview key). A Mac on macOS 27 whose update server never answered failed setup+ /// in under a second while the native line sat in the bundle and the preview key was set (highball#413).+ public static func startingEngineWithoutRosetta(known: [EngineManifest], macOS: String = EngineManifest.currentMacOS) -> EngineManifest? {+ known.filter { !$0.requiresRosetta && $0.runs(onMacOS: macOS) }+ .max { $0.id.compare($1.id, options: .numeric) == .orderedAscending }+ }+public func engine(_ id: String) throws -> InstalledEngine {let root = paths.engine(id)let m = try EngineManifest.load(from: root.appending(path: "manifest.json"))diff --git a/Sources/HighballKit/PlayReport.swift b/Sources/HighballKit/PlayReport.swiftindex ce5a036..ab5d137 100644--- a/Sources/HighballKit/PlayReport.swift+++ b/Sources/HighballKit/PlayReport.swift@@ -71,7 +71,7 @@ public enum PlayReport {if !s.recipes.isEmpty { lines.append("recipes \(s.recipes.joined(separator: ", "))") }if let pin {if let r = pin.renderer { lines.append("program mode \(r.rawValue)") }- if !pin.arguments.isEmpty { lines.append("program arguments \(pin.arguments.joined(separator: " "))") }+ if !pin.arguments.isEmpty { lines.append("program arguments \(WineRunner.redactedForReport(pin.arguments).joined(separator: " "))") }for (k, v) in pin.environment.sorted(by: { $0.key < $1.key }) { lines.append("program \(k)=\(v)") }}return lines.joined(separator: "\n")diff --git a/Sources/HighballKit/SteamRestart.swift b/Sources/HighballKit/SteamRestart.swiftindex 30ded1d..76d37bb 100644--- a/Sources/HighballKit/SteamRestart.swift+++ b/Sources/HighballKit/SteamRestart.swift@@ -27,6 +27,15 @@ public enum SteamRestart {return .dxmt}+ /// Whether opening Steam's window should restart the running client first: a game's Play started+ /// it in a D3DMetal environment, so it runs with D3DMetal and its window is black, while the window+ /// wants `window`. Show then brought back a black square that only deleting the environment+ /// cleared (highball#416, Wine 11 on an M5 Pro). The caller checks that no game is running.+ public static func windowNeedsRestart(live: [String: String], window: Renderer?) -> Bool {+ guard let window, window != .d3dmetal else { return false }+ return rendererName(ofLive: live) == Renderer.d3dmetal.rawValue+ }+/// What became of the running client before a launch.public enum Outcome: Equatable {/// No client runs; the launch cold-starts one with its own environment.diff --git a/Sources/HighballKit/WineRunner.swift b/Sources/HighballKit/WineRunner.swiftindex 45830f8..9a5e1c7 100644--- a/Sources/HighballKit/WineRunner.swift+++ b/Sources/HighballKit/WineRunner.swift@@ -100,10 +100,24 @@ public struct WineRunner: Sendable {.joined()}+ /// Launch arguments whose values are secrets or identify the player. Launchers pass them on the+ /// command line: an Epic game started through legendary gets its one-time exchange code as+ /// -AUTH_PASSWORD, its account name and its account id, and the header printed them into a+ /// public issue (highball#420, 2026-10-21).+ static let secretArgumentPrefixes = ["-auth_password=", "-epicusername=", "-epicuserid=", "-epicovt=", "-ticket=", "-token=", "-password="]++ /// The arguments as the header prints them, secret values replaced.+ static func redactedForReport(_ args: [String]) -> [String] {+ args.map { arg in+ guard let prefix = secretArgumentPrefixes.first(where: { arg.lowercased().hasPrefix($0) }) else { return arg }+ return String(arg.prefix(prefix.count)) + "[redacted]"+ }+ }+static func launchHeader(engine: InstalledEngine, bottle: Bottle, renderer: Renderer,env: [String: String], args: [String]) -> String {var out = "# gin \(engine.id) bottle=\(bottle.name) renderer=\(renderer)\n"- out += "# wine \(args.joined(separator: " "))\n"+ out += "# wine \(redactedForReport(args).joined(separator: " "))\n"out += "# sync=\(Self.effectiveSync(env: env, settings: bottle.settings))"out += " winver=\(bottle.settings.windowsVersion.rawValue) dpi=\(bottle.settings.dpiScale)"if bottle.settings.retinaAt100 && bottle.settings.dpiScale <= 96 { out += " retina" }diff --git a/Tests/HighballKitTests/EngineArchTests.swift b/Tests/HighballKitTests/EngineArchTests.swiftindex d5c28d3..6dbb1f4 100644--- a/Tests/HighballKitTests/EngineArchTests.swift+++ b/Tests/HighballKitTests/EngineArchTests.swift@@ -48,6 +48,37 @@ final class EngineArchTests: XCTestCase {XCTAssertFalse(EngineStore.sameArch(current: "arm64", target: "x86_64"))}+ /// highball-db#537: with the preview key set, the arm64 line showed nowhere a player could pick it.+ /// New environment offers the newest revision of each line of the other architecture, and nothing+ /// when there is none.+ func testNewEnvironmentOffersTheOtherArchitecturesNewestRevision() {+ let intel = manifest("x86_64", requires: ["rosetta2"])+ var arm1 = manifest("arm64"), arm6 = manifest("arm64"), arm10 = manifest("arm64"), future = manifest("arm64"), other = manifest("arm64")+ arm1.id = "arm64-wine11.18-r1"; arm6.id = "arm64-wine11.18-r6"; arm10.id = "arm64-wine11.18-r10"+ future.id = "arm64-wine12.0-r1"; future.minMacOS = "28.0"+ other.id = "arm64-wine11.20-r2"+ let root = tempRoot("hb-new-env")+ let installed = [InstalledEngine(manifest: intel, root: root.appending(path: intel.id)),+ InstalledEngine(manifest: arm1, root: root.appending(path: arm1.id))]+ XCTAssertEqual(EngineStore.newEnvironmentAlternatives(defaultArch: "x86_64", installed: installed, known: [arm6, arm10, future, other], macOS: "27.0.1"),+ ["arm64-wine11.20-r2", "arm64-wine11.18-r10"], "one row per line, newest revision, nothing above this macOS")+ XCTAssertEqual(EngineStore.newEnvironmentAlternatives(defaultArch: "x86_64", installed: installed, known: [], macOS: "27.0"),+ ["arm64-wine11.18-r1"], "an installed engine counts without its manifest")+ XCTAssertEqual(EngineStore.newEnvironmentAlternatives(defaultArch: "x86_64", installed: Array(installed.prefix(1)), known: [], macOS: "27.0"), [],+ "nothing to choose, nothing asked")+ XCTAssertEqual(EngineStore.newEnvironmentAlternatives(defaultArch: "arm64", installed: installed, known: [arm6], macOS: "27.0"),+ ["x64-test-r1"], "the same rule the other way round")+ }++ /// highball#413: Rosetta would not install, so Get started failed while the arm64 line was bundled.+ func testSetupWithoutRosettaTakesTheNewestNativeEngineItSees() {+ let intel = manifest("x86_64", requires: ["rosetta2"])+ var arm5 = manifest("arm64", requires: []), arm6 = manifest("arm64", requires: []), floor28 = manifest("arm64", requires: [])+ arm5.id = "arm64-wine11.18-r5"; arm6.id = "arm64-wine11.18-r6"; floor28.id = "arm64-wine11.18-r9"; floor28.minMacOS = "28.0"+ XCTAssertEqual(EngineStore.startingEngineWithoutRosetta(known: [intel, arm5, arm6, floor28], macOS: "27.0.1")?.id, "arm64-wine11.18-r6")+ XCTAssertNil(EngineStore.startingEngineWithoutRosetta(known: [intel], macOS: "27.0.1"), "without the preview key there is none")+ }+func testTheDownloadSizeCountsEachArchiveOnce() {var m = manifest("arm64")let renderers = URL(string: "https://example.com/renderers-arm64.tar.xz")!diff --git a/Tests/HighballKitTests/LaunchChecksTests.swift b/Tests/HighballKitTests/LaunchChecksTests.swiftindex bc02e93..583f313 100644--- a/Tests/HighballKitTests/LaunchChecksTests.swift+++ b/Tests/HighballKitTests/LaunchChecksTests.swift@@ -31,6 +31,27 @@ final class LaunchChecksTests: XCTestCase {"# DXMT_ALLOW_CROSS_PROCESS_SWAPCHAIN=1\n# MVK_CONFIG_USE_MTLHEAP=0\n# SDL_JOYSTICK_MFI=0\n# WINE_NO_DELAYED_FORK=1\n")}+ /// highball#420: an Epic game's launch printed its exchange code and account into a public issue.+ func testTheHeaderKeepsSecretArgumentsOut() {+ let args = ["C:\\Games\\installer.exe", "-AUTH_LOGIN=unused", "-AUTH_PASSWORD=b591ee791c13", "-AUTH_TYPE=exchangecode",+ "-epicapp=d91f8774", "-epicusername=Someone", "-epicuserid=0123abcd", "-applaunch", "620"]+ XCTAssertEqual(WineRunner.redactedForReport(args),+ ["C:\\Games\\installer.exe", "-AUTH_LOGIN=unused", "-AUTH_PASSWORD=[redacted]", "-AUTH_TYPE=exchangecode",+ "-epicapp=d91f8774", "-epicusername=[redacted]", "-epicuserid=[redacted]", "-applaunch", "620"])+ }++ /// highball#416: a client a game's Play started under D3DMetal showed a black window on Show Steam.+ func testSteamWindowRestartsOnlyFromD3DMetal() {+ let engine = "/Users/x/Library/Application Support/Highball/engines/x64-crossover26.3-r27"+ let d3dmetal = ["WINEDLLPATH_PREPEND": "\(engine)/renderers/d3dmetal-tsshim/wine:\(engine)/frameworks/renderer/d3dmetal/wine:\(engine)/renderers/dxmt/wine"]+ let dxmt = ["WINEDLLPATH_PREPEND": "\(engine)/renderers/dxmt/wine:\(engine)/frameworks/renderer/d9vk/wine"]+ let dxvk = ["WINEDLLPATH_PREPEND": "\(engine)/frameworks/renderer/d9vk/wine:\(engine)/frameworks/renderer/dxvk/wine"]+ XCTAssertTrue(SteamRestart.windowNeedsRestart(live: d3dmetal, window: .dxmt))+ XCTAssertFalse(SteamRestart.windowNeedsRestart(live: dxmt, window: .dxmt), "already drawing")+ XCTAssertFalse(SteamRestart.windowNeedsRestart(live: dxvk, window: .dxmt), "not the black case")+ XCTAssertFalse(SteamRestart.windowNeedsRestart(live: d3dmetal, window: nil), "the window keeps the environment's mode")+ }+/// 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("""