diff options
Diffstat (limited to 'src/SetupDLL')
-rw-r--r-- | src/SetupDLL/Dir.c | 106 | ||||
-rw-r--r-- | src/SetupDLL/Resource.h | 27 | ||||
-rw-r--r-- | src/SetupDLL/Setup.c | 460 | ||||
-rw-r--r-- | src/SetupDLL/Setup.rc | 35 | ||||
-rw-r--r-- | src/SetupDLL/SetupDLL.vcxproj | 6 | ||||
-rw-r--r-- | src/SetupDLL/SetupDLL_vs2019.vcxproj | 264 | ||||
-rw-r--r-- | src/SetupDLL/SetupDLL_vs2019.vcxproj.filters | 150 | ||||
-rw-r--r-- | src/SetupDLL/SetupDLL_vs2019.vcxproj.user | 3 |
8 files changed, 675 insertions, 376 deletions
diff --git a/src/SetupDLL/Dir.c b/src/SetupDLL/Dir.c index 3275567f..e6a5f153 100644 --- a/src/SetupDLL/Dir.c +++ b/src/SetupDLL/Dir.c @@ -65,58 +65,58 @@ mkfulldir (wchar_t *oriPath, BOOL bCheckonly) int -mkfulldir_internal (wchar_t *path) +mkfulldir_internal(wchar_t* path) { - wchar_t *token; - struct _stat st; - static wchar_t tokpath[_MAX_PATH]; - static wchar_t trail[_MAX_PATH]; - - if (wcslen(path) >= _MAX_PATH) - { - // directory name will be truncated so return failure to avoid unexepected behavior - return -1; - } - - StringCbCopyW (tokpath, _MAX_PATH, path); - trail[0] = L'\0'; - - token = wcstok (tokpath, L"\\/"); - - if (tokpath[0] == L'\\' && tokpath[1] == L'\\') - { /* unc */ - trail[0] = tokpath[0]; - trail[1] = tokpath[1]; - trail[2] = L'\0'; - if (token) - { - StringCbCatW (trail, _MAX_PATH, token); - StringCbCatW (trail, _MAX_PATH, L"\\"); - token = wcstok (NULL, L"\\/"); - if (token) - { /* get share name */ - StringCbCatW (trail, _MAX_PATH, token); - StringCbCatW (trail, _MAX_PATH, L"\\"); - } - token = wcstok (NULL, L"\\/"); - } - } - - if (tokpath[1] == L':') - { /* drive letter */ - StringCbCatW (trail, _MAX_PATH, tokpath); - StringCbCatW (trail, _MAX_PATH, L"\\"); - token = wcstok (NULL, L"\\/"); - } - - while (token != NULL) - { - int x; - StringCbCatW (trail, _MAX_PATH, token); - x = _wmkdir (trail); - StringCbCatW (trail, _MAX_PATH, L"\\"); - token = wcstok (NULL, L"\\/"); - } - - return _wstat (path, &st); + wchar_t* token; + wchar_t* next_token = NULL; + struct _stat st; + static wchar_t tokpath[_MAX_PATH]; + static wchar_t trail[_MAX_PATH]; + + if (wcslen(path) >= _MAX_PATH) + { + // directory name will be truncated so return failure to avoid unexpected behavior + return -1; + } + + StringCbCopyW(tokpath, _MAX_PATH, path); + trail[0] = L'\0'; + + token = wcstok_s(tokpath, L"\\/", &next_token); + if (tokpath[0] == L'\\' && tokpath[1] == L'\\') + { /* unc */ + trail[0] = tokpath[0]; + trail[1] = tokpath[1]; + trail[2] = L'\0'; + if (token) + { + StringCbCatW(trail, _MAX_PATH, token); + StringCbCatW(trail, _MAX_PATH, L"\\"); + token = wcstok_s(NULL, L"\\/", &next_token); + if (token) + { /* get share name */ + StringCbCatW(trail, _MAX_PATH, token); + StringCbCatW(trail, _MAX_PATH, L"\\"); + } + token = wcstok_s(NULL, L"\\/", &next_token); + } + } + + if (tokpath[1] == L':') + { /* drive letter */ + StringCbCatW(trail, _MAX_PATH, tokpath); + StringCbCatW(trail, _MAX_PATH, L"\\"); + token = wcstok_s(NULL, L"\\/", &next_token); + } + + while (token != NULL) + { + int x; + StringCbCatW(trail, _MAX_PATH, token); + x = _wmkdir(trail); + StringCbCatW(trail, _MAX_PATH, L"\\"); + token = wcstok_s(NULL, L"\\/", &next_token); + } + + return _wstat(path, &st); } diff --git a/src/SetupDLL/Resource.h b/src/SetupDLL/Resource.h index 8882d67b..62246068 100644 --- a/src/SetupDLL/Resource.h +++ b/src/SetupDLL/Resource.h @@ -17,6 +17,33 @@ #define IDR_LANG_VI 31 #define IDR_LANG_ZHCN 32 #define IDR_LANG_ZHHK 33 +#define IDR_LANG_BE 34 +#define IDR_LANG_BG 35 +#define IDR_LANG_CA 36 +#define IDR_LANG_CO 37 +#define IDR_LANG_DA 38 +#define IDR_LANG_EL 39 +#define IDR_LANG_ET 40 +#define IDR_LANG_EU 41 +#define IDR_LANG_FA 42 +#define IDR_LANG_FI 43 +#define IDR_LANG_HE 44 +#define IDR_LANG_HU 45 +#define IDR_LANG_ID 46 +#define IDR_LANG_KA 47 +#define IDR_LANG_KO 48 +#define IDR_LANG_LV 49 +#define IDR_LANG_NN 50 +#define IDR_LANG_PTBR 51 +#define IDR_LANG_SK 52 +#define IDR_LANG_SL 53 +#define IDR_LANG_SV 54 +#define IDR_LANG_TH 55 +#define IDR_LANG_TR 56 +#define IDR_LANG_UK 57 +#define IDR_LANG_UZ 58 +#define IDR_LANG_ZHTW 59 +#define IDR_LANG_NB 60 #define IDD_INSTALL 101 #define IDD_INSTALL_OPTIONS_PAGE_DLG 102 #define IDD_UNINSTALL 103 diff --git a/src/SetupDLL/Setup.c b/src/SetupDLL/Setup.c index 2afc7312..d0300c7e 100644 --- a/src/SetupDLL/Setup.c +++ b/src/SetupDLL/Setup.c @@ -68,108 +68,6 @@ typedef enum #define WAIT_PERIOD 3 -extern HMODULE hRichEditDll; -extern HMODULE hComctl32Dll; -extern HMODULE hSetupDll; -extern HMODULE hShlwapiDll; -extern HMODULE hProfApiDll; -extern HMODULE hUsp10Dll; -extern HMODULE hCryptSpDll; -extern HMODULE hUXThemeDll; -extern HMODULE hUserenvDll; -extern HMODULE hRsaenhDll; -extern HMODULE himm32dll; -extern HMODULE hMSCTFdll; -extern HMODULE hfltlibdll; -extern HMODULE hframedyndll; -extern HMODULE hpsapidll; -extern HMODULE hsecur32dll; -extern HMODULE hnetapi32dll; -extern HMODULE hauthzdll; -extern HMODULE hxmllitedll; -extern HMODULE hmprdll; -extern HMODULE hsppdll; -extern HMODULE vssapidll; -extern HMODULE hvsstracedll; -extern HMODULE hcfgmgr32dll; -extern HMODULE hdevobjdll; -extern HMODULE hpowrprofdll; -extern HMODULE hsspiclidll; -extern HMODULE hcryptbasedll; -extern HMODULE hdwmapidll; -extern HMODULE hmsasn1dll; -extern HMODULE hcrypt32dll; -extern HMODULE hbcryptdll; -extern HMODULE hbcryptprimitivesdll; -extern HMODULE hMsls31; -extern HMODULE hntmartadll; -extern HMODULE hwinscarddll; -extern HMODULE hmsvcrtdll; -extern HMODULE hWinTrustLib; -extern HMODULE hAdvapi32Dll; - -#define FREE_DLL(h) if (h) { FreeLibrary (h); h = NULL;} - -#ifndef BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE -#define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x00000001 -#endif - -#ifndef BASE_SEARCH_PATH_PERMANENT -#define BASE_SEARCH_PATH_PERMANENT 0x00008000 -#endif - -#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32 -#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 -#endif - -typedef BOOL (WINAPI *SetDllDirectoryPtr)(LPCWSTR lpPathName); -typedef BOOL (WINAPI *SetSearchPathModePtr)(DWORD Flags); -typedef BOOL (WINAPI *SetDefaultDllDirectoriesPtr)(DWORD DirectoryFlags); - -typedef void (WINAPI *InitCommonControlsPtr)(void); -typedef HIMAGELIST (WINAPI *ImageList_CreatePtr)(int cx, int cy, UINT flags, int cInitial, int cGrow); -typedef int (WINAPI *ImageList_AddPtr)(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask); - -typedef VOID (WINAPI *SetupCloseInfFilePtr)(HINF InfHandle); -typedef HKEY (WINAPI *SetupDiOpenClassRegKeyPtr)(CONST GUID *ClassGuid,REGSAM samDesired); -typedef BOOL (WINAPI *SetupInstallFromInfSectionWPtr)(HWND,HINF,PCWSTR,UINT,HKEY,PCWSTR,UINT,PSP_FILE_CALLBACK_W,PVOID,HDEVINFO,PSP_DEVINFO_DATA); -typedef HINF (WINAPI *SetupOpenInfFileWPtr)(PCWSTR FileName,PCWSTR InfClass,DWORD InfStyle,PUINT ErrorLine); - -typedef LSTATUS (STDAPICALLTYPE *SHDeleteKeyWPtr)(HKEY hkey, LPCWSTR pszSubKey); - -typedef HRESULT (STDAPICALLTYPE *SHStrDupWPtr)(LPCWSTR psz, LPWSTR *ppwsz); - -// ChangeWindowMessageFilter -typedef BOOL (WINAPI *ChangeWindowMessageFilterPtr) (UINT, DWORD); - -typedef BOOL (WINAPI *CreateProcessWithTokenWFn)( - __in HANDLE hToken, - __in DWORD dwLogonFlags, - __in_opt LPCWSTR lpApplicationName, - __inout_opt LPWSTR lpCommandLine, - __in DWORD dwCreationFlags, - __in_opt LPVOID lpEnvironment, - __in_opt LPCWSTR lpCurrentDirectory, - __in LPSTARTUPINFOW lpStartupInfo, - __out LPPROCESS_INFORMATION lpProcessInformation - ); - -extern SetDllDirectoryPtr SetDllDirectoryFn; -extern SetSearchPathModePtr SetSearchPathModeFn; -extern SetDefaultDllDirectoriesPtr SetDefaultDllDirectoriesFn; - -extern ImageList_CreatePtr ImageList_CreateFn; -extern ImageList_AddPtr ImageList_AddFn; - -extern SetupCloseInfFilePtr SetupCloseInfFileFn; -extern SetupDiOpenClassRegKeyPtr SetupDiOpenClassRegKeyFn; -extern SetupInstallFromInfSectionWPtr SetupInstallFromInfSectionWFn; -extern SetupOpenInfFileWPtr SetupOpenInfFileWFn; -extern SHDeleteKeyWPtr SHDeleteKeyWFn; -extern SHStrDupWPtr SHStrDupWFn; -extern ChangeWindowMessageFilterPtr ChangeWindowMessageFilterFn; -extern CreateProcessWithTokenWFn CreateProcessWithTokenWPtr; - wchar_t InstallationPath[TC_MAX_PATH]; BOOL bUninstall = FALSE; @@ -328,10 +226,6 @@ void DetermineUpgradeDowngradeStatus (BOOL bCloseDriverHandle, LONG *driverVersi DWORD dwResult; BOOL bResult = DeviceIoControl (hDriver, TC_IOCTL_GET_DRIVER_VERSION, NULL, 0, &driverVersion, sizeof (driverVersion), &dwResult, NULL); - if (!bResult) - bResult = DeviceIoControl (hDriver, TC_IOCTL_LEGACY_GET_DRIVER_VERSION, NULL, 0, &driverVersion, sizeof (driverVersion), &dwResult, NULL); - - bUpgrade = (bResult && driverVersion <= VERSION_NUM); bDowngrade = (bResult && driverVersion > VERSION_NUM); bReinstallMode = (bResult && driverVersion == VERSION_NUM); @@ -360,26 +254,13 @@ BOOL IsSystemRestoreEnabled () GetRestorePointRegKeyName (szRegPath, sizeof (szRegPath)); if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, szRegPath, 0, KEY_READ | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) { - if (IsOSAtLeast (WIN_VISTA)) - { - if ( (ERROR_SUCCESS == RegQueryValueEx (hKey, L"RPSessionInterval", NULL, NULL, (LPBYTE) &dwValue, &cbValue)) - && (dwValue == 1) - ) - { - bEnabled = TRUE; - } - } - else + if ( (ERROR_SUCCESS == RegQueryValueEx (hKey, L"RPSessionInterval", NULL, NULL, (LPBYTE) &dwValue, &cbValue)) + && (dwValue == 1) + ) { - if ( (ERROR_SUCCESS == RegQueryValueEx (hKey, L"DisableSR", NULL, NULL, (LPBYTE) &dwValue, &cbValue)) - && (dwValue == 0) - ) - { - bEnabled = TRUE; - } + bEnabled = TRUE; } - RegCloseKey (hKey); } @@ -988,8 +869,6 @@ void HandleDriveNotReadyError_Dll (MSIHANDLE hInstaller) { MSILogAndShow (hInstaller, MSI_WARNING_LEVEL, GetString("SYS_AUTOMOUNT_DISABLED")); } - else if (nCurrentOS == WIN_VISTA && CurrentOSServicePack < 1) - MSILogAndShow (hInstaller, MSI_WARNING_LEVEL, GetString("SYS_ASSIGN_DRIVE_LETTER")); else MSILogAndShow (hInstaller, MSI_WARNING_LEVEL, GetString("DEVICE_NOT_READY_ERROR")); @@ -1155,11 +1034,6 @@ void handleError_Dll (MSIHANDLE hInstaller, int code, const char* srcPos) // A non-error break; - case ERR_UNSUPPORTED_TRUECRYPT_FORMAT: - StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("UNSUPPORTED_TRUECRYPT_FORMAT"), (code >> 24), (code >> 16) & 0x000000FF); - MSILogAndShow (hInstaller, MSI_ERROR_LEVEL, AppendSrcPos (szTmp, srcPos).c_str()); - break; - default: StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("ERR_UNKNOWN"), code); MSILogAndShow (hInstaller, MSI_ERROR_LEVEL, AppendSrcPos (szTmp, srcPos).c_str()); @@ -1505,7 +1379,6 @@ BOOL DoDriverUnload_Dll (MSIHANDLE hInstaller, HWND hwnd) if (hDriver != INVALID_HANDLE_VALUE) { - MOUNT_LIST_STRUCT driver; LONG driverVersion = VERSION_NUM; int refCount; DWORD dwResult; @@ -1592,13 +1465,6 @@ BOOL DoDriverUnload_Dll (MSIHANDLE hInstaller, HWND hwnd) // Check mounted volumes bResult = DeviceIoControl (hDriver, TC_IOCTL_IS_ANY_VOLUME_MOUNTED, NULL, 0, &volumesMounted, sizeof (volumesMounted), &dwResult, NULL); - if (!bResult) - { - bResult = DeviceIoControl (hDriver, TC_IOCTL_LEGACY_GET_MOUNTED_VOLUMES, NULL, 0, &driver, sizeof (driver), &dwResult, NULL); - if (bResult) - volumesMounted = driver.ulMountedDrives; - } - if (bResult) { if (volumesMounted != 0) @@ -1836,7 +1702,7 @@ BOOL DoRegUninstall_Dll (MSIHANDLE hInstaller, BOOL bRemoveDeprecated) } // Unregister COM servers - if (!bRemoveDeprecated && IsOSAtLeast (WIN_VISTA)) + if (!bRemoveDeprecated) { if (!UnregisterComServers (InstallationPath)) MSILog (hInstaller, MSI_ERROR_LEVEL, GetString("COM_DEREG_FAILED")); @@ -2123,141 +1989,12 @@ BOOL InitDll (MSIHANDLE hInstaller) MSILog(hInstaller, MSI_INFO_LEVEL, L"Begin InitDll"); BOOL bOK = TRUE; - InitCommonControlsPtr InitCommonControlsFn = NULL; - - /* remove current directory from dll search path */ - SetDllDirectoryFn = (SetDllDirectoryPtr) GetProcAddress (GetModuleHandle(L"kernel32.dll"), "SetDllDirectoryW"); - SetSearchPathModeFn = (SetSearchPathModePtr) GetProcAddress (GetModuleHandle(L"kernel32.dll"), "SetSearchPathMode"); - SetDefaultDllDirectoriesFn = (SetDefaultDllDirectoriesPtr) GetProcAddress (GetModuleHandle(L"kernel32.dll"), "SetDefaultDllDirectories"); - if (SetDllDirectoryFn) - SetDllDirectoryFn (L""); - if (SetSearchPathModeFn) - SetSearchPathModeFn (BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT); - if (SetDefaultDllDirectoriesFn) - SetDefaultDllDirectoriesFn (LOAD_LIBRARY_SEARCH_SYSTEM32); InitOSVersionInfo(); InitGlobalLocks (); - LoadSystemDll_Dll (hInstaller, L"msvcrt.dll", &hmsvcrtdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"ntmarta.dll", &hntmartadll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"MPR.DLL", &hmprdll, TRUE, SRC_POS); - if (IsOSAtLeast (WIN_7)) - { - LoadSystemDll_Dll (hInstaller, L"ProfApi.DLL", &hProfApiDll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"cryptbase.dll", &hcryptbasedll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"sspicli.dll", &hsspiclidll, TRUE, SRC_POS); - } - LoadSystemDll_Dll (hInstaller, L"psapi.dll", &hpsapidll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"secur32.dll", &hsecur32dll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"msasn1.dll", &hmsasn1dll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"Usp10.DLL", &hUsp10Dll, TRUE, SRC_POS); - if (IsOSAtLeast (WIN_7)) - LoadSystemDll_Dll (hInstaller, L"dwmapi.dll", &hdwmapidll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"UXTheme.dll", &hUXThemeDll, TRUE, SRC_POS); - - LoadSystemDll_Dll (hInstaller, L"msls31.dll", &hMsls31, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"SETUPAPI.DLL", &hSetupDll, FALSE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"SHLWAPI.DLL", &hShlwapiDll, FALSE, SRC_POS); - - LoadSystemDll_Dll (hInstaller, L"userenv.dll", &hUserenvDll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"rsaenh.dll", &hRsaenhDll, TRUE, SRC_POS); - - if (nCurrentOS < WIN_7) - { - if (nCurrentOS == WIN_XP) - { - LoadSystemDll_Dll (hInstaller, L"imm32.dll", &himm32dll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"MSCTF.dll", &hMSCTFdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"fltlib.dll", &hfltlibdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"wbem\\framedyn.dll", &hframedyndll, TRUE, SRC_POS); - } - - if (IsOSAtLeast (WIN_VISTA)) - { - LoadSystemDll_Dll (hInstaller, L"netapi32.dll", &hnetapi32dll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"authz.dll", &hauthzdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"xmllite.dll", &hxmllitedll, TRUE, SRC_POS); - } - } - - if (IsOSAtLeast (WIN_VISTA)) - { - LoadSystemDll_Dll (hInstaller, L"atl.dll", &hsppdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"vsstrace.dll", &hvsstracedll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"vssapi.dll", &vssapidll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"spp.dll", &hsppdll, TRUE, SRC_POS); - } - - LoadSystemDll_Dll (hInstaller, L"crypt32.dll", &hcrypt32dll, TRUE, SRC_POS); - - if (IsOSAtLeast (WIN_7)) - { - LoadSystemDll_Dll (hInstaller, L"CryptSP.dll", &hCryptSpDll, TRUE, SRC_POS); - - LoadSystemDll_Dll (hInstaller, L"cfgmgr32.dll", &hcfgmgr32dll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"devobj.dll", &hdevobjdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"powrprof.dll", &hpowrprofdll, TRUE, SRC_POS); - - LoadSystemDll_Dll (hInstaller, L"bcrypt.dll", &hbcryptdll, TRUE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"bcryptprimitives.dll", &hbcryptprimitivesdll, TRUE, SRC_POS); - } - - LoadSystemDll_Dll (hInstaller, L"COMCTL32.DLL", &hComctl32Dll, FALSE, SRC_POS); - - // call InitCommonControls function - InitCommonControlsFn = (InitCommonControlsPtr) GetProcAddress (hComctl32Dll, "InitCommonControls"); - ImageList_AddFn = (ImageList_AddPtr) GetProcAddress (hComctl32Dll, "ImageList_Add"); - ImageList_CreateFn = (ImageList_CreatePtr) GetProcAddress (hComctl32Dll, "ImageList_Create"); - - if (InitCommonControlsFn && ImageList_AddFn && ImageList_CreateFn) - { - InitCommonControlsFn(); - } - else - { - MSILog(hInstaller, MSI_ERROR_LEVEL, GetString("INIT_DLL")); - bOK = FALSE; - goto end; - } - - LoadSystemDll_Dll (hInstaller, L"Riched20.dll", &hRichEditDll, FALSE, SRC_POS); - LoadSystemDll_Dll (hInstaller, L"Advapi32.dll", &hAdvapi32Dll, FALSE, SRC_POS); - - // Get SetupAPI functions pointers - SetupCloseInfFileFn = (SetupCloseInfFilePtr) GetProcAddress (hSetupDll, "SetupCloseInfFile"); - SetupDiOpenClassRegKeyFn = (SetupDiOpenClassRegKeyPtr) GetProcAddress (hSetupDll, "SetupDiOpenClassRegKey"); - SetupInstallFromInfSectionWFn = (SetupInstallFromInfSectionWPtr) GetProcAddress (hSetupDll, "SetupInstallFromInfSectionW"); - SetupOpenInfFileWFn = (SetupOpenInfFileWPtr) GetProcAddress (hSetupDll, "SetupOpenInfFileW"); - - if (!SetupCloseInfFileFn || !SetupDiOpenClassRegKeyFn || !SetupInstallFromInfSectionWFn || !SetupOpenInfFileWFn) - { - MSILog(hInstaller, MSI_ERROR_LEVEL, GetString("INIT_DLL")); - bOK = FALSE; - goto end; - } - - // Get SHDeleteKeyW function pointer - SHDeleteKeyWFn = (SHDeleteKeyWPtr) GetProcAddress (hShlwapiDll, "SHDeleteKeyW"); - SHStrDupWFn = (SHStrDupWPtr) GetProcAddress (hShlwapiDll, "SHStrDupW"); - if (!SHDeleteKeyWFn || !SHStrDupWFn) - { - MSILog(hInstaller, MSI_ERROR_LEVEL, GetString("INIT_DLL")); - bOK = FALSE; - goto end; - } - - if (IsOSAtLeast (WIN_VISTA)) - { - /* Get ChangeWindowMessageFilter used to enable some messages bypasss UIPI (User Interface Privilege Isolation) */ - ChangeWindowMessageFilterFn = (ChangeWindowMessageFilterPtr) GetProcAddress (GetModuleHandle (L"user32.dll"), "ChangeWindowMessageFilter"); - } - - // Get CreateProcessWithTokenW function pointer - CreateProcessWithTokenWPtr = (CreateProcessWithTokenWFn) GetProcAddress(hAdvapi32Dll, "CreateProcessWithTokenW"); - SetErrorMode (SetErrorMode (0) | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - CoInitialize (NULL); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); // Force language to english to read strings from the default Language.xml embedded in the DLL. SetPreferredLangId ("en"); @@ -2268,7 +2005,6 @@ BOOL InitDll (MSIHANDLE hInstaller) _set_invalid_parameter_handler (InvalidParameterHandler); RemoteSession = GetSystemMetrics (SM_REMOTESESSION) != 0; -end: MSILog(hInstaller, MSI_INFO_LEVEL, L"End InitDll"); return bOK; } @@ -2382,46 +2118,6 @@ void VC_CustomAction_Cleanup () FinalizeGlobalLocks (); - FREE_DLL (hRichEditDll); - FREE_DLL (hComctl32Dll); - FREE_DLL (hSetupDll); - FREE_DLL (hShlwapiDll); - FREE_DLL (hProfApiDll); - FREE_DLL (hUsp10Dll); - FREE_DLL (hCryptSpDll); - FREE_DLL (hUXThemeDll); - FREE_DLL (hUserenvDll); - FREE_DLL (hRsaenhDll); - FREE_DLL (himm32dll); - FREE_DLL (hMSCTFdll); - FREE_DLL (hfltlibdll); - FREE_DLL (hframedyndll); - FREE_DLL (hpsapidll); - FREE_DLL (hsecur32dll); - FREE_DLL (hnetapi32dll); - FREE_DLL (hauthzdll); - FREE_DLL (hxmllitedll); - FREE_DLL (hmprdll); - FREE_DLL (hsppdll); - FREE_DLL (vssapidll); - FREE_DLL (hvsstracedll); - FREE_DLL (hCryptSpDll); - FREE_DLL (hcfgmgr32dll); - FREE_DLL (hdevobjdll); - FREE_DLL (hpowrprofdll); - FREE_DLL (hsspiclidll); - FREE_DLL (hcryptbasedll); - FREE_DLL (hdwmapidll); - FREE_DLL (hmsasn1dll); - FREE_DLL (hcrypt32dll); - FREE_DLL (hbcryptdll); - FREE_DLL (hbcryptprimitivesdll); - FREE_DLL (hMsls31); - FREE_DLL (hntmartadll); - FREE_DLL (hwinscarddll); - FREE_DLL (hmsvcrtdll); - FREE_DLL (hAdvapi32Dll); - //MSILog(hInstaller, MSI_INFO_LEVEL, L"End VC_CustomAction_Cleanup"); } @@ -2640,6 +2336,38 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller) UINT uiRet = ERROR_INSTALL_FAILURE; BOOL bOK = TRUE; WCHAR szCurrentDir[MAX_PATH]; + const wchar_t* oldFileNames[] = { + L"docs\\html\\en\\AddNewSystemVar.jpg", + L"docs\\html\\en\\CertificateCannotBeVerified.jpg", + L"docs\\html\\en\\CertVerifyFails.jpg", + L"docs\\html\\en\\DistributionPackageDamaged.jpg", + L"docs\\html\\en\\DownloadVS2010.jpg", + L"docs\\html\\en\\DownloadVS2019.jpg", + L"docs\\html\\en\\DownloadVSBuildTools.jpg", + L"docs\\html\\en\\gzipCommandLine.jpg", + L"docs\\html\\en\\NasmCommandLine.jpg", + L"docs\\html\\en\\RegeditPermissions-1.jpg", + L"docs\\html\\en\\RegeditPermissions-2.jpg", + L"docs\\html\\en\\RegeditPermissions-3.jpg", + L"docs\\html\\en\\RegeditPermissions-4.jpg", + L"docs\\html\\en\\SelectAdvancedSystemSettings.jpg", + L"docs\\html\\en\\SelectEnvironmentVariables.jpg", + L"docs\\html\\en\\SelectPathVariable.jpg", + L"docs\\html\\en\\SelectThisPC.jpg", + L"docs\\html\\en\\upxCommandLine.jpg", + L"docs\\html\\en\\VS2010BuildSolution.jpg", + L"docs\\html\\en\\VS2010Win32Config.jpg", + L"docs\\html\\en\\VS2010X64Config.jpg", + L"docs\\html\\en\\VS2019ARM64Config.jpg", + L"docs\\html\\en\\VS2019BuildSolution.jpg", + L"docs\\html\\en\\YasmCommandLine.jpg", + L"docs\\html\\en\\BCH_Logo_48x30.png", + L"docs\\html\\en\\LinuxPrepAndBuild.sh", + L"docs\\html\\en\\LinuxPrepAndBuild.zip", + L"docs\\html\\en\\RIPEMD-160.html", + L"docs\\html\\en\\ru\\BCH_Logo_48x30.png", + L"Languages\\Language.ru - Copy.xml", + }; MSILog(hInstaller, MSI_INFO_LEVEL, L"Begin VC_CustomAction_PostInstall"); @@ -2750,6 +2478,7 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller) WIN32_FIND_DATA f; HANDLE h; wchar_t szTmp[TC_MAX_PATH]; + size_t i; // delete "VeraCrypt Setup.exe" if it exists StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), L"VeraCrypt Setup.exe"); @@ -2758,6 +2487,16 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller) ForceDeleteFile(szTmp); } + // delete files wrongly installed by previous versions in installation folder + for (i = 0; i < ARRAYSIZE(oldFileNames); i++) + { + StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), oldFileNames[i]); + if (FileExists(szTmp)) + { + ForceDeleteFile(szTmp); + } + } + StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), L"VeraCrypt.exe"); if (Is64BitOs ()) @@ -2927,13 +2666,10 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller) // Last part of DoRegInstall() { // Register COM servers for UAC - if (IsOSAtLeast (WIN_VISTA)) + if (!RegisterComServers ((wchar_t*)szInstallDir.c_str())) { - if (!RegisterComServers ((wchar_t*)szInstallDir.c_str())) - { - MSILogAndShow (hInstaller, MSI_ERROR_LEVEL, GetString("COM_REG_FAILED")); - goto end; - } + MSILogAndShow (hInstaller, MSI_ERROR_LEVEL, GetString("COM_REG_FAILED")); + goto end; } } @@ -3284,6 +3020,70 @@ end: return uiRet; } +static BOOL DirectoryExists (const wchar_t *dirName) +{ + DWORD attrib = GetFileAttributes (dirName); + return (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY)); +} + +static BOOL DeleteContentsOnReboot(LPCTSTR pszDir) { + TCHAR szPath[MAX_PATH]; + TCHAR szSubPath[MAX_PATH]; + WIN32_FIND_DATA FindFileData; + HANDLE hFind; + BOOL bHasBackslash = FALSE; + // check if pszDir ends with a backslash + if (pszDir[_tcslen(pszDir) - 1] == '\\') + { + bHasBackslash = TRUE; + } + + // Prepare the path for FindFirstFile + if (bHasBackslash) + StringCchPrintf(szPath, MAX_PATH, TEXT("%s*"), pszDir); + else + StringCchPrintf(szPath, MAX_PATH, TEXT("%s\\*"), pszDir); + + hFind = FindFirstFile(szPath, &FindFileData); + if (hFind == INVALID_HANDLE_VALUE) { + return FALSE; + } + + BOOL result = TRUE; + + do { + if (_tcscmp(FindFileData.cFileName, TEXT(".")) != 0 && + _tcscmp(FindFileData.cFileName, TEXT("..")) != 0) { + + if (bHasBackslash) + StringCchPrintf(szSubPath, MAX_PATH, TEXT("%s%s"), pszDir, FindFileData.cFileName); + else + StringCchPrintf(szSubPath, MAX_PATH, TEXT("%s\\%s"), pszDir, FindFileData.cFileName); + + if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + // Recursive call to handle subdirectories + if (!DeleteContentsOnReboot(szSubPath)) { + result = FALSE; // Track failures but attempt to continue + } + } else { + // Schedule the file for deletion + if (!MoveFileEx(szSubPath, NULL, MOVEFILE_DELAY_UNTIL_REBOOT)) { + result = FALSE; // Track failures + } + } + } + } while (FindNextFile(hFind, &FindFileData) != 0); + + FindClose(hFind); + + // Schedule the root directory for deletion, only if not done already + if (!MoveFileEx(pszDir, NULL, MOVEFILE_DELAY_UNTIL_REBOOT)) { + result = FALSE; + } + + return result; +} + /* * Same as Setup.c, function DoUninstall(), but * without the actual installation, it only performs @@ -3460,6 +3260,33 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostUninstall(MSIHANDLE hInstaller) EnableWow64FsRedirection (TRUE); } + + // remove the installation folder is case it remains after uninstall + if (DirectoryExists (szInstallDir.c_str())) + { + MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: REMOVING %s", szInstallDir.c_str()); + if(DeleteDirectory (szInstallDir.c_str())) + { + MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: %s removed", szInstallDir.c_str()); + } + else + { + MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: %s could not be removed. Scheduling removal on reboot", szInstallDir.c_str()); + if (DeleteContentsOnReboot(szInstallDir.c_str())) + { + bRestartRequired = TRUE; + MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: %s scheduled for removal on reboot", szInstallDir.c_str()); + } + else + { + MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: %s could not be scheduled for removal on reboot", szInstallDir.c_str()); + } + } + } + else + { + MSILog(hInstaller, MSI_ERROR_LEVEL, L"VC_CustomAction_PostUninstall: %s does not exist", szInstallDir.c_str()); + } } if (bSystemRestore && !bTempSkipSysRestore) @@ -3663,6 +3490,7 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_DoChecks(MSIHANDLE hInstaller) if (bDisableReboot) { MSILog(hInstaller, MSI_INFO_LEVEL, L"VC_CustomAction_DoChecks: reboot is required but it is disabled because \"REBOOT\" specifies ReallySuppress"); + uiRet = ERROR_SUCCESS; } else { diff --git a/src/SetupDLL/Setup.rc b/src/SetupDLL/Setup.rc index 501f820f..5d260186 100644 --- a/src/SetupDLL/Setup.rc +++ b/src/SetupDLL/Setup.rc @@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,0,0 - PRODUCTVERSION 1,26,0,0 + FILEVERSION 1,26,15,0 + PRODUCTVERSION 1,26,15,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -46,11 +46,11 @@ BEGIN BEGIN VALUE "CompanyName", "IDRIX" VALUE "FileDescription", "VeraCryptSetup" - VALUE "FileVersion", "1.26" + VALUE "FileVersion", "1.26.15" VALUE "LegalTrademarks", "VeraCrypt" VALUE "OriginalFilename", "VeraCryptSetup.dll" VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26" + VALUE "ProductVersion", "1.26.15" END END BLOCK "VarFileInfo" @@ -93,6 +93,33 @@ IDR_LANG_RU LANGUAGES "..\\..\\Translations\\Language. IDR_LANG_VI LANGUAGES "..\\..\\Translations\\Language.vi.xml" IDR_LANG_ZHCN LANGUAGES "..\\..\\Translations\\Language.zh-cn.xml" IDR_LANG_ZHHK LANGUAGES "..\\..\\Translations\\Language.zh-hk.xml" +IDR_LANG_BE LANGUAGES "..\\..\\Translations\\Language.be.xml" +IDR_LANG_BG LANGUAGES "..\\..\\Translations\\Language.bg.xml" +IDR_LANG_CA LANGUAGES "..\\..\\Translations\\Language.ca.xml" +IDR_LANG_CO LANGUAGES "..\\..\\Translations\\Language.co.xml" +IDR_LANG_DA LANGUAGES "..\\..\\Translations\\Language.da.xml" +IDR_LANG_EL LANGUAGES "..\\..\\Translations\\Language.el.xml" +IDR_LANG_ET LANGUAGES "..\\..\\Translations\\Language.et.xml" +IDR_LANG_EU LANGUAGES "..\\..\\Translations\\Language.eu.xml" +IDR_LANG_FA LANGUAGES "..\\..\\Translations\\Language.fa.xml" +IDR_LANG_FI LANGUAGES "..\\..\\Translations\\Language.fi.xml" +IDR_LANG_HE LANGUAGES "..\\..\\Translations\\Language.he.xml" +IDR_LANG_HU LANGUAGES "..\\..\\Translations\\Language.hu.xml" +IDR_LANG_ID LANGUAGES "..\\..\\Translations\\Language.id.xml" +IDR_LANG_KA LANGUAGES "..\\..\\Translations\\Language.ka.xml" +IDR_LANG_KO LANGUAGES "..\\..\\Translations\\Language.ko.xml" +IDR_LANG_LV LANGUAGES "..\\..\\Translations\\Language.lv.xml" +IDR_LANG_NB LANGUAGES "..\\..\\Translations\\Language.nb.xml" +IDR_LANG_NN LANGUAGES "..\\..\\Translations\\Language.nn.xml" +IDR_LANG_PTBR LANGUAGES "..\\..\\Translations\\Language.pt-br.xml" +IDR_LANG_SK LANGUAGES "..\\..\\Translations\\Language.sk.xml" +IDR_LANG_SL LANGUAGES "..\\..\\Translations\\Language.sl.xml" +IDR_LANG_SV LANGUAGES "..\\..\\Translations\\Language.sv.xml" +IDR_LANG_TH LANGUAGES "..\\..\\Translations\\Language.th.xml" +IDR_LANG_TR LANGUAGES "..\\..\\Translations\\Language.tr.xml" +IDR_LANG_UK LANGUAGES "..\\..\\Translations\\Language.uk.xml" +IDR_LANG_UZ LANGUAGES "..\\..\\Translations\\Language.uz.xml" +IDR_LANG_ZHTW LANGUAGES "..\\..\\Translations\\Language.zh-tw.xml" ///////////////////////////////////////////////////////////////////////////// // diff --git a/src/SetupDLL/SetupDLL.vcxproj b/src/SetupDLL/SetupDLL.vcxproj index 74f86276..7eb24a66 100644 --- a/src/SetupDLL/SetupDLL.vcxproj +++ b/src/SetupDLL/SetupDLL.vcxproj @@ -91,7 +91,7 @@ <AdditionalDependencies>version.lib;msi.lib;libcmtd.lib;atlsd.lib;mpr.lib;..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;..\Common\Debug\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptSetup.dll</OutputFile> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;comdlg32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <GenerateDebugInformation>true</GenerateDebugInformation> <ProgramDatabaseFile>$(OutDir)Setup.pdb</ProgramDatabaseFile> <SubSystem>Windows</SubSystem> @@ -130,7 +130,7 @@ copy Debug\VeraCryptSetup.dll "..\Debug\Setup Files\VeraCryptSetup.dll" >NUL: <AdditionalDependencies>version.lib;msi.lib;mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptSetup.dll</OutputFile> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;comdlg32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <GenerateDebugInformation>true</GenerateDebugInformation> <GenerateMapFile>true</GenerateMapFile> <SubSystem>Windows</SubSystem> @@ -169,7 +169,7 @@ copy Debug\VeraCryptSetup.dll "..\Debug\Setup Files\VeraCryptSetup.dll" >NUL: <AdditionalDependencies>version.lib;msi.lib;mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptSetup.exe</OutputFile> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;comdlg32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <GenerateDebugInformation>true</GenerateDebugInformation> <GenerateMapFile>true</GenerateMapFile> <SubSystem>Windows</SubSystem> diff --git a/src/SetupDLL/SetupDLL_vs2019.vcxproj b/src/SetupDLL/SetupDLL_vs2019.vcxproj new file mode 100644 index 00000000..a7c2703c --- /dev/null +++ b/src/SetupDLL/SetupDLL_vs2019.vcxproj @@ -0,0 +1,264 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="ReleaseCustomEFI|Win32"> + <Configuration>ReleaseCustomEFI</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{ADD324E2-ADC8-402E-87EB-03E4E26B1B49}</ProjectGuid> + <RootNamespace>Setup</RootNamespace> + <Keyword>Win32Proj</Keyword> + <ProjectName>SetupDLL</ProjectName> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)Debug\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)Debug\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest> + <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</EmbedManifest> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)Release\</OutDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">$(ProjectDir)Release\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)Release\</IntDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">$(ProjectDir)Release\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">false</LinkIncremental> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest> + <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">true</GenerateManifest> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">VeraCryptSetup</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">VeraCryptSetup</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">VeraCryptSetup</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>SETUP;SETUP_DLL;WIN32;HAVE_CONFIG_H;ZIP_STATIC;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <DisableSpecificWarnings>4057;4100;4127;4201;4505;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <AdditionalOptions>/NODEFAULTLIB:LIBCMTD %(AdditionalOptions)</AdditionalOptions> + <AdditionalDependencies>version.lib;msi.lib;libcmtd.lib;atls.lib;mpr.lib;..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;..\Common\Debug\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptSetup.dll</OutputFile> + <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> + <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;comdlg32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(OutDir)Setup.pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX86</TargetMachine> + <ModuleDefinitionFile>SetupDLL.def</ModuleDefinitionFile> + <GenerateMapFile>true</GenerateMapFile> + </Link> + <Manifest> + <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>md "..\Debug\Setup Files" 2>NUL: +copy Debug\VeraCryptSetup.dll "..\Debug\Setup Files\VeraCryptSetup.dll" >NUL: +</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> + <Optimization>MaxSpeed</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>SETUP;SETUP_DLL;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <AssemblerOutput>All</AssemblerOutput> + <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4995;4057;4100;4127;4201;4505;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <ControlFlowGuard>Guard</ControlFlowGuard> + </ClCompile> + <Link> + <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> + <AdditionalDependencies>version.lib;atls.lib;msi.lib;mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptSetup.dll</OutputFile> + <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> + <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;comdlg32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <GenerateMapFile>true</GenerateMapFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>true</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX86</TargetMachine> + <ModuleDefinitionFile>SetupDLL.def</ModuleDefinitionFile> + </Link> + <Manifest> + <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>copy Release\VeraCryptSetup.dll "..\Release\Setup Files\VeraCryptSetup.dll"</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'"> + <ClCompile> + <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> + <Optimization>MaxSpeed</Optimization> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>SETUP;VC_EFI_CUSTOM_MODE;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <PrecompiledHeader> + </PrecompiledHeader> + <AssemblerOutput>All</AssemblerOutput> + <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4057;4100;4127;4201;4505;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> + <AdditionalDependencies>version.lib;msi.lib;mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)VeraCryptSetup.exe</OutputFile> + <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> + <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;comdlg32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <GenerateMapFile>true</GenerateMapFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>true</RandomizedBaseAddress> + <DataExecutionPrevention>true</DataExecutionPrevention> + <TargetMachine>MachineX86</TargetMachine> + </Link> + <Manifest> + <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + <PostBuildEvent> + <Command>copy Release\VeraCryptSetup.dll "..\Release\Setup Files\VeraCryptSetup.dll"</Command> + </PostBuildEvent> + <ResourceCompile> + <PreprocessorDefinitions>VC_EFI_CUSTOM_MODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="ComSetup.cpp" /> + <ClCompile Include="Dir.c" /> + <ClCompile Include="Setup.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\Xml.c" /> + <ClCompile Include="..\Common\BootEncryption.cpp" /> + <ClCompile Include="..\Common\Crc.c" /> + <ClCompile Include="..\Common\Dictionary.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\Dlgcode.c"> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs> + <CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">CompileAsCpp</CompileAs> + </ClCompile> + <ClCompile Include="..\Common\Endian.c" /> + <ClCompile Include="..\Common\Language.c" /> + <ClCompile Include="..\Common\Registry.c" /> + </ItemGroup> + <ItemGroup> + <None Include="ComSetup.rgs" /> + <None Include="Setup.ico" /> + <None Include="..\Common\VeraCrypt.ico" /> + <None Include="SetupDLL.def" /> + <None Include="VeraCrypt_setup.bmp" /> + <None Include="VeraCrypt_setup_background.bmp" /> + <None Include="..\Common\VeraCrypt_Volume.ico" /> + <None Include="..\Common\Language.xml" /> + <None Include="..\Resources\Texts\License.rtf" /> + <None Include="..\Common\Textual_logo_288dpi.bmp" /> + <None Include="..\Common\Textual_logo_96dpi.bmp" /> + <None Include="..\Common\Textual_logo_background.bmp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\Common\Apidrvr.h" /> + <ClInclude Include="..\Common\Combo.h" /> + <ClInclude Include="ComSetup.h" /> + <ClInclude Include="..\Common\Crc.h" /> + <ClInclude Include="Dir.h" /> + <ClInclude Include="..\Common\Dlgcode.h" /> + <ClInclude Include="..\Common\Exception.h" /> + <ClInclude Include="..\Common\Inflate.h" /> + <ClInclude Include="..\Common\Language.h" /> + <ClInclude Include="..\Common\Registry.h" /> + <ClInclude Include="..\Common\Resource.h" /> + <ClInclude Include="Resource.h" /> + <ClInclude Include="Setup.h" /> + <ClInclude Include="..\Common\Tcdefs.h" /> + </ItemGroup> + <ItemGroup> + <Manifest Include="Setup.manifest" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Setup.rc" /> + <ResourceCompile Include="..\Common\Common.rc"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'">true</ExcludedFromBuild> + </ResourceCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/src/SetupDLL/SetupDLL_vs2019.vcxproj.filters b/src/SetupDLL/SetupDLL_vs2019.vcxproj.filters new file mode 100644 index 00000000..e0429539 --- /dev/null +++ b/src/SetupDLL/SetupDLL_vs2019.vcxproj.filters @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClCompile Include="..\Common\Xml.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="ComSetup.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Dir.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Common\Endian.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Setup.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Common\BootEncryption.cpp"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Dictionary.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Dlgcode.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Language.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Registry.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + <ClCompile Include="..\Common\Crc.c"> + <Filter>Source Files\Common</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\Common\Apidrvr.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Combo.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="ComSetup.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Crc.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Dir.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Dlgcode.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Exception.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Inflate.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Language.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Registry.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Setup.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\Common\Tcdefs.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Setup.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + <ResourceCompile Include="..\Common\Common.rc"> + <Filter>Resource Files\Common</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <None Include="Setup.ico"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Common\VeraCrypt.ico"> + <Filter>Resource Files</Filter> + </None> + <None Include="VeraCrypt_setup.bmp"> + <Filter>Resource Files</Filter> + </None> + <None Include="VeraCrypt_setup_background.bmp"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Common\VeraCrypt_Volume.ico"> + <Filter>Resource Files</Filter> + </None> + <None Include="..\Common\Language.xml"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Resources\Texts\License.rtf"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Textual_logo_288dpi.bmp"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Textual_logo_96dpi.bmp"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="..\Common\Textual_logo_background.bmp"> + <Filter>Resource Files\Common</Filter> + </None> + <None Include="ComSetup.rgs"> + <Filter>Source Files</Filter> + </None> + <None Include="SetupDLL.def"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> + <ItemGroup> + <Filter Include="Header Files"> + <UniqueIdentifier>{abfa03d7-3de7-4832-b36d-5b45cd0fc304}</UniqueIdentifier> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{d912b4b9-7f5e-4063-8af7-4d544dde2233}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files"> + <UniqueIdentifier>{5a0efac0-b028-4388-a278-1fe6dc479d79}</UniqueIdentifier> + </Filter> + <Filter Include="Resource Files\Common"> + <UniqueIdentifier>{3cb669f1-3949-43f4-a1e5-3b5d0fd75f76}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\Common"> + <UniqueIdentifier>{92f9499e-670d-464b-9edf-c1a2c56fb813}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <Manifest Include="Setup.manifest"> + <Filter>Resource Files</Filter> + </Manifest> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/src/SetupDLL/SetupDLL_vs2019.vcxproj.user b/src/SetupDLL/SetupDLL_vs2019.vcxproj.user new file mode 100644 index 00000000..ace9a86a --- /dev/null +++ b/src/SetupDLL/SetupDLL_vs2019.vcxproj.user @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +</Project>
\ No newline at end of file |