mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[core] Save path resolution: Fallback to reading wine prefix from env vars
This is mainly something for Heroic, since we don't touch config.ini
This commit is contained in:
parent
53e2accbb0
commit
abd3a9d496
|
@ -863,6 +863,18 @@ class LegendaryCore:
|
||||||
wine_pfx = self.lgd.config.get('default.env', 'WINEPREFIX', fallback=None)
|
wine_pfx = self.lgd.config.get('default.env', 'WINEPREFIX', fallback=None)
|
||||||
wine_pfx = self.lgd.config.get('default', 'wine_prefix', fallback=wine_pfx)
|
wine_pfx = self.lgd.config.get('default', 'wine_prefix', fallback=wine_pfx)
|
||||||
|
|
||||||
|
# If we still didn't find anything, try to read the prefix from the environment variables of this process
|
||||||
|
if not wine_pfx and sys_platform == 'darwin':
|
||||||
|
cx_bottle = os.getenv('CX_BOTTLE')
|
||||||
|
if cx_bottle and mac_is_valid_bottle(cx_bottle):
|
||||||
|
wine_pfx = mac_get_bottle_path(cx_bottle)
|
||||||
|
|
||||||
|
if not wine_pfx:
|
||||||
|
proton_pfx = os.getenv('STEAM_COMPAT_DATA_PATH')
|
||||||
|
if proton_pfx:
|
||||||
|
wine_pfx = f'{proton_pfx}/pfx'
|
||||||
|
wine_pfx = os.getenv('WINEPREFIX', wine_pfx)
|
||||||
|
|
||||||
# if all else fails, use the WINE default
|
# if all else fails, use the WINE default
|
||||||
if not wine_pfx:
|
if not wine_pfx:
|
||||||
wine_pfx = os.path.expanduser('~/.wine')
|
wine_pfx = os.path.expanduser('~/.wine')
|
||||||
|
|
Loading…
Reference in a new issue