Skip to content

Commit 159460e

Browse files
committed
Set WINE_BIN and WINESERVER_BIN env vars
Set `WINE_BIN` and `WINESERVER_BIN` when launching a Protontricks command. Winetricks uses these to target specific files during the "binary bitness" check; prior to this Winetricks would attempt to read the wrapper scripts instead, causing spurious warnings to be printed. Resolves #383
1 parent a7319c5 commit 159460e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
## [Unreleased]
88
### Fixed
99
- Fix missing app icons for games installed using newer Steam client
10+
- Fix spurious "unknown file arch" Winetricks warnings (newer Winetricks required)
1011

1112
## [1.12.0] - 2024-09-16
1213
### Added

src/protontricks/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ def run_command(
465465
"Setting WINE environment variable to Proton bundled version."
466466
)
467467
wine_environ["WINE"] = str(wine_bin_dir / "wine")
468+
wine_environ["WINE_BIN"] = str(
469+
proton_app.proton_dist_path / "bin" / "wine"
470+
)
468471

469472
wine_environ["WINELOADER"] = wine_environ["WINE"]
470473

@@ -474,6 +477,9 @@ def run_command(
474477
"Setting WINESERVER environment variable to Proton bundled version"
475478
)
476479
wine_environ["WINESERVER"] = str(wine_bin_dir / "wineserver")
480+
wine_environ["WINESERVER_BIN"] = str(
481+
proton_app.proton_dist_path / "bin" / "wineserver"
482+
)
477483

478484
temp_dir = Path(tempfile.mkdtemp(prefix="protontricks-"))
479485
wine_environ["PROTONTRICKS_TEMP_PATH"] = str(temp_dir)

tests/test_util.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ def test_user_environment_variables_used(
8484
assert command.env["WINELOADER"] == str(wine_bin_dir / "wine")
8585
assert command.env["WINESERVER"] == str(wine_bin_dir / "wineserver")
8686

87+
assert command.env["WINE_BIN"] == str(
88+
default_proton.proton_dist_path / "bin" / "wine"
89+
)
90+
assert command.env["WINESERVER_BIN"] == str(
91+
default_proton.proton_dist_path / "bin" / "wineserver"
92+
)
93+
8794
monkeypatch.setenv("WINE", "/fake/wine")
8895
monkeypatch.setenv("WINESERVER", "/fake/wineserver")
8996

0 commit comments

Comments
 (0)