Add the ability to copy builtin dll's instead of making symlinks.
This commit is contained in:
parent
debb619d17
commit
911a468618
1 changed files with 14 additions and 5 deletions
19
proton
19
proton
|
@ -5,6 +5,7 @@
|
||||||
import fcntl
|
import fcntl
|
||||||
import array
|
import array
|
||||||
import filecmp
|
import filecmp
|
||||||
|
import fnmatch
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -262,14 +263,17 @@ class CompatData:
|
||||||
#Just let the Wine upgrade happen and hope it works...
|
#Just let the Wine upgrade happen and hope it works...
|
||||||
return
|
return
|
||||||
|
|
||||||
def real_copy(self, src, dst):
|
def real_copy(self, src, dst, dll_copy=False):
|
||||||
if os.path.islink(src):
|
if os.path.islink(src):
|
||||||
contents = os.readlink(src)
|
contents = os.readlink(src)
|
||||||
if os.path.dirname(contents).endswith(('/lib/wine', '/lib/wine/fakedlls', '/lib64/wine', '/lib64/wine/fakedlls')):
|
if os.path.dirname(contents).endswith(('/lib/wine', '/lib/wine/fakedlls', '/lib64/wine', '/lib64/wine/fakedlls')):
|
||||||
# wine builtin dll
|
# wine builtin dll
|
||||||
# make the destination an absolute symlink
|
# make the destination an absolute symlink
|
||||||
contents = os.path.normpath(os.path.join(os.path.dirname(src), contents))
|
contents = os.path.normpath(os.path.join(os.path.dirname(src), contents))
|
||||||
os.symlink(contents, dst)
|
if dll_copy:
|
||||||
|
try_copy(src, dst)
|
||||||
|
else:
|
||||||
|
os.symlink(contents, dst)
|
||||||
else:
|
else:
|
||||||
try_copy(src, dst)
|
try_copy(src, dst)
|
||||||
|
|
||||||
|
@ -295,7 +299,8 @@ class CompatData:
|
||||||
self.real_copy(src_file, dst_file)
|
self.real_copy(src_file, dst_file)
|
||||||
tracked_files.write(rel_dir + file_ + "\n")
|
tracked_files.write(rel_dir + file_ + "\n")
|
||||||
|
|
||||||
def update_builtin_libs(self):
|
def update_builtin_libs(self, dll_copy_patterns):
|
||||||
|
dll_copy_patterns = dll_copy_patterns.split(',')
|
||||||
prev_tracked_files = set()
|
prev_tracked_files = set()
|
||||||
with open(self.tracked_files_file, "r") as tracked_files:
|
with open(self.tracked_files_file, "r") as tracked_files:
|
||||||
for line in tracked_files:
|
for line in tracked_files:
|
||||||
|
@ -322,7 +327,8 @@ class CompatData:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
os.makedirs(dst_dir, exist_ok=True)
|
os.makedirs(dst_dir, exist_ok=True)
|
||||||
self.real_copy(src_file, dst_file)
|
dll_copy = any(fnmatch.fnmatch(file_, pattern) for pattern in dll_copy_patterns)
|
||||||
|
self.real_copy(src_file, dst_file, dll_copy)
|
||||||
tracked_name = rel_dir + file_
|
tracked_name = rel_dir + file_
|
||||||
if tracked_name not in prev_tracked_files:
|
if tracked_name not in prev_tracked_files:
|
||||||
tracked_files.write(tracked_name + "\n")
|
tracked_files.write(tracked_name + "\n")
|
||||||
|
@ -376,6 +382,8 @@ class CompatData:
|
||||||
use_wined3d = "wined3d" in g_session.compat_config
|
use_wined3d = "wined3d" in g_session.compat_config
|
||||||
use_dxvk_dxgi = "WINEDLLOVERRIDES" in os.environ and "dxgi=n" in os.environ["WINEDLLOVERRIDES"]
|
use_dxvk_dxgi = "WINEDLLOVERRIDES" in os.environ and "dxgi=n" in os.environ["WINEDLLOVERRIDES"]
|
||||||
|
|
||||||
|
builtin_dll_copy = os.environ.get("PROTON_DLL_COPY", "d3dcompiler_*.dll,d3dx*.dll")
|
||||||
|
|
||||||
# If any of this info changes, we must rerun the tasks below
|
# If any of this info changes, we must rerun the tasks below
|
||||||
prefix_info = '\n'.join((
|
prefix_info = '\n'.join((
|
||||||
CURRENT_PREFIX_VERSION,
|
CURRENT_PREFIX_VERSION,
|
||||||
|
@ -390,6 +398,7 @@ class CompatData:
|
||||||
getmtimestr(g_proton.default_pfx_dir, 'system.reg'),
|
getmtimestr(g_proton.default_pfx_dir, 'system.reg'),
|
||||||
str(use_wined3d),
|
str(use_wined3d),
|
||||||
str(use_dxvk_dxgi),
|
str(use_dxvk_dxgi),
|
||||||
|
builtin_dll_copy,
|
||||||
))
|
))
|
||||||
|
|
||||||
if old_ver == CURRENT_PREFIX_VERSION:
|
if old_ver == CURRENT_PREFIX_VERSION:
|
||||||
|
@ -413,7 +422,7 @@ class CompatData:
|
||||||
self.create_fonts_symlinks()
|
self.create_fonts_symlinks()
|
||||||
|
|
||||||
# update builtin dll symlinks or copies
|
# update builtin dll symlinks or copies
|
||||||
self.update_builtin_libs()
|
self.update_builtin_libs(builtin_dll_copy)
|
||||||
|
|
||||||
#copy steam files into place
|
#copy steam files into place
|
||||||
dst = self.prefix_dir + "/drive_c/Program Files (x86)/"
|
dst = self.prefix_dir + "/drive_c/Program Files (x86)/"
|
||||||
|
|
Loading…
Reference in a new issue