Launcher: a version stops counting as installed when its removal starts

backend::remove dropped the .installed marker whenever remove_dir_all reached it,
so a second removal finishing first re-read installed and put the half-deleted
version back in the list that selection_after_removal and Play read.

Co-Authored-By: Hermes Agent (Nous Research) <[email protected]>
This commit is contained in:
Alexander KrylovandHermes Agent committed 2026-10-30 08:38:06 +03:00
1 parent 24c323960e
commit ccb85be48e
1 file changed
+3
+3
View File
@@ -662,6 +662,9 @@ pub(crate) fn install_as(
pub fn remove(tag: &str) -> Result<(), String> {
let dir = version_dir(tag);
// The marker goes first: a version counted as installed until its folder is gone comes back
// into `installed` when an overlapping removal re-reads the list mid-delete.
let _ = fs::remove_file(dir.join(COMPLETE));
// Windows holds a file for a moment after the game, a scan or the launcher's own reader lets
// go of it, and remove_dir_all stops at the first one. Retry for a second; a folder that is
// already gone is removed.