From 47dcec060b9ec0e806af1b0582de1e356604ec9e Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Wed, 23 Aug 2023 10:10:33 +0100 Subject: [PATCH] Revert to LIVE if there's no Windows build (#526) --- Bloxstrap/Bootstrapper.cs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 6eaadb6..aa1ab2b 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -121,7 +121,6 @@ namespace Bloxstrap try { await RobloxDeployment.GetInfo(RobloxDeployment.DefaultChannel); - App.Logger.WriteLine(LOG_IDENT, "Connectivity check finished"); } catch (Exception ex) { @@ -140,6 +139,10 @@ namespace Bloxstrap App.Terminate(ErrorCode.ERROR_CANCELLED); } + finally + { + App.Logger.WriteLine(LOG_IDENT, "Connectivity check finished"); + } #if !DEBUG if (!App.IsFirstRun && App.Settings.Prop.CheckForUpdates) @@ -214,9 +217,25 @@ namespace Bloxstrap private async Task CheckLatestVersion() { + const string LOG_IDENT = "Bootstrapper::CheckLatestVersion"; + SetStatus("Connecting to Roblox..."); - - var clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); + + ClientVersion clientVersion; + + try + { + clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); + } + catch (HttpResponseException ex) + { + if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound) + throw; + + App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a WindowsPlayer build does not exist for {App.Settings.Prop.Channel}"); + App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel; + clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); + } if (clientVersion.IsBehindDefaultChannel) {