mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 02:12:56 +08:00
Merge pull request #29743 from smallketchup82/fix-file-associations
Fix file associations not updating or uninstalling
This commit is contained in:
commit
f3a07654d1
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user