1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 23:02:56 +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
commit f3a07654d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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());
}
}
}