From 9902135e53be129bd6096d51d5e510ab298c1ae2 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Thu, 10 Sep 2026 12:19:40 -0400 Subject: fix: handle bare Flatpak shortcut targets --- src/utils/steamLaunchOptions.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/utils/steamLaunchOptions.ts') diff --git a/src/utils/steamLaunchOptions.ts b/src/utils/steamLaunchOptions.ts index 959ce9e..82cf116 100644 --- a/src/utils/steamLaunchOptions.ts +++ b/src/utils/steamLaunchOptions.ts @@ -166,8 +166,10 @@ const usesShortcutTarget = (nonSteam: boolean, transport: TargetTransport) => no function selectFlatpakExecutable(transport: TargetTransport, candidate?: string | null): string | undefined { if (transport.kind !== "flatpak") return undefined; - const value = candidate?.trim(); - return value ? (value.startsWith("/") ? value : "/usr/bin/flatpak") : undefined; + const value = candidate?.trim() ? decodeToken(candidate.trim()) : ""; + if (value === "flatpak") return "/usr/bin/flatpak"; + if (value === "/usr/bin/flatpak") return value; + return undefined; } export const normalizeLaunchOptions = (options: string) => serialize(tokenize(options)); @@ -405,6 +407,9 @@ export function installWrapperIntegration( throw new Error("Shortcut Target changed externally; refusing to replace it"); } const currentOriginal = selectFlatpakExecutable(transport, current.target); + if (!currentOriginal || (originalExecutable && !savedOriginal)) { + throw new Error("Flatpak shortcut Target is not a supported executable"); + } const value = await writeVerified( appId, true, current.target, wrapperPath, (target) => writeTarget(appId, target), readTarget, -- cgit v1.2.3