1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Move update/install logic into helper

This commit is contained in:
Susko3 2024-02-07 22:06:09 +01:00
parent 0563507295
commit 6bdb076027

View File

@ -54,6 +54,21 @@ namespace osu.Desktop.Windows
public static void InstallAssociations(LocalisationManager? localisation)
{
try
{
updateAssociations();
updateDescriptions(localisation);
NotifyShellUpdate();
}
catch (Exception e)
{
Logger.Log(@$"Failed to install file and URI associations: {e.Message}");
}
}
/// <summary>
/// Installs or updates associations.
/// </summary>
private static void updateAssociations()
{
using (var classes = Registry.CurrentUser.OpenSubKey(SOFTWARE_CLASSES, writable: true))
{
@ -66,14 +81,6 @@ namespace osu.Desktop.Windows
foreach (var association in uri_associations)
association.Install(classes, EXE_PATH);
}
updateDescriptions(localisation);
NotifyShellUpdate();
}
catch (Exception e)
{
Logger.Log(@$"Failed to install file and URI associations: {e.Message}");
}
}
private static void updateDescriptions(LocalisationManager? localisation)