feat(storage): remove everything Longshot put on the PC in one go, the saves kept unless ticked #236

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:feat/remove-everything into main 2026-11-21 19:17:25 +00:00
Owner

Players who are done with Longshot, or need the space back, have to hunt down game folders, build files, tools, caches and logs by hand, and the Windows uninstaller leaves the versions and the build files behind (#147). This adds one action that removes all of it, keeping the saves unless the player ticks a separate box.

Fixes #200

Summary

Where it lives. It's a Remove Longshot from this PC card on the Storage page, under Where it goes, with a Remove everything… button. The dialog lists what goes and what stays, with the sizes from the page's last measure:

  • installed versions with their game files and mods
  • shader caches
  • build files
  • build tools and graphics libraries
  • logs
  • saves, save backups and game settings (kept unless ticked)
  • old version folders that hold the player's mods (always kept)

The dialog also has a total and a separate tick: Also delete my saves, their backups, the game's settings and NFC tags. When the work is done, it lists what was kept and why. Close the launcher then shuts it down. Linux has no uninstaller, so this is its full uninstall, and it is on Windows too.

On Windows, the uninstaller's data tick (Apps & features > Uninstall) now runs the same removal, with the saves always kept. Before, it kept the build folders and the build files.

What goes (Core/RemoveEverything.cs, Run):

  • Versions: each listed version's folder, through Home's delete (BuildRegistry.DeleteGame). A save in the folder is gathered or backed up first. Unlisted game folders in the builds folder go through Leftovers.Delete, the same way. Empty track folders (nightly/, stable/) go too.
  • Build files: only make_game's parts (Disk.FreeWork).
  • Tools and caches:
    • the DLSS, FSR and XeSS SDK folders
    • the shader store, its own files only (ShaderCaches.ClearStore)
    • the game's cache/ and temp/ in its user folder
  • Launcher data: the launcher's home and cache folders (its list, settings, builders, logs and logos), then the Longshot parent folders once they are empty.
  • Shortcuts:
    • the Linux desktop and menu longshot.desktop files, only those Shortcuts.MayTouch allows
    • the launcher's own menu entry and icon, when they start this launcher
    • Steam's tile, only the launcher's own (SteamShortcuts.Remove)
    • Windows' Longshot.lnk files, via WindowsShortcuts.Write(false, false)
  • The installed Windows launcher uninstalls itself (Installer.Uninstall: program, Start menu entry, Apps & features). Elsewhere the dialog asks the player to delete the AppImage or the portable folder.

Safety:

  • Refusals: it won't start while Longshot, a build or a download runs, or when the list of versions can't be read. If Longshot runs, Run itself refuses before touching anything.
  • Saves are kept unless ticked. This covers the saves, save-backups, the game's settings and the NFC tags (when LONGSHOT_NFC_DIR isn't set). The shared oot-save-backups is never deleted: Longshot's scripts and Hookshot use it.
  • What I chose for the tick: it deletes the saves with no copy made first. A copy would defeat "delete my saves". Instead, the dialog warns in a box that they can't be brought back and points to Saves > Export. A save still inside a version's folder is backed up first in either case, as Home's delete does.
  • Folders the player chose (the builds folder or the build files folder) are never deleted themselves, only what Longshot made in them. Their other contents stay, and the dialog lists them as "Kept, it holds other things".
  • Unlisted version folders with mods in them stay (HoldsYours).
  • No links are followed. A link is removed, never its target. The code never deletes a drive's root or a folder that holds the user's home.
  • Hookshot's folders are never touched (clean break).
  • Failures: a file that can't be deleted is listed with the reason, and the rest carries on.

Other changes: the README describes it, --uninstall's row is updated, and the uninstaller's three old texts are dropped from the catalogs (scripts/translations.py flags them as left over).

Other PRs: this doesn't touch the lines #231 changes. Its dialog after the last version's delete is a separate, smaller offer and can land in either order.

