mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-26 05:28:15 +03:00
proton: Optionally setup T: drive for native Steam directory.
CW-Bug-Id: #20285
This commit is contained in:
parent
b46a3bf712
commit
a4824da779
44
proton
44
proton
@ -211,23 +211,34 @@ def try_get_game_library_dir():
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def setup_game_dir_drive():
|
def try_get_steam_dir():
|
||||||
gamedrive_path = g_compatdata.prefix_dir + "dosdevices/s:"
|
if not "STEAM_COMPAT_CLIENT_INSTALL_PATH" in g_session.env:
|
||||||
if "gamedrive" in g_session.compat_config:
|
return None
|
||||||
library_dir = try_get_game_library_dir()
|
|
||||||
if not library_dir:
|
return g_session.env["STEAM_COMPAT_CLIENT_INSTALL_PATH"]
|
||||||
if file_exists(gamedrive_path, follow_symlinks=False):
|
|
||||||
os.remove(gamedrive_path)
|
def setup_dir_drive(compat_option, drive_name, dest_dir):
|
||||||
|
drive_path = g_compatdata.prefix_dir + "dosdevices/" + drive_name
|
||||||
|
if compat_option in g_session.compat_config:
|
||||||
|
if not dest_dir:
|
||||||
|
if file_exists(drive_path, follow_symlinks=False):
|
||||||
|
os.remove(drive_path)
|
||||||
else:
|
else:
|
||||||
if file_exists(gamedrive_path, follow_symlinks=False):
|
if file_exists(drive_path, follow_symlinks=False):
|
||||||
cur_tgt = os.readlink(gamedrive_path)
|
cur_tgt = os.readlink(drive_path)
|
||||||
if cur_tgt != library_dir:
|
if cur_tgt != dest_dir:
|
||||||
os.remove(gamedrive_path)
|
os.remove(drive_path)
|
||||||
os.symlink(library_dir, gamedrive_path)
|
os.symlink(dest_dir, drive_path)
|
||||||
else:
|
else:
|
||||||
os.symlink(library_dir, gamedrive_path)
|
os.symlink(dest_dir, drive_path)
|
||||||
elif file_exists(gamedrive_path, follow_symlinks=False):
|
elif file_exists(drive_path, follow_symlinks=False):
|
||||||
os.remove(gamedrive_path)
|
os.remove(drive_path)
|
||||||
|
|
||||||
|
def setup_game_dir_drive():
|
||||||
|
setup_dir_drive("gamedrive", "s:", try_get_game_library_dir())
|
||||||
|
|
||||||
|
def setup_steam_dir_drive():
|
||||||
|
setup_dir_drive("steamdrive", "t:", try_get_steam_dir())
|
||||||
|
|
||||||
# Function to find the installed location of DLL files for use by Wine/Proton
|
# Function to find the installed location of DLL files for use by Wine/Proton
|
||||||
# from the NVIDIA Linux driver
|
# from the NVIDIA Linux driver
|
||||||
@ -887,6 +898,7 @@ class CompatData:
|
|||||||
prefix=self.prefix_dir, track_file=tracked_files, link_debug=True)
|
prefix=self.prefix_dir, track_file=tracked_files, link_debug=True)
|
||||||
|
|
||||||
setup_game_dir_drive()
|
setup_game_dir_drive()
|
||||||
|
setup_steam_dir_drive()
|
||||||
|
|
||||||
# add Steam ffmpeg libraries to path
|
# add Steam ffmpeg libraries to path
|
||||||
prepend_to_env_str(g_session.env, ld_path_var, steamdir + "/ubuntu12_64/video/:" + steamdir + "/ubuntu12_32/video/", ":")
|
prepend_to_env_str(g_session.env, ld_path_var, steamdir + "/ubuntu12_64/video/:" + steamdir + "/ubuntu12_32/video/", ":")
|
||||||
@ -1088,6 +1100,7 @@ class Session:
|
|||||||
self.check_environment("PROTON_NO_WRITE_WATCH", "nowritewatch")
|
self.check_environment("PROTON_NO_WRITE_WATCH", "nowritewatch")
|
||||||
self.check_environment("PROTON_HIDE_NVIDIA_GPU", "hidenvgpu")
|
self.check_environment("PROTON_HIDE_NVIDIA_GPU", "hidenvgpu")
|
||||||
self.check_environment("PROTON_SET_GAME_DRIVE", "gamedrive")
|
self.check_environment("PROTON_SET_GAME_DRIVE", "gamedrive")
|
||||||
|
self.check_environment("PROTON_SET_STEAM_DRIVE", "steamdrive")
|
||||||
self.check_environment("PROTON_NO_XIM", "noxim")
|
self.check_environment("PROTON_NO_XIM", "noxim")
|
||||||
self.check_environment("PROTON_HEAP_DELAY_FREE", "heapdelayfree")
|
self.check_environment("PROTON_HEAP_DELAY_FREE", "heapdelayfree")
|
||||||
self.check_environment("PROTON_ENABLE_NVAPI", "enablenvapi")
|
self.check_environment("PROTON_ENABLE_NVAPI", "enablenvapi")
|
||||||
@ -1382,6 +1395,7 @@ if __name__ == "__main__":
|
|||||||
if sys.argv[1] == "run":
|
if sys.argv[1] == "run":
|
||||||
#start target app
|
#start target app
|
||||||
setup_game_dir_drive()
|
setup_game_dir_drive()
|
||||||
|
setup_steam_dir_drive()
|
||||||
rc = g_session.run()
|
rc = g_session.run()
|
||||||
elif sys.argv[1] == "waitforexitandrun":
|
elif sys.argv[1] == "waitforexitandrun":
|
||||||
#wait for wineserver to shut down
|
#wait for wineserver to shut down
|
||||||
|
Loading…
x
Reference in New Issue
Block a user