From 72c255ee0f30145dbafd3b83d463c94a896c7636 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Mon, 12 Aug 2024 16:10:15 -0400 Subject: [PATCH] "fix" reboot --- Rectify11Installer/Pages/ProgressPage.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Rectify11Installer/Pages/ProgressPage.cs b/Rectify11Installer/Pages/ProgressPage.cs index c38731042..120e7f703 100644 --- a/Rectify11Installer/Pages/ProgressPage.cs +++ b/Rectify11Installer/Pages/ProgressPage.cs @@ -1,6 +1,7 @@ using Rectify11Installer.Core; using Rectify11Installer.Win32; using System; +using System.Diagnostics; using System.Drawing; using System.IO; using System.Threading.Tasks; @@ -253,7 +254,15 @@ private void RestartRoutine() Variables.IsUninstall = true; if (r1.Checked) { - NativeMethods.Reboot(); + try + { + NativeMethods.Reboot(); + } + catch(Exception ex) + { + Logger.Warn("Reboot failed. " + ex.ToString()); + Process.Start("shutdown", "/r /t 0").WaitForExit(); + } } else if (r2.Checked) Application.Exit();