Fix uninstallation not cleaning up properly

This commit is contained in:
pizzaboxer 2024-10-10 20:01:51 +01:00
parent 8ffb22c4f9
commit d72f835ad1
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -285,6 +285,7 @@ namespace Bloxstrap
() => Directory.Delete(Paths.Downloads, true),
() => Directory.Delete(Paths.Roblox, true),
() => Directory.Delete(Paths.Icons, true),
() => File.Delete(App.State.FileLocation)
};
@ -300,13 +301,7 @@ namespace Bloxstrap
});
}
bool deleteFolder = false;
if (Directory.Exists(Paths.Base))
{
var folderFiles = Directory.GetFiles(Paths.Base);
deleteFolder = folderFiles.Length == 1 && folderFiles.First().EndsWith(".exe", StringComparison.InvariantCultureIgnoreCase);
}
bool deleteFolder = Directory.GetFiles(Paths.Base).Length <= 3;
if (deleteFolder)
cleanupSequence.Add(() => Directory.Delete(Paths.Base, true));