diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index d7e5454b6a..1b72e85289 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -15,7 +15,7 @@ using osu.Framework.Graphics.Textures; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; -using System; +using System.Net.Http; namespace osu.Desktop.Overlays { @@ -116,32 +116,33 @@ namespace osu.Desktop.Overlays try { updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true); - - if (!updateManager.IsInstalledApp) - return; - - var info = await updateManager.CheckForUpdate(); - if (info.ReleasesToApply.Count > 0) - { - ProgressNotification n = new UpdateProgressNotification - { - Text = @"Downloading update..." - }; - Schedule(() => notification.Post(n)); - Schedule(() => n.State = ProgressNotificationState.Active); - await updateManager.DownloadReleases(info.ReleasesToApply, (int p) => Schedule(() => n.Progress = p / 100f)); - Schedule(() => n.Text = @"Installing update..."); - await updateManager.ApplyReleases(info, (int p) => Schedule(() => n.Progress = p / 100f)); - Schedule(() => n.State = ProgressNotificationState.Completed); - - } - else - { - //check again every 30 minutes. - Scheduler.AddDelayed(updateChecker, 60000 * 30); - } } - catch(Exception e) + catch(HttpRequestException) + { + //check again every 30 minutes. + Scheduler.AddDelayed(updateChecker, 60000 * 30); + return; + } + + if (!updateManager.IsInstalledApp) + return; + + var info = await updateManager.CheckForUpdate(); + if (info.ReleasesToApply.Count > 0) + { + ProgressNotification n = new UpdateProgressNotification + { + Text = @"Downloading update..." + }; + Schedule(() => notification.Post(n)); + Schedule(() => n.State = ProgressNotificationState.Active); + await updateManager.DownloadReleases(info.ReleasesToApply, (int p) => Schedule(() => n.Progress = p / 100f)); + Schedule(() => n.Text = @"Installing update..."); + await updateManager.ApplyReleases(info, (int p) => Schedule(() => n.Progress = p / 100f)); + Schedule(() => n.State = ProgressNotificationState.Completed); + + } + else { //check again every 30 minutes. Scheduler.AddDelayed(updateChecker, 60000 * 30); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 2ab913d706..603ae53174 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -137,6 +137,16 @@ + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + True + + @@ -219,7 +229,9 @@ - + + + + + +