Skip to content

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

Disable Wine's menu builder in every bottle environment

Gauthier Piarrettec52a64edd5a6
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swift
index fa459a5..75ac29d 100644
--- a/Sources/HighballKit/Bottle.swift
+++ b/Sources/HighballKit/Bottle.swift
@@ -366,6 +366,12 @@ public struct Bottle: Sendable {
default: break
}
}
+ // Wine's menu builder writes .lnk shortcuts and app bundles onto the macOS Desktop and
+ // into ~/Applications for every installer that asks. Sikarugir's engines leave the
+ // 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"])
if !settings.dllOverrides.isEmpty { merge(&env, ["WINEDLLOVERRIDES+": settings.dllOverrides]) }
merge(&env, settings.environment)
merge(&env, try (renderer ?? settings.renderer).environment(engine: engine))
diff --git a/Tests/HighballKitTests/EnvironmentTests.swift b/Tests/HighballKitTests/EnvironmentTests.swift
index 38fa1a0..7ba65bd 100644
--- a/Tests/HighballKitTests/EnvironmentTests.swift
+++ b/Tests/HighballKitTests/EnvironmentTests.swift
@@ -39,6 +39,15 @@ final class EnvironmentTests: XCTestCase {
XCTAssertEqual(env["WINEMSYNC"], "0")
}
+ // Wine's menu builder must never run: it writes shortcuts onto the macOS Desktop for every
+ // installer (three of them appeared during the CrossOver-tree engine's first tests). The
+ // user's own overrides still append after it.
+ func testMenuBuilderDisabledOnEveryRenderer() throws {
+ 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")
+ }
+
func testPrefixAndDebugAlwaysSet() throws {
let (engine, bottle) = try fixtures()
let env = try bottle.environment(engine: engine, renderer: .wined3d)
@@ -52,7 +61,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")
+ XCTAssertEqual(env["WINEDLLOVERRIDES"], "version=n,b;winemenubuilder.exe=d", "the bottle's overrides sit in front of Highball's own")
bottle.settings.environment["WINEDLLOVERRIDES+"] = "libglesv2=d"
env = try bottle.environment(engine: engine, renderer: .wined3d)