fix(deck): the launcher never counts its own AppImage runtime as the game, and Gear Lever never names it after the game (#118) #169
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!169
Loading…
Reference in a new issue
No description provided.
Delete branch "omgitsgela/LongshotLauncher:fix/gear-lever-self-launcher"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status: fix/bug · Risk: low · Needs: a Deck tester to confirm Gear Lever's rename no longer wedges the launcher's own update
What and why
Closes #118.
Gear Lever renames a shortcut's file after the app's
.desktopName(and dedupes name clashes by adding a suffix: upstream Gear Lever #428). The launcher's AppImage carriedName=Longshotin its desktop entry, so Gear Lever renamed it tolongshot.appimage— and a deduped form (longshot-2.appimage) walks straight into the launcher's game-AppImage detection regex (longshot<separator>*.appimage) inSaves.RunningFrom. The launcher then saw a "running game" that was its own AppImage runtime — a different process from the launcher itself (comm like the file's name, argv[0] the file) — and refused its own update forever.Reproduced on this machine with a built launcher AppImage copied to
/tmp/glv/longshot.appimage: the AppImage runtime stays alive beside the unpacked launcher (comm=longshot.appima,argv0=/tmp/glv/longshot.appimage), while the launcher binary runs separately. The regex probe against the currentCoreshowslongshotmatching as the game's display name and separated/suffixed AppImage names reaching the AppImage arm;Running()excluded only the launcher's own pid, never its runtime process.Measurements
No fps: a launcher self-detection fix. The checks are named under Testing.
How
scripts/package.sh: the AppImage's desktop entry now bakesName=Longshot Launcher(the launcher's own Settings-menu entry,Core/Shortcuts.cs, already says that — Gear Lever now names the launcher's file after the launcher, never after the game it builds).Core/Saves.cs:Running()skips the process whose argv[0] is the launcher's own AppImage —$APPIMAGE, which the AppImage runtime exports to the launcher process it started. A file name can never settle this (the launcher'slongshot-2.appimageand a game'slongshot-2.appimageshare names); the full paths never collide. New helpersIsOwnRuntime(argv0Path, ownAppImage)andOwnAppImage(getenv); unchanged when the launcher runs unpacked (no$APPIMAGE, no runtime process).Name=in the packaged desktop entry)Name=LongshotName=Longshot LauncherTesting
python -I tests/test_launcher_core.py --dotnet <dotnet>on this branch:launcher core: 1465 checks passed, including new pins:IsOwnRuntimeexact-path identity; the near-miss (same file name, different folder) is NOT the launcher's own; empty/missing envs; the normal never-renamed launcher AppImage is its own runtime too; two source pins —package.sh's desktop entry must sayName=Longshot Launcher, andRunning()must consultIsOwnRuntime(argv0, ownImage)(pid-only self-exclusion is what missed the runtime).Running()exclusion line fails its source pin and re-greens on restore.longshot.appimageshows the runtime process (comm=longshot.appima, argv0 the file) beside the launcher binary; theRunningFromprobe names what matches and what doesn't on current main.Not tested: Gear Lever itself renaming a packaged AppImage on a Deck (the rename is Gear Lever's behavior, reported in #118 with the screenshot; our fix removes both halves of what made that rename harmful). A Deck tester should update through Gear Lever once and confirm the launcher updates normally. Windows unaffected (the AppImage arm is Linux-only).
When it applies
Rollback
Reverting this commit restores
Name=Longshotand pid-only exclusion; users whose files Gear Lever already renamed keep those file names and go back to refusing their own update while the runtime runs.Privacy
Nothing user-supplied is added to logs, telemetry, or reports; the only new read is the launcher's own
$APPIMAGEenv and/proc/<pid>/cmdlineit already read.Tested in game: no
Nice fix, one catch with the path match: the AppImage runtime sets
APPIMAGEfromreadlink("/proc/self/exe")(type2-runtime'sruntime.c), so it's the resolved real path, whileargv[0]is whatever path was typed.Path.GetFullPathdoesn't resolve symlinks, so they won't match when the launcher is started through one. On Bazzite/Silverblue/homeis a symlink to/var/home, so/home/user/AppImages/longshot.appimage_0.appimagevsAPPIMAGE=/var/home/user/...keeps the bug. A relative./x.appimagecan miss too if the cwd differs.Comparing
/proc/<pid>/exewithAPPIMAGEinstead should always match: the runtime process's exe is the AppImage file itself, resolved by the kernel the same wayAPPIMAGEwas. Maybe keep the argv[0] check as a fallback forTARGET_APPIMAGE(AppImageLauncher's bypass). A test with a symlinked path would cover it.For context, a Bazzite user on Discord hit #118 today: Gear Lever renamed the launcher to
longshot.appimage_0.appimage, which matches the running-game regex.