From f4cfc6f3e6b3b9e8a9540b8723bf9578c1e889c7 Mon Sep 17 00:00:00 2001 From: GloriousEggroll Date: Mon, 26 Feb 2024 18:54:43 -0700 Subject: [PATCH] change ulwgl-run path to auto-find based on 'which ulwgl-run' output fixup --- lutris/runners/commands/wine.py | 9 ++++++--- lutris/runners/wine.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lutris/runners/commands/wine.py b/lutris/runners/commands/wine.py index ddbc37cad..56f2c25c8 100644 --- a/lutris/runners/commands/wine.py +++ b/lutris/runners/commands/wine.py @@ -3,6 +3,7 @@ import os import shlex import time +import subprocess from lutris import runtime, settings from lutris.command import MonitoredCommand @@ -152,8 +153,9 @@ def create_prefix( # noqa: C901 # TODO: Determine and insert GAMEID and STORE wineenv["GAMEID"] = "ulwgl-foo" wineenv["PROTONPATH"] = settings.RUNNER_DIR - ulwgl_path = os.path.join(os.path.join(settings.RUNTIME_DIR, "ulwgl")) - system.execute([os.path.join(ulwgl_path, "ulwgl-run"), "createprefix"], env=wineenv) + result = subprocess.run(['which', 'ulwgl-run'], stdout=subprocess.PIPE, text=True) + ulwgl_path = result.stdout.strip() + system.execute([ulwgl_path, "createprefix"], env=wineenv) logger.info("%s Prefix created in %s", arch, prefix) prefix_manager = WinePrefixManager(prefix) @@ -324,7 +326,8 @@ def wineexec( # noqa: C901 baseenv.update(env) if "Proton" in wine_path: - ulwgl_path = os.path.join(os.path.join(settings.RUNTIME_DIR, "ulwgl"), "ulwgl-run") + result = subprocess.run(['which', 'ulwgl-run'], stdout=subprocess.PIPE, text=True) + ulwgl_path = result.stdout.strip() wine_path = ulwgl_path command_parameters = [wine_path] diff --git a/lutris/runners/wine.py b/lutris/runners/wine.py index 6ac079dee..153231c1e 100644 --- a/lutris/runners/wine.py +++ b/lutris/runners/wine.py @@ -2,6 +2,7 @@ # pylint: disable=too-many-lines import os import shlex +import subprocess from gettext import gettext as _ from typing import Dict, Tuple @@ -1173,9 +1174,10 @@ class wine(Runner): def get_command(self): exe = self.get_executable() - ulwgl_path = os.path.join(os.path.join(settings.RUNTIME_DIR, "ulwgl")) + result = subprocess.run(['which', 'ulwgl-run'], stdout=subprocess.PIPE, text=True) + ulwgl_path = result.stdout.strip() if "Proton" in exe and "lutris" not in exe and system.path_exists(ulwgl_path): - return [os.path.join(ulwgl_path, "ulwgl-run")] + return [ulwgl_path] return super().get_command() def play(self): # pylint: disable=too-many-return-statements # noqa: C901