Skip to content

Commit

Permalink
fix version being deleted after install
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepilledgreat committed Oct 4, 2023
1 parent 78d345f commit 6dafc22
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -954,34 +954,34 @@ private async Task InstallLatestVersion()
appFlagsKey.DeleteValue(oldGameClientLocation);
}
}
}

_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())
// 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())
{
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;
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}");
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);
}
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;

// don't register program size until the program is registered, which will be done after this
if (!App.IsFirstRun && !FreshInstall)
RegisterProgramSize();
Expand Down

0 comments on commit 6dafc22

Please sign in to comment.