VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-13 21:13:28 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-13 23:35:23 +0200
commit7d6cd0c92d30ebb2dd0ec24744d18524538457b9 (patch)
treeb57976794415f2bf9f5e0cad3b81cdf6bec10b61 /src/Setup
parent103018b367108b2ffce9a4b7f91f3c07cd41c492 (diff)
downloadVeraCrypt-7d6cd0c92d30ebb2dd0ec24744d18524538457b9.tar.gz
VeraCrypt-7d6cd0c92d30ebb2dd0ec24744d18524538457b9.zip
Windows: on 64-bit Windows, more System favorite service from SysWoW64 to System32 since now all binaries are native 64-bit on 64-bit machines.
Diffstat (limited to 'src/Setup')
-rw-r--r--src/Setup/Setup.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index a5a30189..ce52fe3a 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -769,12 +769,51 @@ BOOL DoFilesInstall (HWND hwndDlg, char *szDestDir)
if (bResult && strcmp (szFiles[i], "AVeraCrypt.exe") == 0)
{
- string servicePath = GetServiceConfigPath (TC_APP_NAME ".exe");
+ if (Is64BitOs ())
+ EnableWow64FsRedirection (FALSE);
+
+ string servicePath = GetServiceConfigPath (TC_APP_NAME ".exe", false);
+ string serviceLegacyPath = GetServiceConfigPath (TC_APP_NAME ".exe", true);
+
if (FileExists (servicePath.c_str()))
{
CopyMessage (hwndDlg, (char *) servicePath.c_str());
bResult = CopyFile (szTmp, servicePath.c_str(), FALSE);
}
+ else if (Is64BitOs () && FileExists (serviceLegacyPath.c_str()))
+ {
+ string favoritesFile = GetServiceConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES, false);
+ string favoritesLegacyFile = GetServiceConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES, true);
+
+ // delete files from legacy path
+ RemoveMessage (hwndDlg, (char *) serviceLegacyPath.c_str());
+ DeleteFile (serviceLegacyPath.c_str());
+
+ CopyMessage (hwndDlg, (char *) servicePath.c_str());
+ bResult = CopyFile (szTmp, servicePath.c_str(), FALSE);
+
+ if (bResult && FileExists (favoritesLegacyFile.c_str()))
+ {
+ // copy the favorites XML file to the native system directory
+ bResult = CopyFile (favoritesLegacyFile.c_str(), favoritesFile.c_str(), FALSE);
+ if (bResult)
+ DeleteFile (favoritesLegacyFile.c_str());
+
+ BootEncryption BootEncObj (hwndDlg);
+
+ try
+ {
+ if (BootEncObj.GetStatus().DriveMounted)
+ {
+ BootEncObj.RegisterSystemFavoritesService (TRUE, TRUE);
+ }
+ }
+ catch (...) {}
+ }
+ }
+
+ if (Is64BitOs ())
+ EnableWow64FsRedirection (TRUE);
}
}
}