1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Uninstall associations when uninstalling from squirrel

This commit is contained in:
Susko3 2024-02-03 17:56:14 +01:00
parent 2bac09ee00
commit cdcf5bddda
3 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,7 @@ using osu.Framework.Platform;
using osu.Game; using osu.Game;
using osu.Game.IPC; using osu.Game.IPC;
using osu.Game.Tournament; using osu.Game.Tournament;
using osu.Game.Updater;
using SDL2; using SDL2;
using Squirrel; using Squirrel;
@ -180,6 +181,7 @@ namespace osu.Desktop
{ {
tools.RemoveShortcutForThisExe(); tools.RemoveShortcutForThisExe();
tools.RemoveUninstallerRegistryEntry(); tools.RemoveUninstallerRegistryEntry();
WindowsAssociationManager.UninstallAssociations(@"osu");
}, onEveryRun: (_, _, _) => }, onEveryRun: (_, _, _) =>
{ {
// While setting the `ProcessAppUserModelId` fixes duplicate icons/shortcuts on the taskbar, it currently // While setting the `ProcessAppUserModelId` fixes duplicate icons/shortcuts on the taskbar, it currently

View File

@ -100,7 +100,7 @@ namespace osu.Game.Tests.Visual.Updater
[Test] [Test]
public void TestNotifyShell() public void TestNotifyShell()
{ {
AddStep("notify shell of changes", () => associationManager.NotifyShellUpdate()); AddStep("notify shell of changes", WindowsAssociationManager.NotifyShellUpdate);
} }
} }
} }

View File

@ -78,7 +78,7 @@ namespace osu.Game.Updater
localisationParameters.ValueChanged += _ => updateDescriptions(); localisationParameters.ValueChanged += _ => updateDescriptions();
} }
internal void InstallAssociations() public void InstallAssociations()
{ {
try try
{ {
@ -132,7 +132,9 @@ namespace osu.Game.Updater
} }
} }
internal void UninstallAssociations() public void UninstallAssociations() => UninstallAssociations(programIdPrefix);
public static void UninstallAssociations(string programIdPrefix)
{ {
try try
{ {
@ -154,7 +156,7 @@ namespace osu.Game.Updater
} }
} }
internal void NotifyShellUpdate() => SHChangeNotify(EventId.SHCNE_ASSOCCHANGED, Flags.SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero); internal static void NotifyShellUpdate() => SHChangeNotify(EventId.SHCNE_ASSOCCHANGED, Flags.SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
#region Native interop #region Native interop