VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-23 11:57:25 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-23 14:52:12 +0200
commit3dfd4a533264807898a2d1b58f113ba48ee6f13d (patch)
tree6b0185e853ba7ce1d52bea917af13d2e7bb59962 /src
parent7cc2a3527dd27f49f617c4bfb915fd00098801ab (diff)
downloadVeraCrypt-3dfd4a533264807898a2d1b58f113ba48ee6f13d.tar.gz
VeraCrypt-3dfd4a533264807898a2d1b58f113ba48ee6f13d.zip
Windows: display notice about creating new Rescue Disk at first boot after upgrade.
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c13
-rw-r--r--src/Common/Dlgcode.h5
-rw-r--r--src/Common/Language.xml1
-rw-r--r--src/Mount/Mount.c4
-rw-r--r--src/Setup/Setup.c8
-rw-r--r--src/Setup/Setup.h1
6 files changed, 31 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 5dedcd7e..a5c5a293 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -2534,6 +2534,7 @@ void SavePostInstallTasksSettings (int command)
case TC_POST_INSTALL_CFG_REMOVE_ALL:
_wremove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL));
_wremove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES));
+ _wremove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RESCUE_DISK));
break;
case TC_POST_INSTALL_CFG_TUTORIAL:
@@ -2544,6 +2545,10 @@ void SavePostInstallTasksSettings (int command)
f = _wfopen (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES), L"w");
break;
+ case TC_POST_INSTALL_CFG_RESCUE_DISK:
+ f = _wfopen (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RESCUE_DISK), L"w");
+ break;
+
default:
return;
}
@@ -2584,6 +2589,14 @@ void DoPostInstallTasks (HWND hwndDlg)
bDone = TRUE;
}
+ if (FileExists (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RESCUE_DISK)))
+ {
+ if (AskYesNo ("AFTER_UPGRADE_RESCUE_DISK", hwndDlg) == IDYES)
+ PostMessage (hwndDlg, VC_APPMSG_CREATE_RESCUE_DISK, 0, 0);
+
+ bDone = TRUE;
+ }
+
if (bDone)
SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_REMOVE_ALL);
}
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index d2db4ba4..a997bfa8 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -79,6 +79,7 @@ enum
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE L"In-Place Encryption Wipe Algo"
#define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL L"Post-Install Task - Tutorial"
#define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES L"Post-Install Task - Release Notes"
+#define TC_APPD_FILENAME_POST_INSTALL_TASK_RESCUE_DISK L"Post-Install Task - Rescue Disk"
#define VC_FILENAME_RENAMED_SUFFIX L"_old"
@@ -94,7 +95,8 @@ enum
{
TC_POST_INSTALL_CFG_REMOVE_ALL = 0,
TC_POST_INSTALL_CFG_TUTORIAL,
- TC_POST_INSTALL_CFG_RELEASE_NOTES
+ TC_POST_INSTALL_CFG_RELEASE_NOTES,
+ TC_POST_INSTALL_CFG_RESCUE_DISK,
};
extern char *LastDialogId;
@@ -178,6 +180,7 @@ enum tc_app_msg_ids
TC_APPMSG_MOUNT_ENABLE_DISABLE_CONTROLS = WM_APP + 201,
TC_APPMSG_MOUNT_SHOW_WINDOW = WM_APP + 202,
TC_APPMSG_PREBOOT_PASSWORD_MODE = WM_APP + 203,
+ VC_APPMSG_CREATE_RESCUE_DISK = WM_APP + 204,
// Format
TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED = WM_APP + 301,
TC_APPMSG_FORMAT_FINISHED = WM_APP + 302,
diff --git a/src/Common/Language.xml b/src/Common/Language.xml
index ab348a82..4fc56d28 100644
--- a/src/Common/Language.xml
+++ b/src/Common/Language.xml
@@ -1422,6 +1422,7 @@
<string lang="en" key="EDIT_DCSPROP_FOR_ADVANCED_ONLY">WARNING: Inexperienced users should never attempt to manually edit boot loader configurations.\n\nContinue?</string>
<string lang="en" key="DCSPROP_XML_VALIDATION_FAILED">WARNING: Failed to validate the XML format of the Boot Loader configuration. Please check your modifications.</string>
<control lang="en" key="IDT_ADVANCED_OPTIONS">Advanced Options</control>
+ <string lang="en" key="AFTER_UPGRADE_RESCUE_DISK">It is strongly recommended that you create a new VeraCrypt Rescue Disk (which will contain the new version of the VeraCrypt Boot Loader) by selecting 'System' > 'Create Rescue Disk'.\nDo you want to do it now?</string>
</localization>
<!-- XML Schema -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 51a7c98a..b3773b1a 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -8531,6 +8531,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
ShowWindow (hwndDlg, SW_RESTORE);
return 1;
+ case VC_APPMSG_CREATE_RESCUE_DISK:
+ CreateRescueDisk (hwndDlg);
+ return 1;
+
case WM_COPYDATA:
{
PCOPYDATASTRUCT cd = (PCOPYDATASTRUCT)lParam;
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index a3d14c65..3da3609d 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -59,6 +59,7 @@ BOOL bMakePackage = FALSE;
BOOL bDone = FALSE;
BOOL Rollback = FALSE;
BOOL bUpgrade = FALSE;
+BOOL bUpdateRescueDisk = FALSE;
BOOL bDowngrade = FALSE;
BOOL SystemEncryptionUpdate = FALSE;
BOOL PortableMode = FALSE;
@@ -1688,7 +1689,10 @@ BOOL UpgradeBootLoader (HWND hwndDlg)
bootEnc.InstallBootLoader (true);
if (bootEnc.GetInstalledBootLoaderVersion() <= TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION)
+ {
+ bUpdateRescueDisk = TRUE;
Info (IsHiddenOSRunning() ? "BOOT_LOADER_UPGRADE_OK_HIDDEN_OS" : "BOOT_LOADER_UPGRADE_OK", hwndDlg);
+ }
}
return TRUE;
}
@@ -2276,6 +2280,10 @@ void DoInstall (void *arg)
if (bUpgrade)
{
SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_RELEASE_NOTES);
+ if (bUpdateRescueDisk)
+ {
+ SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_RESCUE_DISK);
+ }
}
else if (bPossiblyFirstTimeInstall)
{
diff --git a/src/Setup/Setup.h b/src/Setup/Setup.h
index 07655060..b29ad14a 100644
--- a/src/Setup/Setup.h
+++ b/src/Setup/Setup.h
@@ -95,6 +95,7 @@ BOOL CALLBACK InstallDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM
extern BOOL bDevm;
extern BOOL Rollback;
extern BOOL bUpgrade;
+extern BOOL bUpdateRescueDisk;
extern BOOL bPossiblyFirstTimeInstall;
extern BOOL bRepairMode;
extern BOOL bReinstallMode;