From 6dafc220b3b59af7b7d3a6966138b08ef3057f86 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:05:15 +0100 Subject: [PATCH] fix version being deleted after install --- Bloxstrap/Bootstrapper.cs | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 2b479c3..3982fd9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -954,34 +954,34 @@ namespace Bloxstrap appFlagsKey.DeleteValue(oldGameClientLocation); } } - - // delete any old version folders - // we only do this if roblox isnt running just in case an update happened - // while they were launching a second instance or something idk - if (!Process.GetProcessesByName(App.RobloxPlayerAppName).Any() && !Process.GetProcessesByName(App.RobloxStudioAppName).Any()) - { - foreach (DirectoryInfo dir in new DirectoryInfo(Paths.Versions).GetDirectories()) - { - if (dir.Name == App.State.Prop.PlayerVersionGuid || dir.Name == App.State.Prop.StudioVersionGuid || !dir.Name.StartsWith("version-")) - continue; - - App.Logger.WriteLine(LOG_IDENT, $"Removing old version folder for {dir.Name}"); - - try - { - dir.Delete(true); - } - catch (Exception ex) - { - App.Logger.WriteLine(LOG_IDENT, "Failed to delete version folder!"); - App.Logger.WriteException(LOG_IDENT, ex); - } - } - } } _versionGuid = _latestVersionGuid; + // delete any old version folders + // we only do this if roblox isnt running just in case an update happened + // while they were launching a second instance or something idk + if (!Process.GetProcessesByName(App.RobloxPlayerAppName).Any() && !Process.GetProcessesByName(App.RobloxStudioAppName).Any()) + { + foreach (DirectoryInfo dir in new DirectoryInfo(Paths.Versions).GetDirectories()) + { + if (dir.Name == App.State.Prop.PlayerVersionGuid || dir.Name == App.State.Prop.StudioVersionGuid || !dir.Name.StartsWith("version-")) + continue; + + App.Logger.WriteLine(LOG_IDENT, $"Removing old version folder for {dir.Name}"); + + try + { + dir.Delete(true); + } + catch (Exception ex) + { + App.Logger.WriteLine(LOG_IDENT, "Failed to delete version folder!"); + App.Logger.WriteException(LOG_IDENT, ex); + } + } + } + // don't register program size until the program is registered, which will be done after this if (!App.IsFirstRun && !FreshInstall) RegisterProgramSize();