diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 510366381501..e78c2ca636ef 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Runtime.Versioning; using osu.Desktop.LegacyIpc; using osu.Desktop.Windows; using osu.Framework; @@ -168,12 +169,20 @@ private static bool trySendIPCMessage(IIpcHost host, string cwd, string[] args) private static void setupVelopack() { - VelopackApp - .Build() - .WithFirstRun(v => - { - if (OperatingSystem.IsWindows()) WindowsAssociationManager.InstallAssociations(); - }).Run(); + var app = VelopackApp.Build(); + + if (OperatingSystem.IsWindows()) + configureWindows(app); + + app.Run(); + } + + [SupportedOSPlatform("windows")] + private static void configureWindows(VelopackApp app) + { + app.WithFirstRun(_ => WindowsAssociationManager.InstallAssociations()); + app.WithAfterUpdateFastCallback(_ => WindowsAssociationManager.UpdateAssociations()); + app.WithBeforeUninstallFastCallback(_ => WindowsAssociationManager.UninstallAssociations()); } } }