Skip to content

Commit

Permalink
fix issue where defined but non-existent WINEPREFIX was ignored and t…
Browse files Browse the repository at this point in the history
…herefore not created
  • Loading branch information
GloriousEggroll committed Feb 20, 2024
1 parent 429de35 commit a610be4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ulwgl_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = ""
Expand Down

0 comments on commit a610be4

Please sign in to comment.