VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-10-14 01:06:55 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-10-14 01:08:43 +0200
commitf56a8c49f90bda734110f5ee28b2c405b417b057 (patch)
tree640ad67a79c71d9adcb1181288b180fefe9777a0 /src/Common
parent621330b726824f05156650eb0603b77dfda05578 (diff)
downloadVeraCrypt-f56a8c49f90bda734110f5ee28b2c405b417b057.tar.gz
VeraCrypt-f56a8c49f90bda734110f5ee28b2c405b417b057.zip
Windows: Fix regression that causes system favorites not to mount if VeraCrypt 1.24 is freshly installed and not updated.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/BootEncryption.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp
index 4061bde9..cc3caa92 100644
--- a/src/Common/BootEncryption.cpp
+++ b/src/Common/BootEncryption.cpp
@@ -4577,7 +4577,15 @@ namespace VeraCrypt
{
wchar_t appPath[TC_MAX_PATH];
throw_sys_if (!GetModuleFileName (NULL, appPath, ARRAYSIZE (appPath)));
-
+ /* explicitely specify VeraCrypt.exe as the file to copy and don't rely
+ * on the fact we will be always called by VeraCrypt.exe because it's not
+ * always true.
+ */
+ wchar_t* ptr = wcsrchr (appPath, L'\\');
+ if (ptr)
+ ptr[1] = 0;
+ StringCchCatW (appPath, ARRAYSIZE (appPath), _T(TC_APP_NAME) L".exe");
+
throw_sys_if (!CopyFile (appPath, servicePath.c_str(), FALSE));
}