private async void CheckForUpdates() { UpdateChecker.Update update = await UpdateChecker.Check(WinTools.GetGitStyleVersion(), UpdateChecker.Platform.Windows); if (update == null) { return; } MessageBoxResult downloadNew = MessageBox.Show($"There is a new update available for NexDirect (version {update.Version}).\nIt was published on GitHub at {update.PublishedAt.ToString("g")}.\n\nOpen your browser now to download the latest update?", "NexDirect - Update Available", MessageBoxButton.YesNo, MessageBoxImage.Question); if (downloadNew == MessageBoxResult.No) { return; } Process.Start(update.Url); }
private async void CheckForUpdates() { UpdateChecker.Update update = await UpdateChecker.Check(WinTools.GetGitStyleVersion(), UpdateChecker.Platform.Windows); if (update == null) { return; } bool daylight = TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time").IsDaylightSavingTime(update.PublishedAt); MessageBoxResult downloadNew = MessageBox.Show($"There is a new update available for NexDirect (version {update.Version}).\nIt was published on GitHub at {WinTools.ToAustralianEasternTime(update.PublishedAt).ToString("g")} AE{(daylight ? "D" : "S")}T (Australian Eastern {(daylight ? "Daylight" : "Standard")} Time).\n\nOpen your browser now to download the latest update?", "NexDirect - Update Available", MessageBoxButton.YesNo, MessageBoxImage.Question); if (downloadNew == MessageBoxResult.No) { return; } Process.Start(update.Url); }
public static void Main(string[] args) { // If we need to upgrade the config file, need to do it now. if (NexDirect.Properties.Settings.Default.configUpgradeRequired) { NexDirect.Properties.Settings.Default.Upgrade(); NexDirect.Properties.Settings.Default.configUpgradeRequired = false; // we need to smash the cookies as we have updates :( NexDirect.Properties.Settings.Default.officialOsuCookies = null; NexDirect.Properties.Settings.Default.Save(); // The osu! folder check is to check if it is a new installation, because if it is then configupgrade will be true, and we dont need to pop this. if (!string.IsNullOrEmpty(NexDirect.Properties.Settings.Default.osuFolder)) { MessageBox.Show($"Your NexDirect installation has been successfully updated to version {WinTools.GetGitStyleVersion()}. Your previous settings have all been upgraded. Welcome back!", "NexDirect - Successful Update", MessageBoxButton.OK, MessageBoxImage.Information); } } if (SingleInstance <App> .InitializeAsFirstInstance(AppUnique)) { var app = new App(); app.InitializeComponent(); //app.HandleURIArgs(args.ToList()); app.Run(new MainWindow(args)); SingleInstance <App> .Cleanup(); } }