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

Correctly support reinstalling the same version. Overwrite the bootloader if the same version detected.

This commit is contained in:
Mounir IDRASSI
2014-10-14 16:58:28 +02:00
parent effb5c7c1e
commit 2fe23a3fa3
3 changed files with 7 additions and 3 deletions

View File

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

View File

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

View File

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