fix issue where defined but non-existent WINEPREFIX was ignored and therefore not created

This commit is contained in:
GloriousEggroll 2024-02-20 15:24:36 -07:00
parent 429de35ee3
commit a610be41d8

View File

@ -128,15 +128,17 @@ def check_env(
"WINEPREFIX" not in os.environ
or not Path(os.environ["WINEPREFIX"]).expanduser().is_dir()
):
# Automatically create a prefix for the user if WINEPREFIX is not set
# The GAMEID will be the name of the dir
pfx: Path = Path.home().joinpath("Games/ULWGL/" + env["GAMEID"])
if "WINEPREFIX" not in os.environ:
# Automatically create a prefix for the user if WINEPREFIX is not set
# The GAMEID will be the name of the dir
pfx: Path = Path.home().joinpath("Games/ULWGL/" + env["GAMEID"])
else:
pfx: Path = Path(os.environ["WINEPREFIX"])
pfx.mkdir(parents=True, exist_ok=True)
os.environ["WINEPREFIX"] = pfx.as_posix()
env["WINEPREFIX"] = os.environ["WINEPREFIX"]
else:
env["WINEPREFIX"] = os.environ["WINEPREFIX"]
env["WINEPREFIX"] = os.environ["WINEPREFIX"]
if "PROTONPATH" not in os.environ:
os.environ["PROTONPATH"] = ""