mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
fix version being deleted after install
This commit is contained in:
parent
78d345fd8f
commit
6dafc220b3
@ -954,34 +954,34 @@ namespace Bloxstrap
|
|||||||
appFlagsKey.DeleteValue(oldGameClientLocation);
|
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;
|
_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
|
// don't register program size until the program is registered, which will be done after this
|
||||||
if (!App.IsFirstRun && !FreshInstall)
|
if (!App.IsFirstRun && !FreshInstall)
|
||||||
RegisterProgramSize();
|
RegisterProgramSize();
|
||||||
|
Loading…
Reference in New Issue
Block a user