VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-07 01:35:23 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-09-07 01:40:51 +0200
commit0bd265cbde32fde9814d7cabf8e99142ce94bba5 (patch)
tree9f14283c1c26ee13d2dc207e39322add6650e187 /src
parent9fc98b5ea3c53fe7f4d875d26fff3687d38b262e (diff)
downloadVeraCrypt-0bd265cbde32fde9814d7cabf8e99142ce94bba5.tar.gz
VeraCrypt-0bd265cbde32fde9814d7cabf8e99142ce94bba5.zip
Windows: Launch Format/Expander wizards from VeraCrypt.exe using executable binaries with the same architecture.
Diffstat (limited to 'src')
-rw-r--r--src/Mount/Mount.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 97187f92..72728321 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -1288,10 +1288,25 @@ static void LaunchVolCreationWizard (HWND hwndDlg, const char *arg)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
+ char formatExeName[64];
+ char* suffix = NULL;
ZeroMemory (&si, sizeof (si));
+ StringCbCopyA (formatExeName, sizeof (formatExeName), "\\VeraCrypt Format");
+
+ // check if there is a suffix in VeraCrypt file name
+ // in order to use the same for "VeraCrypt Format"
+ suffix = strrchr (tmp + 1, '-');
+ if (suffix)
+ {
+ StringCbCatA (formatExeName, sizeof (formatExeName), suffix);
+ StringCbCatA (formatExeName, sizeof (formatExeName), "\"");
+ }
+ else
+ StringCbCatA (formatExeName, sizeof (formatExeName), ".exe\"");
+
*tmp = 0;
- StringCbCatA (t, sizeof(t), "\\VeraCrypt Format.exe\"");
+ StringCbCatA (t, sizeof(t), formatExeName);
if (!FileExists(t))
Error ("VOL_CREATION_WIZARD_NOT_FOUND", hwndDlg); // Display a user-friendly error message and advise what to do
@@ -1316,7 +1331,7 @@ static void LaunchVolCreationWizard (HWND hwndDlg, const char *arg)
static void LaunchVolExpander (HWND hwndDlg)
{
- char t[TC_MAX_PATH] = {'"',0};
+ char t[TC_MAX_PATH + TC_MAX_PATH] = {'"',0};
char *tmp;
GetModuleFileName (NULL, t+1, sizeof(t)-1);
@@ -1324,8 +1339,24 @@ static void LaunchVolExpander (HWND hwndDlg)
tmp = strrchr (t, '\\');
if (tmp)
{
+ char expanderExeName[64];
+ char* suffix = NULL;
+
+ StringCbCopyA (expanderExeName, sizeof (expanderExeName), "\\VeraCryptExpander");
+
+ // check if there is a suffix in VeraCrypt file name
+ // in order to use the same for "VeraCrypt Format"
+ suffix = strrchr (tmp + 1, '-');
+ if (suffix)
+ {
+ StringCbCatA (expanderExeName, sizeof (expanderExeName), suffix);
+ StringCbCatA (expanderExeName, sizeof (expanderExeName), "\"");
+ }
+ else
+ StringCbCatA (expanderExeName, sizeof (expanderExeName), ".exe\"");
+
*tmp = 0;
- StringCbCatA (t, sizeof(t), "\\VeraCryptExpander.exe\"");
+ StringCbCatA (t, sizeof(t), expanderExeName);
if (!FileExists(t))
Error ("VOL_EXPANDER_NOT_FOUND", hwndDlg); // Display a user-friendly error message and advise what to do