From ecc05f16def0f3d4524139ea03e22e1809917e05 Mon Sep 17 00:00:00 2001 From: Philipp Richter Date: Sun, 30 Dec 2018 16:15:05 +0100 Subject: [PATCH] Fixes steam installscript aborting To enable/disable gallium nine, the appropriate registry key is either added or deleted. This will print a harmless error about the key not existing. However this might be interpreted by steam as a failure and thus will abort dependency installation. Any output is forwarded to /dev/null now. Should fix #6 and #7 --- proton | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/proton b/proton index c6a3738ff..37c16e4a3 100755 --- a/proton +++ b/proton @@ -16,6 +16,11 @@ import tarfile from filelock import FileLock from vkquery import is_vulkan_supported +try: + from subprocess import DEVNULL # Python 3.3 +except ImportError: + DEVNULL = open(os.devnull, 'wb') + #To enable debug logging, copy "user_settings.sample.py" to "user_settings.py" #and edit it if needed. @@ -429,14 +434,25 @@ else: check_environment("PROTON_USE_GALLIUM_NINE", "galliumnine") if "galliumnine" in config_opts: - run_wine([wine_path, "reg", "add", "HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects", "/v", "d3d9", "/d", "d3d9-nine.dll", "/f"]) + subprocess.call([wine_path, "reg", "add", + "HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects", + "/v", "d3d9", + "/d", "d3d9-nine.dll", + "/f"], env=env, stdout=DEVNULL, stderr=DEVNULL) if "PROTON_GALLIUM_NINE_MODULEPATH" in os.environ: env["PROTON_GALLIUM_NINE_MODULEPATH"] = os.environ["PROTON_GALLIUM_NINE_MODULEPATH"] elif not "PROTON_GALLIUM_NINE_MODULEPATH" in env: env["PROTON_GALLIUM_NINE_MODULEPATH"] = "/usr/lib32/d3d/d3dadapter9.so.1:/usr/lib64/d3d/d3dadapter9.so.1" - run_wine([wine_path, "reg", "add", "HKEY_CURRENT_USER\\Software\\Wine\\Direct3DNine", "/v", "ModulePath", "/d", env["PROTON_GALLIUM_NINE_MODULEPATH"], "/f"]) + subprocess.call([wine_path, "reg", "add", + "HKEY_CURRENT_USER\\Software\\Wine\\Direct3DNine", + "/v", "ModulePath", + "/d", env["PROTON_GALLIUM_NINE_MODULEPATH"], + "/f"], env=env, stdout=DEVNULL, stderr=DEVNULL) else: - run_wine([wine_path, "reg", "delete", "HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects", "/v", "d3d9", "/f"]) + subprocess.call([wine_path, "reg", "delete", + "HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects", + "/v", "d3d9", + "/f"], env=env, stdout=DEVNULL, stderr=DEVNULL) ARCH_UNKNOWN=0 ARCH_I386=1