VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/SetupDLL
diff options
context:
space:
mode:
Diffstat (limited to 'src/SetupDLL')
-rw-r--r--src/SetupDLL/Setup.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/SetupDLL/Setup.c b/src/SetupDLL/Setup.c
index 14bdefd4..570af5d5 100644
--- a/src/SetupDLL/Setup.c
+++ b/src/SetupDLL/Setup.c
@@ -3472,6 +3472,7 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_DoChecks(MSIHANDLE hInstaller)
DWORD dw = 0;
std::wstring szInstallDir = L"";
BOOL bRefreshExts = FALSE;
+ BOOL bDisableReboot = FALSE;
UINT uiRet = ERROR_INSTALL_FAILURE;
MSILog(hInstaller, MSI_INFO_LEVEL, L"Begin VC_CustomAction_DoChecks");
@@ -3506,6 +3507,22 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_DoChecks(MSIHANDLE hInstaller)
}
}
+ // Get REBOOT to see whether it specified "ReallySuppress" which means no automatic reboot
+ szValueBuf.clear();
+ cchValueBuf = 0;
+ uiStat = MsiGetProperty(hInstaller, TEXT("REBOOT"), (LPWSTR)TEXT(""), &cchValueBuf);
+ if (ERROR_MORE_DATA == uiStat)
+ {
+ ++cchValueBuf; // add 1 for null termination
+ szValueBuf.resize(cchValueBuf);
+ uiStat = MsiGetProperty(hInstaller, TEXT("REBOOT"), &szValueBuf[0], &cchValueBuf);
+ if ((ERROR_SUCCESS == uiStat))
+ {
+ MSILog(hInstaller, MSI_INFO_LEVEL, L"VC_CustomAction_DoChecks: REBOOT = '%s'", szValueBuf.c_str());
+ bDisableReboot = (szValueBuf[0] == L'R' || szValueBuf[0] == L'r');
+ }
+ }
+
// Read RegKeys previously setup by Pre/Post-Install
if (RegOpenKeyExW (HKEY_LOCAL_MACHINE, L"Software\\.VeraCrypt\\Values", 0, KEY_READ, &hkey) == ERROR_SUCCESS)
{
@@ -3585,8 +3602,16 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_DoChecks(MSIHANDLE hInstaller)
// Check if reboot was required by the pre/post-install and set Wix property ISREBOOTREQUIRED accordingly.
if (bRestartRequired)
- {
- uiRet = MsiSetProperty(hInstaller, L"ISREBOOTREQUIRED", L"1");
+ {
+ if (bDisableReboot)
+ {
+ MSILog(hInstaller, MSI_INFO_LEVEL, L"VC_CustomAction_DoChecks: reboot is required but it is disabled because \"REBOOT\" specifies ReallySuppress");
+ }
+ else
+ {
+ MSILog(hInstaller, MSI_INFO_LEVEL, L"VC_CustomAction_DoChecks: reboot is required");
+ uiRet = MsiSetProperty(hInstaller, L"ISREBOOTREQUIRED", L"1");
+ }
}
else
{