1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 01:13:52 +08:00

Merge pull request #29743 from smallketchup82/fix-file-associations

Fix file associations not updating or uninstalling
This commit is contained in:
Dean Herbert
2024-09-07 21:23:51 +09:00
committed by GitHub
Unverified
+15 -6
View File
@@ -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 @@ namespace osu.Desktop
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());
}
}
}