From a610be41d8868e5b82cb2244c78ffae1d83cc2cf Mon Sep 17 00:00:00 2001 From: GloriousEggroll Date: Tue, 20 Feb 2024 15:24:36 -0700 Subject: [PATCH] fix issue where defined but non-existent WINEPREFIX was ignored and therefore not created --- ulwgl_run.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ulwgl_run.py b/ulwgl_run.py index 28d98b9..d97dd69 100755 --- a/ulwgl_run.py +++ b/ulwgl_run.py @@ -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"] = ""