mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-27 05:58:16 +03:00
proton: Add overridable DLLs to the tracked_files.
This commit is contained in:
parent
83e40165ba
commit
808920b6b3
53
proton
53
proton
@ -110,7 +110,7 @@ def merge_user_dir(src, dst):
|
|||||||
extant_dirs += dst_dir
|
extant_dirs += dst_dir
|
||||||
|
|
||||||
def try_copy(src, dst, prefix=None, add_write_perm=True, copy_metadata=False, optional=False,
|
def try_copy(src, dst, prefix=None, add_write_perm=True, copy_metadata=False, optional=False,
|
||||||
follow_symlinks=True):
|
follow_symlinks=True, track_file=False):
|
||||||
try:
|
try:
|
||||||
if prefix is not None:
|
if prefix is not None:
|
||||||
dst = os.path.join(prefix, dst)
|
dst = os.path.join(prefix, dst)
|
||||||
@ -120,6 +120,8 @@ def try_copy(src, dst, prefix=None, add_write_perm=True, copy_metadata=False, op
|
|||||||
|
|
||||||
if os.path.lexists(dst):
|
if os.path.lexists(dst):
|
||||||
os.remove(dst)
|
os.remove(dst)
|
||||||
|
elif track_file and prefix is not None:
|
||||||
|
track_file.write(os.path.relpath(dst, prefix) + '\n')
|
||||||
|
|
||||||
if copy_metadata:
|
if copy_metadata:
|
||||||
shutil.copy2(src, dst, follow_symlinks=follow_symlinks)
|
shutil.copy2(src, dst, follow_symlinks=follow_symlinks)
|
||||||
@ -729,8 +731,7 @@ class CompatData:
|
|||||||
with open(self.tracked_files_file, "a") as tracked_files:
|
with open(self.tracked_files_file, "a") as tracked_files:
|
||||||
#copy steam files into place
|
#copy steam files into place
|
||||||
steam_dir = "drive_c/Program Files (x86)/Steam/"
|
steam_dir = "drive_c/Program Files (x86)/Steam/"
|
||||||
dst = self.prefix_dir + steam_dir
|
makedirs(self.prefix_dir + steam_dir)
|
||||||
makedirs(dst)
|
|
||||||
filestocopy = [("steamclient.dll", "steamclient.dll"),
|
filestocopy = [("steamclient.dll", "steamclient.dll"),
|
||||||
("steamclient64.dll", "steamclient64.dll"),
|
("steamclient64.dll", "steamclient64.dll"),
|
||||||
("GameOverlayRenderer64.dll", "GameOverlayRenderer64.dll"),
|
("GameOverlayRenderer64.dll", "GameOverlayRenderer64.dll"),
|
||||||
@ -739,12 +740,7 @@ class CompatData:
|
|||||||
for (src,tgt) in filestocopy:
|
for (src,tgt) in filestocopy:
|
||||||
srcfile = steamdir + '/legacycompat/' + src
|
srcfile = steamdir + '/legacycompat/' + src
|
||||||
if os.path.isfile(srcfile):
|
if os.path.isfile(srcfile):
|
||||||
dstfile = dst + tgt
|
try_copy(srcfile, steam_dir + tgt, prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
if os.path.isfile(dstfile):
|
|
||||||
os.remove(dstfile)
|
|
||||||
else:
|
|
||||||
tracked_files.write(steam_dir + tgt + "\n")
|
|
||||||
try_copy(srcfile, steam_dir + tgt, prefix=self.prefix_dir)
|
|
||||||
|
|
||||||
filestocopy = [("steamclient64.dll", "steamclient64.dll"),
|
filestocopy = [("steamclient64.dll", "steamclient64.dll"),
|
||||||
("GameOverlayRenderer.dll", "GameOverlayRenderer.dll"),
|
("GameOverlayRenderer.dll", "GameOverlayRenderer.dll"),
|
||||||
@ -752,34 +748,29 @@ class CompatData:
|
|||||||
for (src,tgt) in filestocopy:
|
for (src,tgt) in filestocopy:
|
||||||
srcfile = g_proton.path(src)
|
srcfile = g_proton.path(src)
|
||||||
if os.path.isfile(srcfile):
|
if os.path.isfile(srcfile):
|
||||||
dstfile = dst + tgt
|
try_copy(srcfile, steam_dir + tgt, prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
if os.path.isfile(dstfile):
|
|
||||||
os.remove(dstfile)
|
|
||||||
else:
|
|
||||||
tracked_files.write(steam_dir + tgt + "\n")
|
|
||||||
try_copy(srcfile, steam_dir + tgt, prefix=self.prefix_dir)
|
|
||||||
|
|
||||||
#copy openvr files into place
|
#copy openvr files into place
|
||||||
makedirs(self.prefix_dir + "/drive_c/vrclient/bin")
|
makedirs(self.prefix_dir + "/drive_c/vrclient/bin")
|
||||||
try_copy(g_proton.lib_dir + "wine/i386-windows/vrclient.dll", "drive_c/vrclient/bin",
|
try_copy(g_proton.lib_dir + "wine/i386-windows/vrclient.dll", "drive_c/vrclient/bin",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.lib64_dir + "wine/x86_64-windows/vrclient_x64.dll", "drive_c/vrclient/bin",
|
try_copy(g_proton.lib64_dir + "wine/x86_64-windows/vrclient_x64.dll", "drive_c/vrclient/bin",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
try_copy(g_proton.lib_dir + "wine/dxvk/openvr_api_dxvk.dll", "drive_c/windows/syswow64",
|
try_copy(g_proton.lib_dir + "wine/dxvk/openvr_api_dxvk.dll", "drive_c/windows/syswow64",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.lib64_dir + "wine/dxvk/openvr_api_dxvk.dll", "drive_c/windows/system32",
|
try_copy(g_proton.lib64_dir + "wine/dxvk/openvr_api_dxvk.dll", "drive_c/windows/system32",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
makedirs(self.prefix_dir + "/drive_c/openxr")
|
makedirs(self.prefix_dir + "/drive_c/openxr")
|
||||||
try_copy(g_proton.default_pfx_dir + "drive_c/openxr/wineopenxr64.json", "drive_c/openxr",
|
try_copy(g_proton.default_pfx_dir + "drive_c/openxr/wineopenxr64.json", "drive_c/openxr",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
#copy vkd3d files into place
|
#copy vkd3d files into place
|
||||||
try_copy(g_proton.lib64_dir + "vkd3d/libvkd3d-shader-1.dll", "drive_c/windows/system32",
|
try_copy(g_proton.lib64_dir + "vkd3d/libvkd3d-shader-1.dll", "drive_c/windows/system32",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.lib_dir + "vkd3d/libvkd3d-shader-1.dll", "drive_c/windows/syswow64",
|
try_copy(g_proton.lib_dir + "vkd3d/libvkd3d-shader-1.dll", "drive_c/windows/syswow64",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
if use_wined3d:
|
if use_wined3d:
|
||||||
dxvkfiles = ["dxvk_config"]
|
dxvkfiles = ["dxvk_config"]
|
||||||
@ -795,24 +786,24 @@ class CompatData:
|
|||||||
|
|
||||||
for f in wined3dfiles:
|
for f in wined3dfiles:
|
||||||
try_copy(g_proton.default_pfx_dir + "drive_c/windows/system32/" + f + ".dll", "drive_c/windows/system32",
|
try_copy(g_proton.default_pfx_dir + "drive_c/windows/system32/" + f + ".dll", "drive_c/windows/system32",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.default_pfx_dir + "drive_c/windows/syswow64/" + f + ".dll", "drive_c/windows/syswow64",
|
try_copy(g_proton.default_pfx_dir + "drive_c/windows/syswow64/" + f + ".dll", "drive_c/windows/syswow64",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
for f in dxvkfiles:
|
for f in dxvkfiles:
|
||||||
try_copy(g_proton.lib64_dir + "wine/dxvk/" + f + ".dll", "drive_c/windows/system32",
|
try_copy(g_proton.lib64_dir + "wine/dxvk/" + f + ".dll", "drive_c/windows/system32",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.lib_dir + "wine/dxvk/" + f + ".dll", "drive_c/windows/syswow64",
|
try_copy(g_proton.lib_dir + "wine/dxvk/" + f + ".dll", "drive_c/windows/syswow64",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
g_session.dlloverrides[f] = "n"
|
g_session.dlloverrides[f] = "n"
|
||||||
|
|
||||||
# If the user requested the NVAPI be available, copy it into place.
|
# If the user requested the NVAPI be available, copy it into place.
|
||||||
# If they didn't, clean up any stray nvapi DLLs.
|
# If they didn't, clean up any stray nvapi DLLs.
|
||||||
if use_nvapi:
|
if use_nvapi:
|
||||||
try_copy(g_proton.lib64_dir + "wine/nvapi/nvapi64.dll", "drive_c/windows/system32",
|
try_copy(g_proton.lib64_dir + "wine/nvapi/nvapi64.dll", "drive_c/windows/system32",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.lib_dir + "wine/nvapi/nvapi.dll", "drive_c/windows/syswow64",
|
try_copy(g_proton.lib_dir + "wine/nvapi/nvapi.dll", "drive_c/windows/syswow64",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
g_session.dlloverrides["nvapi64"] = "n"
|
g_session.dlloverrides["nvapi64"] = "n"
|
||||||
g_session.dlloverrides["nvapi"] = "n"
|
g_session.dlloverrides["nvapi"] = "n"
|
||||||
g_session.dlloverrides["nvcuda"] = "b"
|
g_session.dlloverrides["nvcuda"] = "b"
|
||||||
@ -830,12 +821,12 @@ class CompatData:
|
|||||||
if nvidia_wine_dll_dir:
|
if nvidia_wine_dll_dir:
|
||||||
for dll in ["_nvngx.dll", "nvngx.dll"]:
|
for dll in ["_nvngx.dll", "nvngx.dll"]:
|
||||||
try_copy(nvidia_wine_dll_dir + "/" + dll, "drive_c/windows/system32", optional=True,
|
try_copy(nvidia_wine_dll_dir + "/" + dll, "drive_c/windows/system32", optional=True,
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
try_copy(g_proton.lib64_dir + "wine/vkd3d-proton/d3d12.dll", "drive_c/windows/system32",
|
try_copy(g_proton.lib64_dir + "wine/vkd3d-proton/d3d12.dll", "drive_c/windows/system32",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
try_copy(g_proton.lib_dir + "wine/vkd3d-proton/d3d12.dll", "drive_c/windows/syswow64",
|
try_copy(g_proton.lib_dir + "wine/vkd3d-proton/d3d12.dll", "drive_c/windows/syswow64",
|
||||||
prefix=self.prefix_dir)
|
prefix=self.prefix_dir, track_file=tracked_files)
|
||||||
|
|
||||||
gamedrive_path = self.prefix_dir + "dosdevices/s:"
|
gamedrive_path = self.prefix_dir + "dosdevices/s:"
|
||||||
if "gamedrive" in g_session.compat_config:
|
if "gamedrive" in g_session.compat_config:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user