From 575d9bc1f96f6dc4551338d050e787158312d605 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 22 Apr 2021 12:43:54 +0300 Subject: [PATCH] Don't install amd_ags_x64 into prefix The DLL ships with the games and having the built-in version in system32/syswow64 has unexpected consequences. If the game is launched from a subdirectory, but the DLL is in current working directory, the built-in takes precedence as CWD has lower search priority than system directories (with the default SafeDllSearchMode). By not installing amd_ags_x64.dll in system32/syswow64 the built-in is still picked up correctly from lib/ when necessary. There's an accompanying patch for wine that makes sure wineboot won't install the dll, but since we construct our default_pfx in a special way we also need to make sure that files won't get copied/linked there. To make prefix updates smooth this change also removes any stale amd_ags_x64.dlls that may have been installed by previous version of Proton. CW-Bug-Id: 18804 --- default_pfx.py | 3 +++ proton | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/default_pfx.py b/default_pfx.py index 7985cd8c..db413d41 100755 --- a/default_pfx.py +++ b/default_pfx.py @@ -50,9 +50,12 @@ def make_relative_symlink(target, linkname): os.symlink(rel, linkname) def setup_dll_symlinks(default_pfx_dir, dist_dir): + skip_dlls = [ 'amd_ags_x64.dll' ] for walk_dir, dirs, files in os.walk(default_pfx_dir): for file_ in files: filename = os.path.join(walk_dir, file_) + if file_ in skip_dlls: + continue if os.path.isfile(filename) and file_is_wine_builtin_dll(filename): bitness = dll_bitness(filename) if bitness == 32: diff --git a/proton b/proton index edfc8068..b3df1c35 100755 --- a/proton +++ b/proton @@ -20,7 +20,7 @@ from filelock import FileLock #To enable debug logging, copy "user_settings.sample.py" to "user_settings.py" #and edit it if needed. -CURRENT_PREFIX_VERSION="6.3-1" +CURRENT_PREFIX_VERSION="6.3-2" PFX="Proton: " ld_path_var = "LD_LIBRARY_PATH" @@ -308,6 +308,13 @@ class CompatData: log("Unable to write new registry file to " + self.prefix_dir + "system.reg") pass + stale_builtins = [self.prefix_dir + "/drive_c/windows/system32/amd_ags_x64.dll", + self.prefix_dir + "/drive_c/windows/syswow64/amd_ags_x64.dll" ] + for builtin in stale_builtins: + if os.path.lexists(builtin) and file_is_wine_builtin_dll(builtin): + log("Removing stale builtin " + builtin) + os.remove(builtin) + except ValueError: log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.") #Just let the Wine upgrade happen and hope it works...