Cleanup Roblox folder on uninstallation

This commit is contained in:
pizzaboxer 2023-07-31 12:59:35 +01:00
parent 767783ae22
commit bca6e3d21b
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -670,6 +670,7 @@ namespace Bloxstrap
SetStatus($"Uninstalling {App.ProjectName}..."); SetStatus($"Uninstalling {App.ProjectName}...");
App.ShouldSaveConfigs = false; App.ShouldSaveConfigs = false;
bool robloxStillInstalled = true;
// check if stock bootstrapper is still installed // check if stock bootstrapper is still installed
RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player"); RegistryKey? bootstrapperKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player");
@ -677,6 +678,8 @@ namespace Bloxstrap
{ {
ProtocolHandler.Unregister("roblox"); ProtocolHandler.Unregister("roblox");
ProtocolHandler.Unregister("roblox-player"); ProtocolHandler.Unregister("roblox-player");
robloxStillInstalled = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\roblox-studio") is not null;
} }
else else
{ {
@ -716,6 +719,11 @@ namespace Bloxstrap
cleanupSequence.Add(() => Directory.Delete(Paths.Base, true)); cleanupSequence.Add(() => Directory.Delete(Paths.Base, true));
} }
string robloxFolder = Path.Combine(Paths.LocalAppData, "Roblox");
if (!robloxStillInstalled && Directory.Exists(robloxFolder))
cleanupSequence.Add(() => Directory.Delete(robloxFolder, true));
foreach (var process in cleanupSequence) foreach (var process in cleanupSequence)
{ {
try try