Skip to content

Commit

Permalink
Fixes steam installscript aborting
Browse files Browse the repository at this point in the history
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
  • Loading branch information
popsUlfr committed Dec 30, 2018
1 parent 7ba036a commit ecc05f1
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions proton
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ecc05f1

Please sign in to comment.