Skip to content

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

fix: winetricks invocations get WINE_BIN/WINESERVER_BIN/WINE_BINDIR and bash (#16)

Gauthier Piarretteb93e1751dace
diff --git a/Sources/HighballKit/Recipe.swift b/Sources/HighballKit/Recipe.swift
index 1b81a14..50fcd81 100644
--- a/Sources/HighballKit/Recipe.swift
+++ b/Sources/HighballKit/Recipe.swift
@@ -134,8 +134,18 @@ public struct RecipeRunner: Sendable {
try await runner.regAdd(key: key, name: name, type: type, data: data)
case let .winetricks(verbs):
guard let wt = engine.winetricks else { throw HighballError.missing("winetricks in engine \(engine.id)") }
- let env = try bottle.environment(engine: engine, renderer: .wined3d, extra: ["WINE": engine.wineBinary.path, "WINESERVER": engine.wineserverBinary.path])
- try Shell.run("/bin/sh", [wt.path, "--unattended"] + verbs, env: env)
+ // WINE_BIN/WINESERVER_BIN/WINE_BINDIR are winetricks' own overrides for setups where
+ // its binary detection fails; without them dotnet48 and friends abort on this engine
+ // (verified 2026-08-25, issue #16). bash rather than sh for the same reason winetricks
+ // documents on macOS.
+ let env = try bottle.environment(engine: engine, renderer: .wined3d, extra: [
+ "WINE": engine.wineBinary.path,
+ "WINESERVER": engine.wineserverBinary.path,
+ "WINE_BIN": engine.wineBinary.path,
+ "WINESERVER_BIN": engine.wineserverBinary.path,
+ "WINE_BINDIR": engine.wineBinary.deletingLastPathComponent().path,
+ ])
+ try Shell.run("/bin/bash", [wt.path, "--unattended"] + verbs, env: env)
case let .environment(name, value):
bottle.settings.environment[name] = value
case let .renderer(r):
diff --git a/Sources/highball/main.swift b/Sources/highball/main.swift
index a682566..3061a7b 100644
--- a/Sources/highball/main.swift
+++ b/Sources/highball/main.swift
@@ -281,6 +281,9 @@ struct Tricks: AsyncParsableCommand {
guard let wt = eng.winetricks else { fail("winetricks not installed in engine \(eng.id)") }
var env = try b.environment(engine: eng, renderer: .wined3d)
env["WINE"] = eng.wineBinary.path
+ env["WINE_BIN"] = eng.wineBinary.path
+ env["WINESERVER_BIN"] = eng.wineserverBinary.path
+ env["WINE_BINDIR"] = eng.wineBinary.deletingLastPathComponent().path
env["WINESERVER"] = eng.wineserverBinary.path
env["PATH"] = "\(eng.engineDir.appending(path: "bin").path):/usr/bin:/bin:/usr/sbin:/sbin"
let out = try Shell.capture("/bin/sh", [wt.path, "--unattended"] + verbs, env: env)