From 74383037c24e45013006c616f2866713da46d7e8 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 6 Nov 2022 15:50:08 +0000 Subject: [PATCH] Launcher updates --- Launcher/UpdateCheck.cs | 16 +++------------- Launcher/UpgradingWindow.xaml | 4 ++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Launcher/UpdateCheck.cs b/Launcher/UpdateCheck.cs index 49897a4..8d58d65 100644 --- a/Launcher/UpdateCheck.cs +++ b/Launcher/UpdateCheck.cs @@ -48,13 +48,6 @@ public async Task Execute(LauncherPrefs.ReleaseType releaseType, Upgrading // Get Correct Release switch (releaseType) { - // Continuous Intergration, - case LauncherPrefs.ReleaseType.Alpha: - // Gets latest build via API at Cyanlabs.net - WebClient wc = new(); - ciRelease = JsonConvert.DeserializeObject(wc.DownloadString(new Uri("https://api.cyanlabs.net/ci/Syn3Updater/latest"))); - break; - // Beta case LauncherPrefs.ReleaseType.Beta: // Get all GitHub releases for Syn3Updater and sets the value of 'latest' to the first (newest) retrieved @@ -73,7 +66,9 @@ public async Task Execute(LauncherPrefs.ReleaseType releaseType, Upgrading // Catch RateLimitExceededException exception, bypasses update check and launches Syn3Updater.exe catch (RateLimitExceededException) { + UpgradingWindow.Vm.Message = "GitHub Request Limit Exceeded!\nSkipping Update Check"; if (File.Exists("Syn3Updater.exe")) Process.Start("Syn3Updater.exe", "/launcher"); + await Task.Delay(5000); Application.Current.Shutdown(); return false; } @@ -105,12 +100,7 @@ public async Task Execute(LauncherPrefs.ReleaseType releaseType, Upgrading // Do the actual file download of the first Asset in the chosen GitHub Release or the CI download link with the previously created WebClient try { - await wc.DownloadFileTaskAsync( - releaseType == LauncherPrefs.ReleaseType.Alpha - // ReSharper disable once PossibleNullReferenceException - ? new Uri(ciRelease.Download) - // ReSharper disable once PossibleNullReferenceException - : new Uri(githubrelease.Assets.First(x => x.ContentType == "application/x-zip-compressed").BrowserDownloadUrl), zipPath); + await wc.DownloadFileTaskAsync(new Uri(githubrelease.Assets.First(x => x.ContentType == "application/x-zip-compressed").BrowserDownloadUrl), zipPath); } catch (WebException) { diff --git a/Launcher/UpgradingWindow.xaml b/Launcher/UpgradingWindow.xaml index 21a749a..f21275c 100644 --- a/Launcher/UpgradingWindow.xaml +++ b/Launcher/UpgradingWindow.xaml @@ -20,10 +20,10 @@ + VerticalAlignment="Bottom" Margin="418,0,0,182" Text="{Binding Message}" Width="360" TextAlignment="Center" FontSize="17" FontWeight="Bold" /> + Margin="431,254,35,158" Value="{Binding Percentage}" RenderTransformOrigin="0.5,0.5">