From 03578821c0c2c9fc4b4832208e7c10751f8b28af Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sat, 3 Feb 2024 17:04:06 +0100 Subject: [PATCH] Associate on startup --- osu.Desktop/OsuGameDesktop.cs | 7 ++++++- osu.Game/Updater/WindowsAssociationManager.cs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index a0db896f46..a048deddb3 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -134,9 +134,14 @@ namespace osu.Desktop LoadComponentAsync(new DiscordRichPresence(), Add); - if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows) + if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows && OperatingSystem.IsWindows()) + { LoadComponentAsync(new GameplayWinKeyBlocker(), Add); + string? executableLocation = Path.GetDirectoryName(typeof(OsuGameDesktop).Assembly.Location); + LoadComponentAsync(new WindowsAssociationManager(Path.Join(executableLocation, @"osu!.exe"), "osu"), Add); + } + LoadComponentAsync(new ElevatedPrivilegesChecker(), Add); osuSchemeLinkIPCChannel = new OsuSchemeLinkIPCChannel(Host, this); diff --git a/osu.Game/Updater/WindowsAssociationManager.cs b/osu.Game/Updater/WindowsAssociationManager.cs index 8949d88362..104406c81b 100644 --- a/osu.Game/Updater/WindowsAssociationManager.cs +++ b/osu.Game/Updater/WindowsAssociationManager.cs @@ -69,6 +69,7 @@ namespace osu.Game.Updater private void load() { localisationParameters = localisation.CurrentParameters.GetBoundCopy(); + InstallAssociations(); } protected override void LoadComplete()