Skip to content

Commit

Permalink
proton: allow umu clients to run winetricks verbs
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jun 18, 2024
1 parent aaefd2a commit 6784f63
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions proton
Original file line number Diff line number Diff line change
Expand Up @@ -1682,15 +1682,6 @@ class Session:
else:
argv = [g_proton.wine64_bin, "c:\\windows\\system32\\steam.exe"]

if 'winetricks' in self.cmdlineappend:
after_winetricks = self.cmdlineappend.split('winetricks', 1)[1]
arguments = after_winetricks.split()
if len(arguments) == 0:
protonfixes.util.protontricks('gui')
else:
protonfixes.util.protontricks(arguments)
sys.exit(0)

rc = self.run_proc(adverb + argv + sys.argv[2:] + self.cmdlineappend)

if remote_debug_proc:
Expand Down Expand Up @@ -1728,6 +1719,24 @@ if __name__ == "__main__":

g_session.init_session(sys.argv[1] != "runinprefix")

# Allow umu clients to run winetricks verbs and be the frontend for them
if (
g_session.env.get("UMU_ID")
and g_session.env.get("EXE", "").endswith("winetricks")
and g_session.env.get("PROTON_VERB") == "waitforexitandrun"
):
wt_verbs = " ".join(sys.argv[2:][2:])
g_session.env["WINE"] = g_proton.wine_bin
g_session.env["WINELOADER"] = g_proton.wine_bin
g_session.env["WINESERVER"] = g_proton.wineserver_bin
g_session.env["WINETRICKS_LATEST_VERSION_CHECK"] = "disabled"
g_session.env["LD_PRELOAD"] = ""

log(f"Running winetricks verbs in prefix: {wt_verbs}")
rc = subprocess.run(sys.argv[2:], check=False, env=g_session.env).returncode

sys.exit(rc)

import protonfixes

#determine mode
Expand Down

0 comments on commit 6784f63

Please sign in to comment.