From a21b2270e8db93d231fa0a3d60776043c9a0f9bc Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 4 Dec 2021 23:55:41 +0100 Subject: Windows: Implement TESTSIGNING build configuration that allows running under Windows Vista,7, 8 and 8.1. --- src/Setup/Portable.vcxproj | 61 ++++++++++++++++++++++++++++++++++++++++++++++ src/Setup/Setup.c | 50 ++++++++++++++++++------------------- src/Setup/Setup.vcxproj | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 25 deletions(-) (limited to 'src/Setup') diff --git a/src/Setup/Portable.vcxproj b/src/Setup/Portable.vcxproj index e864515b..1a8e4a46 100644 --- a/src/Setup/Portable.vcxproj +++ b/src/Setup/Portable.vcxproj @@ -9,6 +9,10 @@ ReleaseCustomEFI Win32 + + Release_SkipOsDriverReqCheck + Win32 + Release Win32 @@ -25,6 +29,11 @@ Unicode Windows7.1SDK + + Application + Unicode + Windows7.1SDK + Application Unicode @@ -42,6 +51,10 @@ + + + + @@ -59,15 +72,20 @@ true true PortableRelease\ + PortableRelease\ PortableRelease\ PortableRelease\ + PortableRelease\ PortableRelease\ false + false false true + true true VeraCryptPortable VeraCryptPortable + VeraCryptPortable VeraCryptPortable @@ -145,6 +163,44 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl copy PortableRelease\VeraCryptPortable.exe "..\Release\Setup Files\VeraCrypt Portable.exe" + + + /w34189 %(AdditionalOptions) + MaxSpeed + ..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories) + SETUP;PORTABLE;VC_SKIP_OS_DRIVER_REQ_CHECK;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions) + MultiThreaded + true + + + All + $(IntDir) + Level4 + ProgramDatabase + 4057;4100;4127;4201;4505;4701;4706;4131;%(DisableSpecificWarnings) + + + /IGNORE:4089 %(AdditionalOptions) + mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies) + $(OutDir)VeraCryptPortable.exe + AsInvoker + user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;mpr.dll;%(DelayLoadDLLs) + true + true + Windows + true + true + true + true + MachineX86 + + + Portable.manifest;%(AdditionalManifestFiles) + + + copy PortableRelease\VeraCryptPortable.exe "..\Release\Setup Files\VeraCrypt Portable.exe" + + /w34189 %(AdditionalOptions) @@ -192,11 +248,13 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp @@ -205,11 +263,13 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp @@ -253,6 +313,7 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl true true + true true diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index 4b850999..6423b6b0 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -2944,31 +2944,6 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz SelfExtractStartupInit(); -#ifdef PORTABLE - lpszTitle = L"VeraCrypt Portable"; -#else - lpszTitle = L"VeraCrypt Setup"; -#endif - /* Call InitApp to initialize the common code */ - InitApp (hInstance, NULL); - -#ifndef PORTABLE - if (IsAdmin () != TRUE) - if (MessageBoxW (NULL, GetString ("SETUP_ADMIN"), lpszTitle, MB_YESNO | MB_ICONQUESTION) != IDYES) - { - FinalizeApp (); - exit (1); - } -#endif - /* Setup directory */ - { - wchar_t *s; - GetModuleFileName (NULL, SetupFilesDir, ARRAYSIZE (SetupFilesDir)); - s = wcsrchr (SetupFilesDir, L'\\'); - if (s) - s[1] = 0; - } - /* Parse command line arguments */ if (lpszCommandLine[0] == L'/') @@ -3001,6 +2976,31 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz } } +#ifdef PORTABLE + lpszTitle = L"VeraCrypt Portable"; +#else + lpszTitle = L"VeraCrypt Setup"; +#endif + /* Call InitApp to initialize the common code */ + InitApp (hInstance, NULL); + +#ifndef PORTABLE + if (IsAdmin () != TRUE) + if (MessageBoxW (NULL, GetString ("SETUP_ADMIN"), lpszTitle, MB_YESNO | MB_ICONQUESTION) != IDYES) + { + FinalizeApp (); + exit (1); + } +#endif + /* Setup directory */ + { + wchar_t *s; + GetModuleFileName (NULL, SetupFilesDir, ARRAYSIZE (SetupFilesDir)); + s = wcsrchr (SetupFilesDir, L'\\'); + if (s) + s[1] = 0; + } + if (bMakePackage) { /* Create self-extracting package */ diff --git a/src/Setup/Setup.vcxproj b/src/Setup/Setup.vcxproj index 30c7e167..622e84ef 100644 --- a/src/Setup/Setup.vcxproj +++ b/src/Setup/Setup.vcxproj @@ -9,6 +9,10 @@ ReleaseCustomEFI Win32 + + Release_SkipOsDriverReqCheck + Win32 + Release Win32 @@ -25,6 +29,11 @@ Unicode Windows7.1SDK + + Application + Unicode + Windows7.1SDK + Application Unicode @@ -42,6 +51,10 @@ + + + + @@ -59,15 +72,20 @@ true true Release\ + Release\ Release\ Release\ + Release\ Release\ false + false false true + true true VeraCryptSetup VeraCryptSetup + VeraCryptSetup VeraCryptSetup @@ -146,6 +164,44 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt Setup.exe" && copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt COMReg.exe" + + + /w34189 %(AdditionalOptions) + MaxSpeed + ..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories) + SETUP;VC_SKIP_OS_DRIVER_REQ_CHECK;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions) + MultiThreaded + true + + + All + $(IntDir) + Level4 + ProgramDatabase + 4057;4100;4127;4201;4505;4701;4706;4131;%(DisableSpecificWarnings) + + + /IGNORE:4089 %(AdditionalOptions) + mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies) + $(OutDir)VeraCryptSetup.exe + RequireAdministrator + user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;mpr.dll;%(DelayLoadDLLs) + true + true + Windows + true + true + true + true + MachineX86 + + + Setup.manifest;%(AdditionalManifestFiles) + + + copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt Setup.exe" && copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt COMReg.exe" + + /w34189 %(AdditionalOptions) @@ -194,11 +250,13 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp @@ -207,11 +265,13 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp @@ -257,6 +317,7 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU true true + true true -- cgit v1.2.3