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

Windows: Installer and Traveler Disk Setup both always copy 32-bit and 64-bit executable binaries.

This commit is contained in:
Mounir IDRASSI
2015-09-06 18:58:41 +02:00
parent e445863ae4
commit 13bfb2db59
3 changed files with 70 additions and 3 deletions

View File

@@ -3932,8 +3932,11 @@ BOOL CALLBACK TravelerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt", dstDir); StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt", dstDir);
CreateDirectory (dstPath, NULL); CreateDirectory (dstPath, NULL);
// Main app // Main app 32-bit
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt.exe", appDir); if (Is64BitOs ())
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt-x86.exe", appDir);
else
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt.exe", appDir);
StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt\\VeraCrypt.exe", dstDir); StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt\\VeraCrypt.exe", dstDir);
if (!TCCopyFile (srcPath, dstPath)) if (!TCCopyFile (srcPath, dstPath))
{ {
@@ -3941,16 +3944,44 @@ BOOL CALLBACK TravelerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
goto stop; goto stop;
} }
// Main app 64-bit
if (Is64BitOs ())
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt.exe", appDir);
else
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt-x64.exe", appDir);
StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt\\VeraCrypt-x64.exe", dstDir);
if (!TCCopyFile (srcPath, dstPath))
{
handleWin32Error (hwndDlg, SRC_POS);
goto stop;
}
// Wizard // Wizard
if (copyWizard) if (copyWizard)
{ {
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt Format.exe", appDir); // Wizard 32-bit
if (Is64BitOs ())
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt Format-x86.exe", appDir);
else
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt Format.exe", appDir);
StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt\\VeraCrypt Format.exe", dstDir); StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt\\VeraCrypt Format.exe", dstDir);
if (!TCCopyFile (srcPath, dstPath)) if (!TCCopyFile (srcPath, dstPath))
{ {
handleWin32Error (hwndDlg, SRC_POS); handleWin32Error (hwndDlg, SRC_POS);
goto stop; goto stop;
} }
// Wizard 64-bit
if (Is64BitOs ())
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt Format.exe", appDir);
else
StringCbPrintfA (srcPath, sizeof(srcPath), "%s\\VeraCrypt Format-x64.exe", appDir);
StringCbPrintfA (dstPath, sizeof(dstPath), "%s\\VeraCrypt\\VeraCrypt Format-x64.exe", dstDir);
if (!TCCopyFile (srcPath, dstPath))
{
handleWin32Error (hwndDlg, SRC_POS);
goto stop;
}
} }
// Driver // Driver

View File

@@ -641,6 +641,18 @@ BOOL DoFilesInstall (HWND hwndDlg, char *szDestDir)
continue; // Destination = target continue; // Destination = target
} }
// skip files that don't apply to the current architecture
if ( (Is64BitOs () && (strcmp (szFiles[i], "AVeraCrypt-x64.exe") == 0))
|| (Is64BitOs () && (strcmp (szFiles[i], "AVeraCryptExpander-x64.exe") == 0))
|| (Is64BitOs () && (strcmp (szFiles[i], "AVeraCrypt Format-x64.exe") == 0))
|| (!Is64BitOs () && (strcmp (szFiles[i], "AVeraCrypt-x86.exe") == 0))
|| (!Is64BitOs () && (strcmp (szFiles[i], "AVeraCryptExpander-x86.exe") == 0))
|| (!Is64BitOs () && (strcmp (szFiles[i], "AVeraCrypt Format-x86.exe") == 0))
)
{
continue;
}
if (*szFiles[i] == 'A') if (*szFiles[i] == 'A')
StringCbCopyA (szDir, sizeof(szDir), szDestDir); StringCbCopyA (szDir, sizeof(szDir), szDestDir);
else if (*szFiles[i] == 'D') else if (*szFiles[i] == 'D')
@@ -699,18 +711,36 @@ BOOL DoFilesInstall (HWND hwndDlg, char *szDestDir)
StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCrypt-x64.exe", sizeof ("VeraCrypt-x64.exe")); StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCrypt-x64.exe", sizeof ("VeraCrypt-x64.exe"));
} }
if (Is64BitOs ()
&& strcmp (szFiles[i], "AVeraCrypt-x86.exe") == 0)
{
StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCrypt.exe", sizeof ("VeraCrypt.exe"));
}
if (Is64BitOs () if (Is64BitOs ()
&& strcmp (szFiles[i], "AVeraCryptExpander.exe") == 0) && strcmp (szFiles[i], "AVeraCryptExpander.exe") == 0)
{ {
StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCryptExpander-x64.exe", sizeof ("VeraCryptExpander-x64.exe")); StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCryptExpander-x64.exe", sizeof ("VeraCryptExpander-x64.exe"));
} }
if (Is64BitOs ()
&& strcmp (szFiles[i], "AVeraCryptExpander-x86.exe") == 0)
{
StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCryptExpander.exe", sizeof ("VeraCryptExpander.exe"));
}
if (Is64BitOs () if (Is64BitOs ()
&& strcmp (szFiles[i], "AVeraCrypt Format.exe") == 0) && strcmp (szFiles[i], "AVeraCrypt Format.exe") == 0)
{ {
StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCrypt Format-x64.exe", sizeof ("VeraCrypt Format-x64.exe")); StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCrypt Format-x64.exe", sizeof ("VeraCrypt Format-x64.exe"));
} }
if (Is64BitOs ()
&& strcmp (szFiles[i], "AVeraCrypt Format-x86.exe") == 0)
{
StringCbCopyNA (curFileName, sizeof(curFileName), "VeraCrypt Format.exe", sizeof ("VeraCrypt Format.exe"));
}
if (!bDevm) if (!bDevm)
{ {
bResult = FALSE; bResult = FALSE;

View File

@@ -28,6 +28,12 @@ static char *szFiles[]=
"AVeraCrypt.exe", "AVeraCrypt.exe",
"AVeraCryptExpander.exe", "AVeraCryptExpander.exe",
"AVeraCrypt Format.exe", "AVeraCrypt Format.exe",
"AVeraCrypt-x86.exe",
"AVeraCryptExpander-x86.exe",
"AVeraCrypt Format-x86.exe",
"AVeraCrypt-x64.exe",
"AVeraCryptExpander-x64.exe",
"AVeraCrypt Format-x64.exe",
"Averacrypt.sys", "Averacrypt.sys",
"Averacrypt-x64.sys", "Averacrypt-x64.sys",
"Dveracrypt.sys", "Dveracrypt.sys",