mirror of
https://github.com/ddeverill/SteamlessController.git
synced 2026-10-22 22:52:16 -05:00
A profile whose game is no longer installed could not be seen, edited or deleted. SendInitState walks the installed list and looks profiles up against it, so an entry with no installed game was never sent to the page — while staying live in m_gameProfiles, still matched by MatchProfile, and under the new mode still turning the controller on. Invisible and working at once, and the case where deleting a profile is most likely to be what someone wants. What kept it unreachable is that the page names games by index into the installed list, and an orphan has no index. Raw ids cannot cross that channel: they hold non-ASCII and backslashes the parser does not unescape. So the indices are extended instead — one appended entry per orphaned profile, past the real games, with m_installedCount marking where they start. Apply and delete then work through the paths that already existed, unchanged, and SendInitState's profile loop picks the orphans up on its own because it iterates the same list. Their names come from displayName, which was stored for exactly this: naming a profile when the installed list cannot. Profiles older than that field fall back to the raw id. Nothing is pruned automatically. Not being in the installed list is not the same as being uninstalled — a deleted Start Menu shortcut, a Steam library on a drive that is currently disconnected, or a game whose shortcut was never created all look identical from here, and quietly deleting a profile in any of those cases would destroy real work to tidy a cosmetic problem. They are labelled and left, and if the game returns they simply stop being orphans. An enumeration that finds nothing at all is treated as knowing nothing rather than as everything being uninstalled. A COM failure reading shell:AppsFolder is far likelier than an empty PC, and flagging every profile as missing on that evidence would invite someone to delete all of them. Deleting an orphan drops its picker entry along with the profile. The entry only existed because the profile referred to it, and left behind it stops being pinned — after which the only section it could appear in is the one labelled INSTALLED GAMES, which it never was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>