VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/SetupDLL
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2024-11-16 01:05:15 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2024-11-16 01:05:15 +0100
commitc86577fc0ed481f622793e66627058928ade02a9 (patch)
treee167dfbde1cd2c0fc138ccd83d04052b9136e7ac /src/SetupDLL
parent489d3e38732d2159d54485f05fe81bd3810019c8 (diff)
downloadVeraCrypt-c86577fc0ed481f622793e66627058928ade02a9.tar.gz
VeraCrypt-c86577fc0ed481f622793e66627058928ade02a9.zip
Windows: remove 32-bit logic from the code since we support only 64-bit. remove 32-bit EFI bootloader files.
We also fix intermediary files folder for Portable and Setup projects
Diffstat (limited to 'src/SetupDLL')
-rw-r--r--src/SetupDLL/Setup.c57
-rw-r--r--src/SetupDLL/Setup.h6
2 files changed, 24 insertions, 39 deletions
diff --git a/src/SetupDLL/Setup.c b/src/SetupDLL/Setup.c
index 4cbb11aa..195c9ec3 100644
--- a/src/SetupDLL/Setup.c
+++ b/src/SetupDLL/Setup.c
@@ -2499,16 +2499,14 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller)
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), L"VeraCrypt.exe");
- if (Is64BitOs ())
- EnableWow64FsRedirection (FALSE);
+ EnableWow64FsRedirection (FALSE);
wstring servicePath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", false);
wstring serviceLegacyPath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", true);
wstring favoritesFile = GetServiceConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES, false);
wstring favoritesLegacyFile = GetServiceConfigPath (TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES, true);
- if (Is64BitOs ()
- && FileExists (favoritesLegacyFile.c_str())
+ if (FileExists (favoritesLegacyFile.c_str())
&& !FileExists (favoritesFile.c_str()))
{
// copy the favorites XML file to the native system directory
@@ -2565,24 +2563,21 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller)
catch (...) {}
}
- if (Is64BitOs ())
+ // delete files from legacy path
+ if (FileExists (favoritesLegacyFile.c_str()))
{
- // delete files from legacy path
- if (FileExists (favoritesLegacyFile.c_str()))
- {
- MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostInstall: REMOVING %s", favoritesLegacyFile.c_str());
- ForceDeleteFile (favoritesLegacyFile.c_str());
- }
-
- if (FileExists (serviceLegacyPath.c_str()))
- {
- MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostInstall: REMOVING %s", serviceLegacyPath.c_str());
- ForceDeleteFile (serviceLegacyPath.c_str());
- }
+ MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostInstall: REMOVING %s", favoritesLegacyFile.c_str());
+ ForceDeleteFile (favoritesLegacyFile.c_str());
+ }
- EnableWow64FsRedirection (TRUE);
+ if (FileExists (serviceLegacyPath.c_str()))
+ {
+ MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostInstall: REMOVING %s", serviceLegacyPath.c_str());
+ ForceDeleteFile (serviceLegacyPath.c_str());
}
+ EnableWow64FsRedirection (TRUE);
+
if (bResult == FALSE)
{
LPVOID lpMsgBuf;
@@ -3223,8 +3218,7 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostUninstall(MSIHANDLE hInstaller)
// Last part of DoFilesInstall()
{
- if (Is64BitOs ())
- EnableWow64FsRedirection (FALSE);
+ EnableWow64FsRedirection (FALSE);
wstring servicePath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", false);
wstring serviceLegacyPath = GetServiceConfigPath (_T(TC_APP_NAME) L".exe", true);
@@ -3244,23 +3238,20 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostUninstall(MSIHANDLE hInstaller)
ForceDeleteFile (servicePath.c_str());
}
- if (Is64BitOs ())
+ if (FileExists (favoritesLegacyFile.c_str()))
{
- if (FileExists (favoritesLegacyFile.c_str()))
- {
- MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: REMOVING %s", favoritesLegacyFile.c_str());
- ForceDeleteFile (favoritesLegacyFile.c_str());
- }
-
- if (FileExists (serviceLegacyPath.c_str()))
- {
- MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: REMOVING %s", serviceLegacyPath.c_str());
- ForceDeleteFile (serviceLegacyPath.c_str());
- }
+ MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: REMOVING %s", favoritesLegacyFile.c_str());
+ ForceDeleteFile (favoritesLegacyFile.c_str());
+ }
- EnableWow64FsRedirection (TRUE);
+ if (FileExists (serviceLegacyPath.c_str()))
+ {
+ MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: REMOVING %s", serviceLegacyPath.c_str());
+ ForceDeleteFile (serviceLegacyPath.c_str());
}
+ EnableWow64FsRedirection (TRUE);
+
// remove the installation folder is case it remains after uninstall
if (DirectoryExists (szInstallDir.c_str()))
{
diff --git a/src/SetupDLL/Setup.h b/src/SetupDLL/Setup.h
index e38dd75a..603c3e63 100644
--- a/src/SetupDLL/Setup.h
+++ b/src/SetupDLL/Setup.h
@@ -42,9 +42,6 @@ static wchar_t *szCompressedFiles[]=
L"License.txt",
L"LICENSE",
L"NOTICE",
- L"VeraCrypt.exe",
- L"VeraCryptExpander.exe",
- L"VeraCrypt Format.exe",
L"VeraCrypt-x64.exe",
L"VeraCryptExpander-x64.exe",
L"VeraCrypt Format-x64.exe",
@@ -52,8 +49,6 @@ static wchar_t *szCompressedFiles[]=
L"VeraCryptExpander-arm64.exe",
L"VeraCrypt Format-arm64.exe",
L"veracrypt.inf",
- L"veracrypt.cat",
- L"veracrypt.sys",
L"veracrypt-x64.cat",
L"veracrypt-x64.sys",
L"veracrypt-arm64.cat",
@@ -74,7 +69,6 @@ static wchar_t *szLegacyFiles[]=
L"veracrypt-x64.sys",
};
-#define FILENAME_64BIT_DRIVER L"veracrypt-x64.sys"
#define NBR_COMPRESSED_FILES (sizeof(szCompressedFiles) / sizeof(szCompressedFiles[0]))
void localcleanup (void);