[Feat] Allow uninstalling/cleaning up partially installed games #5655#5656
Conversation
Legendary games
|
If anyone can help me test this feature, I'd appreciate it. It works for me, but I have all my files in the usual Heroic path. If it works for someone using different drives, etc., then great. Even so, if it works for me, it should work for everyone; I'm not creating anything new. |
the library
being installed or updated
|
I love this feature; it adds so much convenience. |
|
Post-added changes: Added an icon on the game card to indicate that local game files are present on disk Uninstalling is now allowed while a game is queued, downloading or updating (The download is cancelled and then uninstalled, thus bypassing the restriction that prevents this.) Download cache is now reset on uninstall, matching Legendary's behavior Removed install status icon when a game is queued or actively downloading |
related to #5655
When a Legendary game download is interrupted , the partially downloaded files are left on disk but the game is not marked as installed. There was no way to clean them up from the UI since the uninstall option was only shown for fully installed games.
This fix handles partial install cleanup entirely within Heroic, using existing infrastructure, without requiring any changes to Legendary itself.
What changes:
library.ts: stores the install folder path in localStorage when a download starts, so it can be recovered even if Legendary crashes before writing its own state
hasPartialInstall.ts: new hook that reads that stored path and exposes hasPartialInstall / partialInstallFolder to components
GameCard and GameSubMenu: show the uninstall option when a partial install is detected, not only when isInstalled is true
UninstallModal: accepts and forwards partialInstallFolder down the call chain
uninstaller.ts and ipc.ts: pass partialInstallFolder through to the game manager
games.ts (LegendaryGameManager.uninstall): if the game is not installed but a partialInstallFolder is provided, calls removeFolder directly and triggers a library refresh, skipping the normal Legendary CLI uninstall flow
library.ts (backend): guards against empty stdout from legendary info before attempting JSON parse, preventing a crash when legendary returns nothing for a partially downloaded game
Use the following Checklist if you have changed something on the Backend or Frontend: