VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Setup.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-13 19:13:28 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-07-13 21:35:23 (GMT)
commit7d6cd0c92d30ebb2dd0ec24744d18524538457b9 (patch)
treeb57976794415f2bf9f5e0cad3b81cdf6bec10b61 /src/Setup/Setup.c
parent103018b367108b2ffce9a4b7f91f3c07cd41c492 (diff)
downloadVeraCrypt-7d6cd0c92d30ebb2dd0ec24744d18524538457b9.zip
VeraCrypt-7d6cd0c92d30ebb2dd0ec24744d18524538457b9.tar.gz
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/Setup.c')
-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 a5a3018..ce52fe3 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);
}
}
}