VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Setup.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-15 22:32:27 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-04-23 14:59:28 (GMT)
commit2dc39a7c7e085d77a5b3505b15fd00111a6fff5e (patch)
treed49daa73ab4a8094ca689497c881ed27ea9b1242 /src/Setup/Setup.c
parent0a737c8c87fded05a74cad5232c9c973b3037d61 (diff)
downloadVeraCrypt-2dc39a7c7e085d77a5b3505b15fd00111a6fff5e.zip
VeraCrypt-2dc39a7c7e085d77a5b3505b15fd00111a6fff5e.tar.gz
Windows: simplify installer logic by copying only binaries for the current architecture.
Diffstat (limited to 'src/Setup/Setup.c')
-rw-r--r--src/Setup/Setup.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c
index cedd9f6..5f2cea1 100644
--- a/src/Setup/Setup.c
+++ b/src/Setup/Setup.c
@@ -685,18 +685,6 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
continue; // Destination = target
}
- // skip files that don't apply to the current architecture
- if ( (Is64BitOs () && (wcscmp (szFiles[i], L"AVeraCrypt-x64.exe") == 0))
- || (Is64BitOs () && (wcscmp (szFiles[i], L"AVeraCryptExpander-x64.exe") == 0))
- || (Is64BitOs () && (wcscmp (szFiles[i], L"AVeraCrypt Format-x64.exe") == 0))
- || (!Is64BitOs () && (wcscmp (szFiles[i], L"AVeraCrypt-x86.exe") == 0))
- || (!Is64BitOs () && (wcscmp (szFiles[i], L"AVeraCryptExpander-x86.exe") == 0))
- || (!Is64BitOs () && (wcscmp (szFiles[i], L"AVeraCrypt Format-x86.exe") == 0))
- )
- {
- continue;
- }
-
if ((*szFiles[i] == L'A') || (*szFiles[i] == L'X'))
StringCbCopyW (szDir, sizeof(szDir), szDestDir);
else if (*szFiles[i] == L'D')
@@ -766,35 +754,17 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir)
}
if (Is64BitOs ()
- && wcscmp (szFiles[i], L"AVeraCrypt-x86.exe") == 0)
- {
- StringCbCopyNW (curFileName, sizeof(curFileName), L"VeraCrypt.exe", sizeof (L"VeraCrypt.exe"));
- }
-
- if (Is64BitOs ()
&& wcscmp (szFiles[i], L"AVeraCryptExpander.exe") == 0)
{
StringCbCopyNW (curFileName, sizeof(curFileName), L"VeraCryptExpander-x64.exe", sizeof (L"VeraCryptExpander-x64.exe"));
}
if (Is64BitOs ()
- && wcscmp (szFiles[i], L"AVeraCryptExpander-x86.exe") == 0)
- {
- StringCbCopyNW (curFileName, sizeof(curFileName), L"VeraCryptExpander.exe", sizeof (L"VeraCryptExpander.exe"));
- }
-
- if (Is64BitOs ()
&& wcscmp (szFiles[i], L"AVeraCrypt Format.exe") == 0)
{
StringCbCopyNW (curFileName, sizeof(curFileName), L"VeraCrypt Format-x64.exe", sizeof (L"VeraCrypt Format-x64.exe"));
}
- if (Is64BitOs ()
- && wcscmp (szFiles[i], L"AVeraCrypt Format-x86.exe") == 0)
- {
- StringCbCopyNW (curFileName, sizeof(curFileName), L"VeraCrypt Format.exe", sizeof (L"VeraCrypt Format.exe"));
- }
-
if (!bDevm)
{
bResult = FALSE;
@@ -1052,6 +1022,12 @@ err:
FindClose (h);
}
+ // remvove legacy files that are not needed anymore
+ for (i = 0; i < sizeof (szLegacyFiles) / sizeof (szLegacyFiles[0]); i++)
+ {
+ StatDeleteFile (szLegacyFiles [i], TRUE);
+ }
+
SetCurrentDirectory (SetupFilesDir);
}
@@ -2586,7 +2562,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz
{
if (IsSelfExtractingPackage())
{
- if (!VerifyPackageIntegrity())
+ if (!VerifySelfPackageIntegrity())
{
// Package corrupted
exit (1);