From ca46cf928ae763aab639ac943a40633fdac3389e Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 26 Oct 2019 22:49:37 +0200 Subject: Windows: Update EFI NVRAM variable only if changed or doesn't exist and add configuration to force setting EFI BootNext to veraCrypt bootloader before each shutdown --- src/Mount/Mount.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Mount') diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 2837d449..bde729ee 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -9430,7 +9430,10 @@ static DWORD WINAPI SystemFavoritesServiceCtrlHandler ( DWORD dwControl, if (!BootEncStatus.HiddenSystem) { // re-install our bootloader again in case the update process has removed it. - BootEncryption bootEnc (NULL, true); + bool bForceSetNextBoot = false; + if (BootEncObj->ReadServiceConfigurationFlags () & VC_SYSTEM_FAVORITES_SERVICE_CONFIG_FORCE_SET_BOOTNEXT) + bForceSetNextBoot = true; + BootEncryption bootEnc (NULL, true, bForceSetNextBoot); bootEnc.InstallBootLoader (true); } } -- cgit v1.2.3