Testing

  • python -I tests/test_launcher_core.py: 2618 checks passed. The new RemoveEverythingChecks runs on made-up Linux homes in the scratch folder, never this PC's data. It checks:
    • With the saves not ticked: the saves, backups, settings and NFC tags stay byte for byte, along with the shared oot-save-backups, a chosen builds folder's other game, a chosen build files folder's notes, a folder holding the player's mods, and a file behind a link in the home. The versions, unlisted folders, track folders, make_game's parts, home, cache, SDK, shader store and game cache are gone.
    • With the saves ticked: the saves, backups, settings and NFC tags go. The shared backups and the player's other files stay.
    • The launcher's own builds and build files folders go once they're empty.
    • It refuses while Longshot runs, with nothing touched.
    • The dialog's lines and sizes, and what goes with and without the tick.
    • The Linux shortcuts that start this launcher go. Another AppImage's menu entry stays.
  • LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py: 3 failures: test_the_bump, test_the_next_stable and test_check_tag_against_the_published_releases. They fail the same way on unchanged main.
  • dotnet build LongshotLauncher.slnx in Debug and Release (locked restore): 0 warnings.
  • Screenshots (tools/screenshots): new scenes storage-remove-everything, storage-remove-everything-saves and storage-remove-everything-done, plus storage with the new card. They're in the first comment.

Not tested:

  • Windows. It can't run here, so Installer.Uninstall from the Storage dialog, the uninstaller's new data tick, the .lnk removal and Windows paths (junctions, a file in use) are untested.
  • The real launcher, clicked through on Linux. Only the core and the headless screens ran.
  • Steam's tile removal. It uses the existing SteamShortcuts.Remove, untested here.

🤖 Generated with Claude Code

