VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Wizard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Setup/Wizard.c')
-rw-r--r--src/Setup/Wizard.c67
1 files changed, 47 insertions, 20 deletions
diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c
index a497d4e0..abf76f69 100644
--- a/src/Setup/Wizard.c
+++ b/src/Setup/Wizard.c
@@ -45,8 +45,8 @@ enum wizard_pages
HWND hCurPage = NULL; /* Handle to current wizard page */
int nCurPageNo = -1; /* The current wizard page */
-wchar_t WizardDestInstallPath [TC_MAX_PATH];
-wchar_t WizardDestExtractPath [TC_MAX_PATH];
+wchar_t WizardDestInstallPath [TC_MAX_PATH] = { 0 };
+wchar_t WizardDestExtractPath [TC_MAX_PATH] = { 0 };
wchar_t SelfFile [TC_MAX_PATH];
HBITMAP hbmWizardBitmapRescaled = NULL;
@@ -60,6 +60,7 @@ BOOL bStartExtraction = FALSE;
BOOL bInProgress = FALSE;
BOOL bPromptTutorial = FALSE;
BOOL bPromptReleaseNotes = FALSE;
+BOOL bPromptFastStartup = FALSE;
extern BOOL bUserSetLanguage;
@@ -211,6 +212,7 @@ static int GetDonVal (int minVal, int maxVal)
BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static char PageDebugId[128];
+ static HWND hDisableMemProtectionTooltipWnd = NULL;
WORD lw = LOWORD (wParam);
WORD hw = HIWORD (wParam);
@@ -438,9 +440,16 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
EnableWindow (GetDlgItem (hwndDlg, IDC_SYSTEM_RESTORE), FALSE);
}
+ hDisableMemProtectionTooltipWnd = CreateToolTip (IDC_DISABLE_MEMORY_PROTECTION, hwndDlg, "DISABLE_MEMORY_PROTECTION_WARNING");
+ // make IDC_DISABLE_MEMORY_PROTECTION control fit the text so that the tooltip is shown only when mouse is over the text
+ AccommodateCheckBoxTextWidth(hwndDlg, IDC_DISABLE_MEMORY_PROTECTION);
+ // make the help button adjacent to the checkbox
+ MakeControlsContiguous(hwndDlg, IDC_DISABLE_MEMORY_PROTECTION, IDC_DISABLE_MEMORY_PROTECTION_HELP);
+
SetCheckBox (hwndDlg, IDC_ALL_USERS, bForAllUsers);
SetCheckBox (hwndDlg, IDC_FILE_TYPE, bRegisterFileExt);
SetCheckBox (hwndDlg, IDC_PROG_GROUP, bAddToStartMenu);
+ SetCheckBox (hwndDlg, IDC_DISABLE_MEMORY_PROTECTION, bDisableMemoryProtection);
SetCheckBox (hwndDlg, IDC_DESKTOP_ICON, bDesktopIcon);
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString (bUpgrade ? "UPGRADE" : "INSTALL"));
@@ -645,7 +654,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
switch (lw)
{
case IDC_BROWSE:
- if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath))
+ if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath, WizardDestExtractPath))
{
if (WizardDestExtractPath [wcslen(WizardDestExtractPath)-1] != L'\\')
{
@@ -666,7 +675,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
switch (lw)
{
case IDC_BROWSE:
- if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath))
+ if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath, WizardDestInstallPath))
{
if (WizardDestInstallPath [wcslen(WizardDestInstallPath)-1] != L'\\')
{
@@ -684,6 +693,18 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
bForAllUsers = IsButtonChecked (GetDlgItem (hCurPage, IDC_ALL_USERS));
return 1;
+ case IDC_DISABLE_MEMORY_PROTECTION:
+ bDisableMemoryProtection = IsButtonChecked (GetDlgItem (hCurPage, IDC_DISABLE_MEMORY_PROTECTION));
+ if (bDisableMemoryProtection)
+ {
+ Warning ("DISABLE_MEMORY_PROTECTION_WARNING", hwndDlg);
+ }
+ return 1;
+
+ case IDC_DISABLE_MEMORY_PROTECTION_HELP:
+ Applink("memoryprotection");
+ return 1;
+
case IDC_FILE_TYPE:
bRegisterFileExt = IsButtonChecked (GetDlgItem (hCurPage, IDC_FILE_TYPE));
return 1;
@@ -759,6 +780,16 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
return 0;
+ case WM_DESTROY:
+
+ if (hDisableMemProtectionTooltipWnd != NULL)
+ {
+ DestroyWindow (hDisableMemProtectionTooltipWnd);
+ hDisableMemProtectionTooltipWnd = NULL;
+ }
+
+ break;
+
}
return 0;
@@ -852,6 +883,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
DonColorSchemeId = GetDonVal (2, 9);
+ // get the initial value of bDisableMemoryProtection by reading the registry
+ bDisableMemoryProtection = bOriginalDisableMemoryProtection = ReadMemoryProtectionConfig()? FALSE : TRUE;
+
if (bDevm)
{
InitWizardDestInstallPath ();
@@ -915,22 +949,6 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
bLicenseAccepted = TRUE;
EnableWindow (GetDlgItem (hwndDlg, IDHELP), TRUE);
-
- if (nCurrentOS == WIN_2000)
- {
- WarningDirect (L"Warning: Please note that this may be the last version of VeraCrypt that supports Windows 2000. If you want to be able to upgrade to future versions of VeraCrypt (which is highly recommended), you will need to upgrade to Windows XP or a later version of Windows.\n\nNote: Microsoft stopped issuing security updates for Windows 2000 to the general public on 7/13/2010 (the last non-security update for Windows 2000 was issued to the general public in 2005).", hwndDlg);
-
-
- HKEY hkey;
-
- if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Updates\\Windows 2000\\SP5\\Update Rollup 1", 0, KEY_READ, &hkey) != ERROR_SUCCESS)
- {
- ErrorDirect (L"VeraCrypt requires Update Rollup 1 for Windows 2000 SP4 to be installed.\n\nFor more information, see http://support.microsoft.com/kb/891861", hwndDlg);
- AbortProcessSilent ();
- }
-
- RegCloseKey (hkey);
- }
}
#ifndef PORTABLE
else if (nCurPageNo == WIZARD_MODE_PAGE)
@@ -1219,6 +1237,15 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
bPromptTutorial = FALSE;
}
+ if (bPromptFastStartup
+ && AskWarnYesNo ("CONFIRM_DISABLE_FAST_STARTUP", hwndDlg) == IDYES)
+ {
+ WriteLocalMachineRegistryDword (L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", L"HiberbootEnabled", 0);
+ bRestartRequired = TRUE;
+ }
+
+ bPromptFastStartup = FALSE;
+
if (bRestartRequired
&& AskYesNo (bUpgrade ? "UPGRADE_OK_REBOOT_REQUIRED" : "CONFIRM_RESTART", hwndDlg) == IDYES)
{