Skip to content

Commit

Permalink
Merge pull request #29743 from smallketchup82/fix-file-associations
Browse files Browse the repository at this point in the history
Fix file associations not updating or uninstalling
  • Loading branch information
peppy authored Sep 7, 2024
2 parents 02eb683 + 9b189fd commit f3a0765
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions osu.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.IO;
using System.Runtime.Versioning;
using osu.Desktop.LegacyIpc;
using osu.Desktop.Windows;
using osu.Framework;
Expand Down Expand Up @@ -168,12 +169,20 @@ private static bool trySendIPCMessage(IIpcHost host, string cwd, string[] args)

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

0 comments on commit f3a0765

Please sign in to comment.