VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2022-02-01 23:25:07 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2022-02-01 23:32:55 +0100
commit9b88625d9713309c2dd9285f69875852aad6fe6c (patch)
tree0e4c64258729b990005753b40cdab73d23c5705b /src/Common/Dlgcode.c
parent8ad93e6648d2c67b916ac94864ab190713731521 (diff)
downloadVeraCrypt-9b88625d9713309c2dd9285f69875852aad6fe6c.tar.gz
VeraCrypt-9b88625d9713309c2dd9285f69875852aad6fe6c.zip
Windows: Make MSI installer compatible with System Encryption by leveraging VeraCrypt service capabilities
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 7f2218e4..683e5c43 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -175,6 +175,10 @@ BOOL bLanguageSetInSetup = FALSE;
extern BOOL bMakePackage;
#endif
+#ifdef TCMOUNT
+extern BOOL ServiceMode;
+#endif
+
// Status of detection of hidden sectors (whole-system-drive encryption).
// 0 - Unknown/undetermined/completed, 1: Detection is or was in progress (but did not complete e.g. due to system crash).
int HiddenSectorDetectionStatus = 0;
@@ -4759,10 +4763,16 @@ load:
if (IsNonInstallMode () && CreateDriverSetupMutex () && DriverUnload () && nLoadRetryCount++ < 3)
goto load;
- CloseDriverSetupMutex ();
- CloseHandle (hDriver);
- hDriver = INVALID_HANDLE_VALUE;
- return ERR_DRIVER_VERSION;
+#ifdef TCMOUNT
+ // don't fail in case of service. This solves issues during upgrade when system encryption is enabled
+ if (!ServiceMode)
+#endif
+ {
+ CloseDriverSetupMutex ();
+ CloseHandle (hDriver);
+ hDriver = INVALID_HANDLE_VALUE;
+ return ERR_DRIVER_VERSION;
+ }
}
#else
if (!bResult)