Files
Nebula-Auth/NebulaAuth/Core/UpdateManager.cs
T
Давид Чернопятов 80d7c09b0d Prepared for 1.5.2 release
HOTFIX: Resolved an issue introduced by the September 18, 2024, Steam update, where an error occurred during session refresh due to changes in Steam's response model.
2024-09-18 14:16:32 +03:00

76 lines
1.9 KiB
C#

using AutoUpdaterDotNET;
using NebulaAuth.Model;
using System;
using System.IO;
namespace NebulaAuth.Core;
public static class UpdateManager
{
private const string UPDATE_URL = "https://raw.githubusercontent.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/master/NebulaAuth/update.xml";
public static void CheckForUpdates()
{
string jsonPath = Path.Combine(Environment.CurrentDirectory, "update-settings.json");
AutoUpdater.PersistenceProvider = new JsonFilePersistenceProvider(jsonPath);
AutoUpdater.ShowSkipButton = false;
if (Settings.Instance.AllowAutoUpdate)
AutoUpdater.UpdateMode = Mode.ForcedDownload;
AutoUpdater.Start(UPDATE_URL);
}
//static UpdateManager()
//{
// //AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;
//}
//private static async void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
//{
// if (args.Error == null)
// {
// if (args.IsUpdateAvailable)
// {
// DialogResult dialogResult;
// var dialog = new UpdaterView()
// {
// DataContext = new UpdaterVM(args)
// };
// await DialogHost.Show(dialog);
// Application.Current.Shutdown();
// }
// else
// {
// }
// }
// else
// {
// if (args.Error is WebException)
// {
// }
// else
// {
// }
// }
//}
//private static void RunUpdate(UpdateInfoEventArgs args)
//{
// Application.Current.Dispatcher.Invoke(() =>
// {
// if (AutoUpdater.DownloadUpdate(args))
// {
// Application.Current.Shutdown();
// }
// }, DispatcherPriority.ContextIdle);
//}
}