mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 09:42:55 +08:00
Check whether the build is deployed within the public check updates method
This commit is contained in:
parent
e6ad28a1cb
commit
3c24ca08d0
@ -26,6 +26,7 @@ namespace osu.Desktop.Updater
|
|||||||
|
|
||||||
private UpdateManager updateManager;
|
private UpdateManager updateManager;
|
||||||
private NotificationOverlay notificationOverlay;
|
private NotificationOverlay notificationOverlay;
|
||||||
|
private OsuGameBase gameBase;
|
||||||
|
|
||||||
public Task PrepareUpdateAsync() => UpdateManager.RestartAppWhenExited();
|
public Task PrepareUpdateAsync() => UpdateManager.RestartAppWhenExited();
|
||||||
|
|
||||||
@ -34,16 +35,18 @@ namespace osu.Desktop.Updater
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(NotificationOverlay notification, OsuGameBase game)
|
private void load(NotificationOverlay notification, OsuGameBase game)
|
||||||
{
|
{
|
||||||
|
gameBase = game;
|
||||||
notificationOverlay = notification;
|
notificationOverlay = notification;
|
||||||
|
|
||||||
if (game.IsDeployedBuild)
|
Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger));
|
||||||
{
|
CheckForUpdate();
|
||||||
Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger));
|
|
||||||
CheckForUpdate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void CheckForUpdate() => Schedule(() => Task.Run(() => checkForUpdateAsync()));
|
public override void CheckForUpdate()
|
||||||
|
{
|
||||||
|
if (gameBase.IsDeployedBuild)
|
||||||
|
Schedule(() => Task.Run(() => checkForUpdateAsync()));
|
||||||
|
}
|
||||||
|
|
||||||
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
|
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
|
||||||
{
|
{
|
||||||
|
@ -26,16 +26,22 @@ namespace osu.Game.Updater
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private GameHost host { get; set; }
|
private GameHost host { get; set; }
|
||||||
|
|
||||||
|
private OsuGameBase gameBase;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase game)
|
private void load(OsuGameBase game)
|
||||||
{
|
{
|
||||||
|
gameBase = game;
|
||||||
version = game.Version;
|
version = game.Version;
|
||||||
|
|
||||||
if (game.IsDeployedBuild)
|
CheckForUpdate();
|
||||||
CheckForUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void CheckForUpdate() => Schedule(() => Task.Run(checkForUpdateAsync));
|
public override void CheckForUpdate()
|
||||||
|
{
|
||||||
|
if (gameBase.IsDeployedBuild)
|
||||||
|
Schedule(() => Task.Run(checkForUpdateAsync));
|
||||||
|
}
|
||||||
|
|
||||||
private async void checkForUpdateAsync()
|
private async void checkForUpdateAsync()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user