Skip to content

Commit

Permalink
installer maybe fix Linux Proton Documents path
Browse files Browse the repository at this point in the history
  • Loading branch information
Die4Ever committed Sep 9, 2023
1 parent e4c268b commit cf55661
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions installer/Install/Install.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def InstallVanilla(system:Path, settings:dict, speedupfix:bool):
CopyTo(ini, defini_dest)

if kentie:
configs_dest = GetDocumentsDir() / 'Deus Ex' / 'System'
configs_dest = GetDocumentsDir(system) / 'Deus Ex' / 'System'
Mkdir(configs_dest.parent /'SaveDXRando', exist_ok=True, parents=True)
else:
configs_dest = system
Expand Down Expand Up @@ -227,7 +227,7 @@ def InstallGMDX(system:Path, settings:dict, exename:str):
Mkdir(game/'SaveGMDXRando', exist_ok=True)
# GMDX uses absolute path shortcuts with ini files in their arguments, so it's not as simple to copy their exe

confpath = GetDocumentsDir() / 'Deus Ex' / exename / 'System' / 'gmdx.ini'
confpath = GetDocumentsDir(system) / 'Deus Ex' / exename / 'System' / 'gmdx.ini'
if confpath.exists():
b = confpath.read_bytes()
b = Config.ModifyConfig(b, changes, additions)
Expand Down
9 changes: 5 additions & 4 deletions installer/Install/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ def GetSourcePath() -> Path:
raise RuntimeError('failed to GetSourcePath()', p)


def GetDocumentsDir() -> Path:
def GetDocumentsDir(system:Path) -> Path:
if not IsWindows():
p = Path.home() /'snap'/'steam'/'common'/'.local'/'share'/'Steam'
info('GetDocumentsDir() == ', p)
if p.exists():
if 'Steam' in system.parts:
idx = system.parts.index('Steam')
p = system.parents[idx]
info('GetDocumentsDir() == ', p)
p = p /'steamapps'/'compatdata'/'6910'/'pfx'/'drive_c'/'users'/'steamuser'/'Documents'
info('GetDocumentsDir() == ', p)
Mkdir(p, True, True)
Expand Down

0 comments on commit cf55661

Please sign in to comment.