mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix potential bug in install checker
UB would occur if installer.CheckInstallLocation() failed when attempting to change the install location
This commit is contained in:
parent
62064117b6
commit
356155c75b
@ -198,14 +198,7 @@ namespace Bloxstrap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installLocation is null)
|
if (fixInstallLocation && installLocation is not null)
|
||||||
{
|
|
||||||
Logger.Initialize(true);
|
|
||||||
LaunchHandler.LaunchInstaller();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (fixInstallLocation)
|
|
||||||
{
|
{
|
||||||
var installer = new Installer
|
var installer = new Installer
|
||||||
{
|
{
|
||||||
@ -218,8 +211,20 @@ namespace Bloxstrap
|
|||||||
Logger.WriteLine(LOG_IDENT, $"Changing install location to '{installLocation}'");
|
Logger.WriteLine(LOG_IDENT, $"Changing install location to '{installLocation}'");
|
||||||
installer.DoInstall();
|
installer.DoInstall();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// force reinstall
|
||||||
|
installLocation = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (installLocation is null)
|
||||||
|
{
|
||||||
|
Logger.Initialize(true);
|
||||||
|
LaunchHandler.LaunchInstaller();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Paths.Initialize(installLocation);
|
Paths.Initialize(installLocation);
|
||||||
|
|
||||||
// ensure executable is in the install directory
|
// ensure executable is in the install directory
|
||||||
@ -246,10 +251,8 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
Locale.Set(Settings.Prop.Locale);
|
Locale.Set(Settings.Prop.Locale);
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
if (!LaunchSettings.BypassUpdateCheck)
|
if (!LaunchSettings.BypassUpdateCheck)
|
||||||
Installer.HandleUpgrade();
|
Installer.HandleUpgrade();
|
||||||
#endif
|
|
||||||
|
|
||||||
LaunchHandler.ProcessLaunchArgs();
|
LaunchHandler.ProcessLaunchArgs();
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,11 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
public LaunchFlag StudioFlag { get; } = new("studio");
|
public LaunchFlag StudioFlag { get; } = new("studio");
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
public bool BypassUpdateCheck => true;
|
||||||
|
#else
|
||||||
public bool BypassUpdateCheck => UninstallFlag.Active || WatcherFlag.Active;
|
public bool BypassUpdateCheck => UninstallFlag.Active || WatcherFlag.Active;
|
||||||
|
#endif
|
||||||
|
|
||||||
public LaunchMode RobloxLaunchMode { get; set; } = LaunchMode.None;
|
public LaunchMode RobloxLaunchMode { get; set; } = LaunchMode.None;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user