diff --git a/installer/Install/Install.py b/installer/Install/Install.py index b350bed21..89de3d5d0 100644 --- a/installer/Install/Install.py +++ b/installer/Install/Install.py @@ -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 @@ -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) diff --git a/installer/Install/__init__.py b/installer/Install/__init__.py index 57b03c35b..4369eaa6b 100644 --- a/installer/Install/__init__.py +++ b/installer/Install/__init__.py @@ -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)