From 718f11d9c381b7a007346744a033fc37c09e9f1c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 24 Sep 2023 12:48:34 +0200 Subject: Windows: make Setup correctly manage option to disable memory protection during upgrade --- src/Setup/Setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Setup/Setup.c') diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index f757aafa..fe25a412 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -75,6 +75,7 @@ BOOL bSystemRestore = TRUE; BOOL bDisableSwapFiles = FALSE; BOOL bForAllUsers = TRUE; BOOL bDisableMemoryProtection = FALSE; +BOOL bOriginalDisableMemoryProtection = FALSE; BOOL bRegisterFileExt = TRUE; BOOL bAddToStartMenu = TRUE; BOOL bDesktopIcon = TRUE; @@ -2336,9 +2337,10 @@ void DoInstall (void *arg) if (bSystemRestore) SetSystemRestorePoint (hwndDlg, TRUE); - if (bOK && bDisableMemoryProtection) + if (bOK && (bDisableMemoryProtection != bOriginalDisableMemoryProtection)) { - WriteMemoryProtectionConfig(FALSE); + WriteMemoryProtectionConfig(bDisableMemoryProtection? FALSE : TRUE); + bRestartRequired = TRUE; // Restart is required to apply the new memory protection settings } if (bOK) -- cgit v1.2.3