From e08a2d09d7d43366015e75c98b21c9f9004e8ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Fri, 15 Sep 2023 20:45:25 +0200 Subject: [PATCH] Update MainWindow.BthPS3.cs --- app/MainWindow.BthPS3.cs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/app/MainWindow.BthPS3.cs b/app/MainWindow.BthPS3.cs index 9c9c45d..0884472 100644 --- a/app/MainWindow.BthPS3.cs +++ b/app/MainWindow.BthPS3.cs @@ -53,7 +53,7 @@ private void DetectBthPS3() { ResultsPanel.Children.Add(CreateNewTile("Outdated BthPS3 Updater Configuration found", BthPS3UpdaterOutdatedOnClicked, true)); - _actionsToRun.Add(BthPS3UpdaterOutdatedOnClicked); + _actionsToRun.Add(FixBthPS3UpdaterOutdated); } } } @@ -79,6 +79,23 @@ private async void BthPS3UpdaterOutdatedOnClicked() ProgressDialogController controller = await this.ShowProgressAsync("Please wait...", "Deleting automatic updater"); + FixBthPS3UpdaterOutdated(); + + controller.SetMessage("Showing update notification"); + + await this.ShowMessageAsync("Download update", + "I will now take you to the latest setup, simply download it and follow the steps to be up to date!"); + + Process.Start(Constants.BthPS3LatestReleaseUri); + + await controller.CloseAsync(); + + await Refresh(); + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + private static void FixBthPS3UpdaterOutdated() + { try { TaskService.Instance.RootFolder.DeleteTask(Constants.BthPS3UpdaterScheduledTaskName, false); @@ -110,16 +127,5 @@ private async void BthPS3UpdaterOutdatedOnClicked() { Log.Error(ex, "Failed to delete updater INI file"); } - - controller.SetMessage("Showing update notification"); - - await this.ShowMessageAsync("Download update", - "I will now take you to the latest setup, simply download it and follow the steps to be up to date!"); - - Process.Start(Constants.BthPS3LatestReleaseUri); - - await controller.CloseAsync(); - - await Refresh(); } } \ No newline at end of file