fix: seed redist markers into new prefixes before install scripts (#2327)

* fix: initialize Proton prefix before install scripts

* game-env: start Proton first only for a new prefix

* fix: wait for new prefix wineserver before seeding

* game-env: find wineserver in either Proton layout

* fix(steam): skip redist seeding when wineserver wait fails

* fix(steam): probe new prefixes only when Proton has no template prefix

* fix(steam): check the active Proton prefix template before seeding

* fix(steam): use effective environment for redist seeding
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-17 17:05:38 -05:00
1 parent cbde8b1f25
commit eb5aa7a536
2 files changed
+167 -8

No files matched your search

@@ -2,6 +2,7 @@
import hashlib
import json
import os
import platform
import re
import runpy
import signal
@@ -753,6 +754,26 @@ def mark_install_scripts(command, env):
scripts = [path for path in scripts if os.path.isfile(path)]
if not scripts:
return []
data = env.get("STEAM_COMPAT_DATA_PATH")
tool = os.path.dirname(command[0])
new_prefix = data and not os.path.isfile(os.path.join(data, "pfx", "system.reg"))
template = "default_pfx"
if env.get("PROTON_USE_ARM64", "1") == "1" and platform.machine() == "aarch64" and os.path.isdir(os.path.join(tool, "files/bin-arm64")):
template = "default_pfx_arm64"
if new_prefix and not os.path.isfile(os.path.join(tool, "files/share", template, "system.reg")):
try:
subprocess.run([command[0], "run", "cmd.exe", "/c", "exit", "0"], env=env,
stdout=sys.stderr, stderr=sys.stderr, timeout=120, check=False)
except (OSError, subprocess.SubprocessError) as error:
print("droiddeck-game-env: prefix initialization failed (%s)" % error, file=sys.stderr)
try:
wineserver = next((path for path in (os.path.join(tool, "files", name, "wineserver") for name in ("bin-arm64", "bin"))
if os.access(path, os.X_OK)), os.path.join(tool, "files/bin-arm64/wineserver"))
subprocess.run([wineserver, "-w"], env=dict(env, WINEPREFIX=os.path.join(data, "pfx")),
stdout=sys.stderr, stderr=sys.stderr, timeout=120, check=True)
except (OSError, subprocess.SubprocessError) as error:
print("droiddeck-game-env: wineserver wait failed (%s)" % error, file=sys.stderr)
return scripts
try:
subprocess.run([SEED_REDISTS, root], env=dict(env, DROIDDECK_SEED_SCRIPTS="\n".join(scripts)),
stdout=sys.stderr, timeout=60, check=False)
@@ -1338,7 +1359,7 @@ def main():
if fixed:
print("droiddeck-game-env: replaced foreign-architecture system DLLs with this Proton's own: %s" % ", ".join(fixed),
file=sys.stderr)
scripts = mark_install_scripts(command, env)
scripts = mark_install_scripts(command, effective_env)
if scripts and install_scripts_done(scripts, env):
print("droiddeck-game-env: install scripts already run in this prefix; evaluator skipped", file=sys.stderr)
return 0