From 290412afced5f020c3c3cdaafe86c4352608ab16 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 21 Jul 2020 12:14:31 +0200 Subject: Windows Setup: Warn about Fast Startup during install if it is enabled and propose to disable it at the end of the installation. --- src/Setup/Setup.c | 9 +++++++++ src/Setup/Wizard.c | 10 ++++++++++ src/Setup/Wizard.h | 1 + 3 files changed, 20 insertions(+) (limited to 'src/Setup') diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index 7d17962c..364395d8 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -2362,6 +2362,15 @@ void DoInstall (void *arg) if (bOK && !bUninstall && !bDowngrade && !bRepairMode && !bDevm) { + BOOL bHibernateEnabled = FALSE, bHiberbootEnabled = FALSE; + if (GetHibernateStatus (bHibernateEnabled, bHiberbootEnabled)) + { + if (bHiberbootEnabled) + { + bPromptFastStartup = TRUE; + } + } + if (!IsHiddenOSRunning()) // A hidden OS user should not see the post-install notes twice (on decoy OS and then on hidden OS). { if (bRestartRequired || SystemEncryptionUpdate) diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c index 1021e8bc..7de3ef0c 100644 --- a/src/Setup/Wizard.c +++ b/src/Setup/Wizard.c @@ -60,6 +60,7 @@ BOOL bStartExtraction = FALSE; BOOL bInProgress = FALSE; BOOL bPromptTutorial = FALSE; BOOL bPromptReleaseNotes = FALSE; +BOOL bPromptFastStartup = FALSE; extern BOOL bUserSetLanguage; @@ -1203,6 +1204,15 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa bPromptTutorial = FALSE; } + if (bPromptFastStartup + && AskWarnYesNo ("CONFIRM_DISABLE_FAST_STARTUP", hwndDlg) == IDYES) + { + WriteLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", L"HiberbootEnabled", 0); + bRestartRequired = TRUE; + } + + bPromptFastStartup = FALSE; + if (bRestartRequired && AskYesNo (bUpgrade ? "UPGRADE_OK_REBOOT_REQUIRED" : "CONFIRM_RESTART", hwndDlg) == IDYES) { diff --git a/src/Setup/Wizard.h b/src/Setup/Wizard.h index df423b90..40ff0353 100644 --- a/src/Setup/Wizard.h +++ b/src/Setup/Wizard.h @@ -25,6 +25,7 @@ BOOL CALLBACK MainDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM extern BOOL bPromptTutorial; extern BOOL bPromptReleaseNotes; +extern BOOL bPromptFastStartup; #ifdef __cplusplus } -- cgit v1.2.3