mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 19:53:23 +08:00
Move update/install logic into helper
This commit is contained in:
parent
0563507295
commit
6bdb076027
@ -55,18 +55,7 @@ namespace osu.Desktop.Windows
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var classes = Registry.CurrentUser.OpenSubKey(SOFTWARE_CLASSES, writable: true))
|
||||
{
|
||||
if (classes == null)
|
||||
return;
|
||||
|
||||
foreach (var association in file_associations)
|
||||
association.Install(classes, EXE_PATH, PROGRAM_ID_PREFIX);
|
||||
|
||||
foreach (var association in uri_associations)
|
||||
association.Install(classes, EXE_PATH);
|
||||
}
|
||||
|
||||
updateAssociations();
|
||||
updateDescriptions(localisation);
|
||||
NotifyShellUpdate();
|
||||
}
|
||||
@ -76,6 +65,24 @@ namespace osu.Desktop.Windows
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Installs or updates associations.
|
||||
/// </summary>
|
||||
private static void updateAssociations()
|
||||
{
|
||||
using (var classes = Registry.CurrentUser.OpenSubKey(SOFTWARE_CLASSES, writable: true))
|
||||
{
|
||||
if (classes == null)
|
||||
return;
|
||||
|
||||
foreach (var association in file_associations)
|
||||
association.Install(classes, EXE_PATH, PROGRAM_ID_PREFIX);
|
||||
|
||||
foreach (var association in uri_associations)
|
||||
association.Install(classes, EXE_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
private static void updateDescriptions(LocalisationManager? localisation)
|
||||
{
|
||||
using var classes = Registry.CurrentUser.OpenSubKey(SOFTWARE_CLASSES, true);
|
||||
|
Loading…
Reference in New Issue
Block a user