diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs
index 65236940c6..494d0df3c6 100644
--- a/osu.Desktop/Program.cs
+++ b/osu.Desktop/Program.cs
@@ -174,10 +174,11 @@ namespace osu.Desktop
{
tools.CreateShortcutForThisExe();
tools.CreateUninstallerRegistryEntry();
- WindowsAssociationManager.InstallAssociations(null);
+ WindowsAssociationManager.InstallAssociations();
}, onAppUpdate: (_, tools) =>
{
tools.CreateUninstallerRegistryEntry();
+ WindowsAssociationManager.UpdateAssociations();
}, onAppUninstall: (_, tools) =>
{
tools.RemoveShortcutForThisExe();
diff --git a/osu.Desktop/Windows/WindowsAssociationManager.cs b/osu.Desktop/Windows/WindowsAssociationManager.cs
index 3d61ad534b..18a3c2da3d 100644
--- a/osu.Desktop/Windows/WindowsAssociationManager.cs
+++ b/osu.Desktop/Windows/WindowsAssociationManager.cs
@@ -51,12 +51,18 @@ namespace osu.Desktop.Windows
new UriAssociation(@"osump", WindowsAssociationManagerStrings.OsuMultiplayer, Icons.Lazer),
};
- public static void InstallAssociations(LocalisationManager? localisation)
+ ///
+ /// Installs file and URI associations.
+ ///
+ ///
+ /// Call in a timely fashion to keep descriptions up-to-date and localised.
+ ///
+ public static void InstallAssociations()
{
try
{
updateAssociations();
- updateDescriptions(localisation);
+ updateDescriptions(null); // write default descriptions in case `UpdateDescriptions()` is not called.
NotifyShellUpdate();
}
catch (Exception e)
@@ -65,6 +71,38 @@ namespace osu.Desktop.Windows
}
}
+ ///
+ /// Updates associations with latest definitions.
+ ///
+ ///
+ /// Call in a timely fashion to keep descriptions up-to-date and localised.
+ ///
+ public static void UpdateAssociations()
+ {
+ try
+ {
+ updateAssociations();
+ NotifyShellUpdate();
+ }
+ catch (Exception e)
+ {
+ Logger.Log(@$"Failed to update file and URI associations: {e.Message}");
+ }
+ }
+
+ public static void UpdateDescriptions(LocalisationManager localisationManager)
+ {
+ try
+ {
+ updateDescriptions(localisationManager);
+ NotifyShellUpdate();
+ }
+ catch (Exception e)
+ {
+ Logger.Log(@$"Failed to update file and URI association descriptions: {e.Message}");
+ }
+ }
+
///
/// Installs or updates associations.
///