VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-10-14 16:58:28 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 23:23:45 +0100
commit2fe23a3fa3e522951c1ee64c877d4256388f5363 (patch)
tree1e09058433fdbd8576b81e62cecbb1191bb76bc5 /src/Setup
parenteffb5c7c1e3df5e709e0fa95d7dadb0969855cf8 (diff)
downloadVeraCrypt-2fe23a3fa3e522951c1ee64c877d4256388f5363.tar.gz
VeraCrypt-2fe23a3fa3e522951c1ee64c877d4256388f5363.zip
Correctly support reinstalling the same version. Overwrite the bootloader if the same version detected.
Diffstat (limited to 'src/Setup')
-rw-r--r--src/Setup/Setup.c7
-rw-r--r--src/Setup/Setup.h1
-rw-r--r--src/Setup/Wizard.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index ea315b56..4737724c 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -60,6 +60,7 @@ BOOL bDowngrade = FALSE;
BOOL SystemEncryptionUpdate = FALSE;
BOOL PortableMode = FALSE;
BOOL bRepairMode = FALSE;
+BOOL bReinstallMode = FALSE;
BOOL bChangeMode = FALSE;
BOOL bDevm = FALSE;
BOOL bPossiblyFirstTimeInstall = FALSE;
@@ -245,8 +246,9 @@ void DetermineUpgradeDowngradeStatus (BOOL bCloseDriverHandle, LONG *driverVersi
bResult = DeviceIoControl (hDriver, TC_IOCTL_LEGACY_GET_DRIVER_VERSION, NULL, 0, &driverVersion, sizeof (driverVersion), &dwResult, NULL);
- bUpgrade = (bResult && driverVersion < VERSION_NUM);
+ bUpgrade = (bResult && driverVersion <= VERSION_NUM);
bDowngrade = (bResult && driverVersion > VERSION_NUM);
+ bReinstallMode = (bResult && driverVersion == VERSION_NUM);
PortableMode = DeviceIoControl (hDriver, TC_IOCTL_GET_PORTABLE_MODE_STATUS, NULL, 0, NULL, 0, &dwResult, NULL);
@@ -1073,7 +1075,8 @@ BOOL UpgradeBootLoader (HWND hwndDlg)
try
{
BootEncryption bootEnc (hwndDlg);
- if (bootEnc.GetInstalledBootLoaderVersion() < VERSION_NUM)
+ uint64 bootLoaderVersion = bootEnc.GetInstalledBootLoaderVersion();
+ if ((bootLoaderVersion < VERSION_NUM) || (bReinstallMode && (bootLoaderVersion == VERSION_NUM)))
{
StatusMessage (hwndDlg, "INSTALLER_UPDATING_BOOT_LOADER");
diff --git a/src/Setup/Setup.h b/src/Setup/Setup.h
index a524ce40..7a4d64f4 100644
--- a/src/Setup/Setup.h
+++ b/src/Setup/Setup.h
@@ -154,6 +154,7 @@ extern BOOL Rollback;
extern BOOL bUpgrade;
extern BOOL bPossiblyFirstTimeInstall;
extern BOOL bRepairMode;
+extern BOOL bReinstallMode;
extern BOOL bSystemRestore;
extern BOOL bDisableSwapFiles;
extern BOOL bForAllUsers;
diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c
index afb3be39..5695e906 100644
--- a/src/Setup/Wizard.c
+++ b/src/Setup/Wizard.c
@@ -271,7 +271,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
DetermineUpgradeDowngradeStatus (TRUE, &driverVersion);
- if (bRepairMode)
+ if (bRepairMode || bReinstallMode)
{
SetWindowTextW (GetDlgItem (hwndDlg, IDC_WIZARD_MODE_INSTALL), GetString ("REPAIR_REINSTALL"));
bExtractOnly = FALSE;