[GH-ISSUE #121] Dynamically find umu executable #63

Closed
opened 2026-02-17 17:11:59 -05:00 by yindo · 2 comments
Owner

Originally created by @quexeky on GitHub (Aug 18, 2025).
Original GitHub issue: https://github.com/Drop-OSS/drop-app/issues/121

Due to flatpak support we need to filter through a list of possible executable locations rather than just defaulting to using "umu-run" as an executable

Originally created by @quexeky on GitHub (Aug 18, 2025). Original GitHub issue: https://github.com/Drop-OSS/drop-app/issues/121 Due to flatpak support we need to filter through a list of possible executable locations rather than just defaulting to using "umu-run" as an executable
yindo closed this issue 2026-02-17 17:11:59 -05:00
Author
Owner

@DecDuck commented on GitHub (Aug 18, 2025):

That's what the system is supposed to do with the $PATH variable.

@DecDuck commented on GitHub (Aug 18, 2025): That's what the system is supposed to do with the $PATH variable.
Author
Owner

@quexeky commented on GitHub (Aug 18, 2025):

Except for something like flatpak, it doesn't actually exist in the PATH I believe.

This is the function that Lutris uses:

def get_umu_path() -> str:
    """Returns the path to the Umu launch script, which can be run to execute
    a Proton version. It can supply a default Proton, but if the env-var PROTONPATH
    is set this will direct it to a specific Proton installation.

    The path that this returns will be considered an Umu path by is_umu_path().

    If this script can't be found this will raise MissingExecutableError."""

    # 'umu-run' is normally the entry point, and is a zipapp full of Python code. But
    # We used to ship a directory of loose files, and the entry point then is 'umu_run.py'
    entry_points = ["umu-run", "umu_run.py"]

    custom_path = settings.read_setting("umu_path")
    if custom_path:
        for entry_point in entry_points:
            entry_path = os.path.join(custom_path, entry_point)
            if system.path_exists(entry_path):
                return entry_path

    # We only use 'umu-run' when searching the path since that's the command
    # line entry point.
    if system.can_find_executable("umu-run"):
        return system.find_required_executable("umu-run")
    path_candidates = (
        "/app/share",  # prioritize flatpak due to non-rolling release distros
        "/usr/local/share",
        "/usr/share",
        "/opt",
        settings.RUNTIME_DIR,
    )
    for path_candidate in path_candidates:
        for entry_point in entry_points:
            entry_path = os.path.join(path_candidate, "umu", entry_point)
            if system.path_exists(entry_path):
                return entry_path
    raise MissingExecutableError("Install umu to use Proton")
@quexeky commented on GitHub (Aug 18, 2025): Except for something like flatpak, it doesn't actually exist in the PATH I believe. This is the function that Lutris uses: ```python def get_umu_path() -> str: """Returns the path to the Umu launch script, which can be run to execute a Proton version. It can supply a default Proton, but if the env-var PROTONPATH is set this will direct it to a specific Proton installation. The path that this returns will be considered an Umu path by is_umu_path(). If this script can't be found this will raise MissingExecutableError.""" # 'umu-run' is normally the entry point, and is a zipapp full of Python code. But # We used to ship a directory of loose files, and the entry point then is 'umu_run.py' entry_points = ["umu-run", "umu_run.py"] custom_path = settings.read_setting("umu_path") if custom_path: for entry_point in entry_points: entry_path = os.path.join(custom_path, entry_point) if system.path_exists(entry_path): return entry_path # We only use 'umu-run' when searching the path since that's the command # line entry point. if system.can_find_executable("umu-run"): return system.find_required_executable("umu-run") path_candidates = ( "/app/share", # prioritize flatpak due to non-rolling release distros "/usr/local/share", "/usr/share", "/opt", settings.RUNTIME_DIR, ) for path_candidate in path_candidates: for entry_point in entry_points: entry_path = os.path.join(path_candidate, "umu", entry_point) if system.path_exists(entry_path): return entry_path raise MissingExecutableError("Install umu to use Proton") ```
yindo changed title from Dynamically find umu executable to [GH-ISSUE #121] Dynamically find umu executable 2026-06-05 14:24:35 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Drop-OSS/drop-app#63