Players who are done with Longshot, or need the space back, have to hunt down game folders, build files, tools, caches and logs by hand, and the Windows uninstaller leaves the versions and the build files behind (#147). This adds one action that removes all of it, keeping the saves unless the player ticks a separate box. Fixes #200 ## Summary **Where it lives.** It's a *Remove Longshot from this PC* card on the Storage page, under *Where it goes*, with a **Remove everything…** button. The dialog lists what goes and what stays, with the sizes from the page's last measure: - installed versions with their game files and mods - shader caches - build files - build tools and graphics libraries - logs - saves, save backups and game settings (kept unless ticked) - old version folders that hold the player's mods (always kept) The dialog also has a total and a separate tick: *Also delete my saves, their backups, the game's settings and NFC tags*. When the work is done, it lists what was kept and why. *Close the launcher* then shuts it down. Linux has no uninstaller, so this is its full uninstall, and it is on Windows too. On Windows, the uninstaller's data tick (*Apps & features > Uninstall*) now runs the same removal, with the saves always kept. Before, it kept the build folders and the build files. **What goes** (`Core/RemoveEverything.cs`, `Run`): - **Versions:** each listed version's folder, through Home's delete (`BuildRegistry.DeleteGame`). A save in the folder is gathered or backed up first. Unlisted game folders in the builds folder go through `Leftovers.Delete`, the same way. Empty track folders (`nightly/`, `stable/`) go too. - **Build files:** only make_game's parts (`Disk.FreeWork`). - **Tools and caches:** - the DLSS, FSR and XeSS SDK folders - the shader store, its own files only (`ShaderCaches.ClearStore`) - the game's `cache/` and `temp/` in its user folder - **Launcher data:** the launcher's home and cache folders (its list, settings, builders, logs and logos), then the `Longshot` parent folders once they are empty. - **Shortcuts:** - the Linux desktop and menu `longshot.desktop` files, only those `Shortcuts.MayTouch` allows - the launcher's own menu entry and icon, when they start this launcher - Steam's tile, only the launcher's own (`SteamShortcuts.Remove`) - Windows' `Longshot.lnk` files, via `WindowsShortcuts.Write(false, false)` - **The installed Windows launcher** uninstalls itself (`Installer.Uninstall`: program, Start menu entry, Apps & features). Elsewhere the dialog asks the player to delete the AppImage or the portable folder. **Safety:** - **Refusals:** it won't start while Longshot, a build or a download runs, or when the list of versions can't be read. If Longshot runs, `Run` itself refuses before touching anything. - **Saves are kept unless ticked.** This covers the saves, `save-backups`, the game's settings and the NFC tags (when `LONGSHOT_NFC_DIR` isn't set). The shared `oot-save-backups` is never deleted: Longshot's scripts and Hookshot use it. - **What I chose for the tick:** it deletes the saves with no copy made first. A copy would defeat "delete my saves". Instead, the dialog warns in a box that they can't be brought back and points to *Saves > Export*. A save still inside a version's folder is backed up first in either case, as Home's delete does. - **Folders the player chose** (the builds folder or the build files folder) are never deleted themselves, only what Longshot made in them. Their other contents stay, and the dialog lists them as "Kept, it holds other things". - **Unlisted version folders with mods in them stay** (`HoldsYours`). - **No links are followed.** A link is removed, never its target. The code never deletes a drive's root or a folder that holds the user's home. - **Hookshot's folders are never touched** (clean break). - **Failures:** a file that can't be deleted is listed with the reason, and the rest carries on. Other changes: the README describes it, `--uninstall`'s row is updated, and the uninstaller's three old texts are dropped from the catalogs (`scripts/translations.py` flags them as left over). Other PRs: this doesn't touch the lines #231 changes. Its dialog after the last version's delete is a separate, smaller offer and can land in either order. ## Testing - `python -I tests/test_launcher_core.py`: **2618 checks passed**. The new `RemoveEverythingChecks` runs on made-up Linux homes in the scratch folder, never this PC's data. It checks: - With the saves not ticked: the saves, backups, settings and NFC tags stay byte for byte, along with the shared `oot-save-backups`, a chosen builds folder's other game, a chosen build files folder's notes, a folder holding the player's mods, and a file behind a link in the home. The versions, unlisted folders, track folders, make_game's parts, home, cache, SDK, shader store and game cache are gone. - With the saves ticked: the saves, backups, settings and NFC tags go. The shared backups and the player's other files stay. - The launcher's own builds and build files folders go once they're empty. - It refuses while Longshot runs, with nothing touched. - The dialog's lines and sizes, and what goes with and without the tick. - The Linux shortcuts that start this launcher go. Another AppImage's menu entry stays. - `LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py`: 3 failures: `test_the_bump`, `test_the_next_stable` and `test_check_tag_against_the_published_releases`. They fail the same way on unchanged main. - `dotnet build LongshotLauncher.slnx` in Debug and Release (locked restore): 0 warnings. - Screenshots (`tools/screenshots`): new scenes `storage-remove-everything`, `storage-remove-everything-saves` and `storage-remove-everything-done`, plus `storage` with the new card. They're in the first comment. **Not tested:** - **Windows.** It can't run here, so `Installer.Uninstall` from the Storage dialog, the uninstaller's new data tick, the `.lnk` removal and Windows paths (junctions, a file in use) are untested. - **The real launcher, clicked through on Linux.** Only the core and the headless screens ran. - **Steam's tile removal.** It uses the existing `SteamShortcuts.Remove`, untested here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(storage): remove everything Longshot put on the PC in one go, the saves kept unless ticked (#200)
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 16s
d79e9f9859
Storage gets a "Remove everything…" that lists what goes and what stays, with the
sizes of the page's measure, and a separate tick for the saves. It removes the
versions' folders (a save in one backed up first, as Home's delete does), the folders
no row lists, the build files (only make_game's parts), the builders and graphics
libraries, the shader store (its own files), the game's caches, the logs, the
launcher's home and cache folders, and the shortcuts it made (Linux desktop and menu
entries, Steam's tile, Windows' Longshot.lnk); the installed Windows launcher also
uninstalls itself. Kept: the saves, their backups, the game's settings and NFC tags
unless ticked (then they go with no copy, as asked), a builds or build files folder
the player chose keeps what else it holds, an old version's folder holding mods of
theirs stays, the backups folder Longshot's scripts share stays, and nothing is
deleted through a link. The Windows uninstaller's data tick now does the same, the
saves kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

Screenshots (tools/screenshots, headless):

The Storage page with the new card under Where it goes:
storage

Remove everything…: what goes and what stays, with the measured sizes, the saves kept:
storage-remove-everything

The saves ticked, with the warning:
storage-remove-everything-saves

Done: what was kept and why, then Close the launcher:
storage-remove-everything-done

Screenshots (`tools/screenshots`, headless): The Storage page with the new card under *Where it goes*: ![storage](https://git.magicbean.dev/attachments/138561e6-d14b-488c-9ed3-e24e27dc7f4c) *Remove everything…*: what goes and what stays, with the measured sizes, the saves kept: ![storage-remove-everything](https://git.magicbean.dev/attachments/42104086-4f41-4f5a-b902-40ad6370b18f) The saves ticked, with the warning: ![storage-remove-everything-saves](https://git.magicbean.dev/attachments/3734360e-6ae8-4322-93f9-e3ce99c57984) Done: what was kept and why, then *Close the launcher*: ![storage-remove-everything-done](https://git.magicbean.dev/attachments/72db6fc0-d76a-4773-8e6b-e0e0859f2e7b)
HumanBean deleted branch feat/remove-everything 2026-11-21 19:17:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!236
No description provided.