1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: Make MSI installer compatible with System Encryption by leveraging VeraCrypt service capabilities

This commit is contained in:
Mounir IDRASSI
2022-02-01 23:25:07 +01:00
parent 8ad93e6648
commit 9b88625d97
4 changed files with 80 additions and 30 deletions

View File

@@ -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)