mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 22:12:53 +08:00
Fix windows check weirdness
This commit is contained in:
parent
575da0992f
commit
9b189fd244
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
using osu.Desktop.LegacyIpc;
|
using osu.Desktop.LegacyIpc;
|
||||||
using osu.Desktop.Windows;
|
using osu.Desktop.Windows;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
@ -170,28 +171,18 @@ namespace osu.Desktop
|
|||||||
{
|
{
|
||||||
var app = VelopackApp.Build();
|
var app = VelopackApp.Build();
|
||||||
|
|
||||||
app.WithFirstRun(_ =>
|
|
||||||
{
|
|
||||||
if (OperatingSystem.IsWindows())
|
|
||||||
WindowsAssociationManager.InstallAssociations();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows())
|
if (OperatingSystem.IsWindows())
|
||||||
{
|
configureWindows(app);
|
||||||
app.WithAfterUpdateFastCallback(_ =>
|
|
||||||
{
|
|
||||||
if (OperatingSystem.IsWindows())
|
|
||||||
WindowsAssociationManager.UpdateAssociations();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.WithBeforeUninstallFastCallback(_ =>
|
|
||||||
{
|
|
||||||
if (OperatingSystem.IsWindows())
|
|
||||||
WindowsAssociationManager.UninstallAssociations();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
app.Run();
|
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