diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index cd3fb7eb61..be8159a7cc 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; @@ -96,6 +97,8 @@ namespace osu.Desktop switch (RuntimeInfo.OS) { case RuntimeInfo.Platform.Windows: + Debug.Assert(OperatingSystem.IsWindows()); + return new SquirrelUpdateManager(); default: diff --git a/osu.Desktop/Updater/SquirrelUpdateManager.cs b/osu.Desktop/Updater/SquirrelUpdateManager.cs index 7b60bc03e4..b307146b10 100644 --- a/osu.Desktop/Updater/SquirrelUpdateManager.cs +++ b/osu.Desktop/Updater/SquirrelUpdateManager.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Runtime.Versioning; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -16,10 +17,11 @@ using osu.Game.Overlays.Notifications; using osuTK; using osuTK.Graphics; using Squirrel; -using LogLevel = Splat.LogLevel; +using Squirrel.SimpleSplat; namespace osu.Desktop.Updater { + [SupportedOSPlatform("windows")] public class SquirrelUpdateManager : osu.Game.Updater.UpdateManager { private UpdateManager updateManager; @@ -34,12 +36,14 @@ namespace osu.Desktop.Updater /// private bool updatePending; + private readonly SquirrelLogger squirrelLogger = new SquirrelLogger(); + [BackgroundDependencyLoader] private void load(NotificationOverlay notification) { notificationOverlay = notification; - Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger)); + SquirrelLocator.CurrentMutable.Register(() => squirrelLogger, typeof(ILogger)); } protected override async Task PerformUpdateCheck() => await checkForUpdateAsync().ConfigureAwait(false); @@ -49,9 +53,11 @@ namespace osu.Desktop.Updater // should we schedule a retry on completion of this check? bool scheduleRecheck = true; + const string github_token = null; // TODO: populate. + try { - updateManager ??= await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true).ConfigureAwait(false); + updateManager ??= new GithubUpdateManager(@"https://github.com/ppy/osu", false, github_token, @"osulazer"); var info = await updateManager.CheckForUpdate(!useDeltaPatching).ConfigureAwait(false); @@ -201,11 +207,11 @@ namespace osu.Desktop.Updater } } - private class SquirrelLogger : Splat.ILogger, IDisposable + private class SquirrelLogger : ILogger, IDisposable { - public LogLevel Level { get; set; } = LogLevel.Info; + public Squirrel.SimpleSplat.LogLevel Level { get; set; } = Squirrel.SimpleSplat.LogLevel.Info; - public void Write(string message, LogLevel logLevel) + public void Write(string message, Squirrel.SimpleSplat.LogLevel logLevel) { if (logLevel < Level) return;