diff options
Diffstat (limited to 'src/Setup')
-rw-r--r-- | src/Setup/ComSetup.cpp | 12 | ||||
-rw-r--r-- | src/Setup/Dir.c | 12 | ||||
-rw-r--r-- | src/Setup/FreeBSD/veracrypt_install_template.sh | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | src/Setup/Linux/mount.veracrypt | 4 | ||||
-rw-r--r-- | src/Setup/Linux/veracrypt-uninstall.sh | 2 | ||||
-rw-r--r-- | src/Setup/Linux/veracrypt_install_template.sh | 13 | ||||
-rwxr-xr-x | src/Setup/MacOSX/postinstall.sh | 4 | ||||
-rwxr-xr-x | src/Setup/MacOSX/veracrypt.pkgproj | 10 | ||||
-rwxr-xr-x | src/Setup/MacOSX/veracrypt_Legacy.pkgproj | 4 | ||||
-rw-r--r-- | src/Setup/Portable.manifest | 8 | ||||
-rw-r--r-- | src/Setup/Portable.rc | 34 | ||||
-rw-r--r-- | src/Setup/Portable.vcxproj | 27 | ||||
-rw-r--r-- | src/Setup/Resource.h | 26 | ||||
-rw-r--r-- | src/Setup/SelfExtract.c | 93 | ||||
-rw-r--r-- | src/Setup/SelfExtract.h | 5 | ||||
-rw-r--r-- | src/Setup/Setup.c | 346 | ||||
-rw-r--r-- | src/Setup/Setup.h | 2 | ||||
-rw-r--r-- | src/Setup/Setup.manifest | 8 | ||||
-rw-r--r-- | src/Setup/Setup.rc | 49 | ||||
-rw-r--r-- | src/Setup/Setup.vcxproj | 31 | ||||
-rw-r--r-- | src/Setup/Wizard.c | 41 |
21 files changed, 360 insertions, 380 deletions
diff --git a/src/Setup/ComSetup.cpp b/src/Setup/ComSetup.cpp index 39ec0032..96734303 100644 --- a/src/Setup/ComSetup.cpp +++ b/src/Setup/ComSetup.cpp @@ -11,10 +11,10 @@ */ #define TC_MAIN_COM_VERSION_MAJOR 2 -#define TC_MAIN_COM_VERSION_MINOR 11 +#define TC_MAIN_COM_VERSION_MINOR 13 #define TC_FORMAT_COM_VERSION_MAJOR 2 -#define TC_FORMAT_COM_VERSION_MINOR 9 +#define TC_FORMAT_COM_VERSION_MINOR 10 #include <atlbase.h> #include <comdef.h> @@ -39,9 +39,9 @@ extern "C" BOOL RegisterComServers (wchar_t *modulePath) UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR, 0, SYS_WIN32); UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR, 0, SYS_WIN32); // unregister older versions that may still exist - for (WORD i = 7; i >= 1; i--) + for (WORD i = 9; i >= 1; i--) UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-i, 0, SYS_WIN32); - for (WORD i = 5; i >= 1; i--) + for (WORD i = 6; i >= 1; i--) UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-i, 0, SYS_WIN32); wchar_t setupModule[MAX_PATH]; @@ -78,9 +78,9 @@ extern "C" BOOL UnregisterComServers (wchar_t *modulePath) return FALSE; // unregister older versions that may still exist - for (WORD i = 7; i >= 1; i--) + for (WORD i = 9; i >= 1; i--) UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-i, 0, SYS_WIN32); - for (WORD i = 5; i >= 1; i--) + for (WORD i = 6; i >= 1; i--) UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-i, 0, SYS_WIN32); wchar_t module[1024]; diff --git a/src/Setup/Dir.c b/src/Setup/Dir.c index 2d4feecd..3275567f 100644 --- a/src/Setup/Dir.c +++ b/src/Setup/Dir.c @@ -31,6 +31,12 @@ mkfulldir (wchar_t *oriPath, BOOL bCheckonly) wchar_t *uniq_file; wchar_t path [TC_MAX_PATH]; + if (wcslen(oriPath) >= TC_MAX_PATH) + { + // directory name will be truncated so return failure to avoid unexepected behavior + return -1; + } + StringCbCopyW (path, TC_MAX_PATH, oriPath); if (wcslen (path) == 3 && path[1] == L':') @@ -66,6 +72,12 @@ mkfulldir_internal (wchar_t *path) 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'; diff --git a/src/Setup/FreeBSD/veracrypt_install_template.sh b/src/Setup/FreeBSD/veracrypt_install_template.sh index c34f5858..1ebc7672 100644 --- a/src/Setup/FreeBSD/veracrypt_install_template.sh +++ b/src/Setup/FreeBSD/veracrypt_install_template.sh @@ -93,7 +93,7 @@ show_message() else if [ $KTERM -eq 1 ] then - konsole --title 'VeraCrypt Setup' --caption 'VeraCrypt Setup' -e sh -c "echo $*; read A" + konsole --qwindowtitle 'VeraCrypt Setup' --caption 'VeraCrypt Setup' -e sh -c "echo $*; read A" fi fi fi @@ -1031,14 +1031,15 @@ fi if [ "$PACKAGE_TYPE" = "tar" ] then - if ! which fusermount >/dev/null 2>/dev/null || ! which dmsetup >/dev/null 2>/dev/null + if ! which fusermount >/dev/null 2>/dev/null || ! which dmsetup >/dev/null 2>/dev/null || ! service pcscd status >/dev/null 2>/dev/null then show_message "$(cat <<_INFO Requirements for Running VeraCrypt: ----------------------------------- - FUSE library and tools - - device mapper tools + - device mapper tool + - PC/SC Lite (optional) _INFO )" @@ -1073,7 +1074,7 @@ then else if [ $KTERM -eq 1 ] then - exec konsole --title 'VeraCrypt Setup' --caption 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A" + exec konsole --qwindowtitle 'VeraCrypt Setup' --caption 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A" fi fi fi diff --git a/src/Setup/Linux/mount.veracrypt b/src/Setup/Linux/mount.veracrypt index 499ad9b9..a891c253 100644..100755 --- a/src/Setup/Linux/mount.veracrypt +++ b/src/Setup/Linux/mount.veracrypt @@ -13,11 +13,11 @@ for arg in $*; do fs=*) VCOPTIONS=(${VCOPTIONS[*]} --filesystem=${arg#*=});; keyfiles=*) VCOPTIONS=(${VCOPTIONS[*]} --keyfiles=${arg#*=});; password=*) VCOPTIONS=(${VCOPTIONS[*]} --password=${arg#*=});; - pim=*) VCOPTIONS=(${VCOPTIONS[*]} --pim==${arg#*=});; + pim=*) VCOPTIONS=(${VCOPTIONS[*]} --pim=${arg#*=});; protect-hidden=*) VCOPTIONS=(${VCOPTIONS[*]} --protect-hidden=${arg#*=});; slot=*) VCOPTIONS=(${VCOPTIONS[*]} --slot=${arg#*=});; *) OPTIONS="${OPTIONS}${arg},";; esac done -/usr/bin/veracrypt --non-interactive --text ${VCOPTIONS[*]} --fs-options="${OPTIONS%,*}" ${DEV} ${MNTPT} +/usr/bin/veracrypt --text --non-interactive ${VCOPTIONS[*]} --fs-options="${OPTIONS%,*}" ${DEV} ${MNTPT} diff --git a/src/Setup/Linux/veracrypt-uninstall.sh b/src/Setup/Linux/veracrypt-uninstall.sh index bc74eb0b..2abbfd6c 100644 --- a/src/Setup/Linux/veracrypt-uninstall.sh +++ b/src/Setup/Linux/veracrypt-uninstall.sh @@ -3,8 +3,10 @@ V="$(mount | grep veracrypt_aux_mnt)" [ "$V" ] && echo Error: All volumes must be dismounted first. >&2 && exit 1 rm -f /usr/bin/veracrypt +rm -f /usr/sbin/mount.veracrypt rm -f /usr/share/applications/veracrypt.desktop rm -f /usr/share/pixmaps/veracrypt.xpm +rm -f /usr/share/mime/packages/veracrypt.xml rm -fr /usr/share/veracrypt rm -fr /usr/share/doc/veracrypt diff --git a/src/Setup/Linux/veracrypt_install_template.sh b/src/Setup/Linux/veracrypt_install_template.sh index 5d572976..e4615966 100644 --- a/src/Setup/Linux/veracrypt_install_template.sh +++ b/src/Setup/Linux/veracrypt_install_template.sh @@ -32,7 +32,11 @@ KTERM=0 case $PACKAGE_TYPE in tar) PACKAGE_INSTALLER=tar - PACKAGE_INSTALLER_OPTS='-C / --no-overwrite-dir -xpzvf' + if tar --help | grep -q -- '--keep-directory-symlink'; then + PACKAGE_INSTALLER_OPTS='-C / --keep-directory-symlink --no-overwrite-dir -xpzvf' + else + PACKAGE_INSTALLER_OPTS='-C / --no-overwrite-dir -xpzvf' + fi ;; esac @@ -93,7 +97,7 @@ show_message() else if [ $KTERM -eq 1 ] then - konsole --title 'VeraCrypt Setup' -e sh -c "echo $*; read A" + konsole --qwindowtitle 'VeraCrypt Setup' -e sh -c "echo $*; read A" fi fi fi @@ -1031,7 +1035,7 @@ fi if [ "$PACKAGE_TYPE" = "tar" ] then - if ! which fusermount >/dev/null 2>/dev/null || ! which dmsetup >/dev/null 2>/dev/null + if ! which fusermount >/dev/null 2>/dev/null || ! which dmsetup >/dev/null 2>/dev/null || ! service pcscd status >/dev/null 2>/dev/null then show_message "$(cat <<_INFO Requirements for Running VeraCrypt: @@ -1039,6 +1043,7 @@ Requirements for Running VeraCrypt: - FUSE library and tools - device mapper tools + - PC/SC Lite (optional) _INFO )" @@ -1073,7 +1078,7 @@ then else if [ $KTERM -eq 1 ] then - exec konsole --title 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A" + exec konsole --qwindowtitle 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A" fi fi fi diff --git a/src/Setup/MacOSX/postinstall.sh b/src/Setup/MacOSX/postinstall.sh index 7ce14ffc..661b0f5b 100755 --- a/src/Setup/MacOSX/postinstall.sh +++ b/src/Setup/MacOSX/postinstall.sh @@ -4,5 +4,7 @@ if !([ -e "/usr/local/lib/libfuse.2.dylib" ]) then ln -s /usr/local/lib/libosxfuse.2.dylib /usr/local/lib/libfuse.2.dylib fi - + +chmod -R go-w /Applications/VeraCrypt.app + exit 0 diff --git a/src/Setup/MacOSX/veracrypt.pkgproj b/src/Setup/MacOSX/veracrypt.pkgproj index 9a71aa7c..99c255ea 100755 --- a/src/Setup/MacOSX/veracrypt.pkgproj +++ b/src/Setup/MacOSX/veracrypt.pkgproj @@ -557,7 +557,7 @@ <key>USE_HFS+_COMPRESSION</key> <false/> <key>VERSION</key> - <string>1.25.4</string> + <string>1.26.10</string> </dict> <key>TYPE</key> <integer>0</integer> @@ -755,7 +755,7 @@ <key>IC_REQUIREMENT_OS_DISTRIBUTION_TYPE</key> <integer>0</integer> <key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key> - <integer>100900</integer> + <integer>120001</integer> </dict> <key>IC_REQUIREMENT_CHECK_TYPE</key> <integer>0</integer> @@ -767,13 +767,13 @@ <key>LANGUAGE</key> <string>English</string> <key>VALUE</key> - <string>VeraCrypt requires MacOSX 10.9 and above.</string> + <string>VeraCrypt requires MacOSX 12 and above.</string> </dict> <dict> <key>LANGUAGE</key> <string>French</string> <key>VALUE</key> - <string>VeraCrypt nécessite MacOSX 10.9 et supérieur.</string> + <string>VeraCrypt nécessite MacOSX 12 et supérieur.</string> </dict> </array> <key>NAME</key> @@ -1025,7 +1025,7 @@ https://osxfuse.github.io/ </dict> </array> <key>NAME</key> - <string>VeraCrypt 1.25.4</string> + <string>VeraCrypt 1.26.10</string> <key>PAYLOAD_ONLY</key> <false/> <key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key> diff --git a/src/Setup/MacOSX/veracrypt_Legacy.pkgproj b/src/Setup/MacOSX/veracrypt_Legacy.pkgproj index 31d5c753..6819907a 100755 --- a/src/Setup/MacOSX/veracrypt_Legacy.pkgproj +++ b/src/Setup/MacOSX/veracrypt_Legacy.pkgproj @@ -557,7 +557,7 @@ <key>USE_HFS+_COMPRESSION</key> <false/> <key>VERSION</key> - <string>1.25.4</string> + <string>1.26.10</string> </dict> <key>TYPE</key> <integer>0</integer> @@ -1062,7 +1062,7 @@ https://osxfuse.github.io/ </dict> </array> <key>NAME</key> - <string>VeraCrypt Legacy 1.25.4</string> + <string>VeraCrypt Legacy 10</string> <key>PAYLOAD_ONLY</key> <false/> <key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key> diff --git a/src/Setup/Portable.manifest b/src/Setup/Portable.manifest index 5d4cb896..79d86799 100644 --- a/src/Setup/Portable.manifest +++ b/src/Setup/Portable.manifest @@ -14,7 +14,13 @@ </asmv3:application> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> - <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> + <!-- Windows 10 and Windows 11 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> + <!-- Windows 8.1 --> + <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> + <!-- Windows 8 --> + <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> + <!-- Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> </application> </compatibility> diff --git a/src/Setup/Portable.rc b/src/Setup/Portable.rc index 75f7fc05..eb198e9e 100644 --- a/src/Setup/Portable.rc +++ b/src/Setup/Portable.rc @@ -26,8 +26,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,25,4,0 - PRODUCTVERSION 1,25,4,0 + FILEVERSION 1,26,10,0 + PRODUCTVERSION 1,26,10,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,11 +44,11 @@ BEGIN BEGIN VALUE "CompanyName", "IDRIX" VALUE "FileDescription", "VeraCrypt Portable" - VALUE "FileVersion", "1.25" + VALUE "FileVersion", "1.26.10" VALUE "LegalTrademarks", "VeraCrypt" VALUE "OriginalFilename", "VeraCrypt Portable.exe" VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.25" + VALUE "ProductVersion", "1.26.10" END END BLOCK "VarFileInfo" @@ -86,6 +86,32 @@ 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_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/Setup/Portable.vcxproj b/src/Setup/Portable.vcxproj index 1a8e4a46..1c758b2b 100644 --- a/src/Setup/Portable.vcxproj +++ b/src/Setup/Portable.vcxproj @@ -91,7 +91,7 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>SETUP;PORTABLE;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> @@ -105,10 +105,10 @@ </ClCompile> <Link> <AdditionalOptions>/NODEFAULTLIB:LIBCMTD %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>libcmtd.lib;atlsd.lib;mpr.lib;..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>libcmtd.lib;atlsd.lib;mpr.lib;..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;..\Common\Debug\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptPortable.exe</OutputFile> <UACExecutionLevel>AsInvoker</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.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)Portable.pdb</ProgramDatabaseFile> <SubSystem>Windows</SubSystem> @@ -129,7 +129,7 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>SETUP;PORTABLE;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> @@ -143,10 +143,10 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptPortable.exe</OutputFile> <UACExecutionLevel>AsInvoker</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.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> @@ -167,7 +167,7 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>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)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <BufferSecurityCheck>true</BufferSecurityCheck> @@ -181,10 +181,10 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptPortable.exe</OutputFile> <UACExecutionLevel>AsInvoker</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.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> @@ -205,7 +205,7 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>SETUP;PORTABLE;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> @@ -219,10 +219,10 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptPortable.exe</OutputFile> <UACExecutionLevel>AsInvoker</UACExecutionLevel> - <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.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> @@ -323,6 +323,9 @@ copy PortableDebug\VeraCryptPortable.exe "..\Debug\Setup Files\VeraCrypt Portabl <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> + <ProjectReference Include="..\Common\Lzma.vcxproj"> + <Project>{b896fe1f-6bf3-4f75-9148-f841829073d9}</Project> + </ProjectReference> <ProjectReference Include="..\ExpandVolume\ExpandVolume.vcxproj"> <Project>{9715ff1d-599b-4bbc-ad96-bef6e08ff827}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> diff --git a/src/Setup/Resource.h b/src/Setup/Resource.h index 8882d67b..b5b7d466 100644 --- a/src/Setup/Resource.h +++ b/src/Setup/Resource.h @@ -17,6 +17,32 @@ #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 IDD_INSTALL 101 #define IDD_INSTALL_OPTIONS_PAGE_DLG 102 #define IDD_UNINSTALL 103 diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c index 34fb0b25..c672c364 100644 --- a/src/Setup/SelfExtract.c +++ b/src/Setup/SelfExtract.c @@ -22,6 +22,7 @@ #include "Dir.h" #include "Language.h" #include "Resource.h" +#include "LzmaLib.h" #include <tchar.h> #include <Strsafe.h> @@ -32,8 +33,12 @@ #ifdef PORTABLE #define OutputPackageFile L"VeraCrypt Portable " _T(VERSION_STRING) _T(VERSION_STRING_SUFFIX)L".exe" #else +#ifdef VC_COMREG +#define OutputPackageFile L"VeraCrypt COMReg.exe" +#else #define OutputPackageFile L"VeraCrypt Setup " _T(VERSION_STRING) _T(VERSION_STRING_SUFFIX) L".exe" #endif +#endif #define MAG_START_MARKER "VCINSTRT" #define MAG_END_MARKER_OBFUSCATED "V/C/I/N/S/C/R/C" #define PIPE_BUFFER_LEN (4 * BYTES_PER_KB) @@ -41,6 +46,7 @@ unsigned char MagEndMarker [sizeof (MAG_END_MARKER_OBFUSCATED)]; wchar_t DestExtractPath [TC_MAX_PATH]; DECOMPRESSED_FILE Decompressed_Files [NBR_COMPRESSED_FILES]; +int Decompressed_Files_Count = 0; volatile char *PipeWriteBuf = NULL; volatile HANDLE hChildStdinWrite = INVALID_HANDLE_VALUE; @@ -89,24 +95,43 @@ static void PkgInfo (wchar_t *msg) // Returns 0 if decompression fails or, if successful, returns the size of the decompressed data static int DecompressBuffer (unsigned char *out, int outSize, unsigned char *in, int len) { - uLongf outlen = (uLongf) outSize; - int ret = uncompress (out, &outlen, in, (uLong) len); - if (Z_OK == ret) - return (int) outlen; - else - return 0; + int outlen = 0; + int status; + if (len > 5) + { + // the first 5 bytes of in contain props parameter + size_t srcLen = len - 5; + size_t outputLen = (size_t) outSize; + status = LzmaUncompress (out, &outputLen, in + 5, &srcLen, in, 5); + if (status == SZ_OK) + { + outlen = (int) outputLen; + } + } + + return outlen; } // Returns 0 if compression fails or, if successful, the size of the compressed data static int CompressBuffer (unsigned char *out, int outSize, unsigned char *in, int len) { - uLongf outlen = (uLongf) outSize; - int ret = compress2 (out, &outlen, in, (uLong) len, Z_BEST_COMPRESSION); - if (Z_OK == ret) - return (int) outlen; - else - return 0; + unsigned char outProps[5]; + size_t outPropsSize = 5; + int outlen = 0; + int status; + if (outSize > 5) + { + size_t outputLen = (size_t) (outSize - 5); + status = LzmaCompress (out + 5, &outputLen, in, len, outProps, &outPropsSize, 9, 0, -1, -1, -1, -1, -1); + if (status == SZ_OK) + { + memcpy (out, outProps, outPropsSize); + outlen = (int) (outputLen + 5); + } + } + + return outlen; } @@ -119,7 +144,7 @@ static void WipeSignatureAreas (char *buffer) } -BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir) +BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir, BOOL bSkipX64) { int i, x; wchar_t inputFile [TC_MAX_PATH]; @@ -163,6 +188,17 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir) for (i = 0; i < sizeof (szCompressedFiles) / sizeof (szCompressedFiles[0]); i++) { + if (bSkipX64 && wcsstr(szCompressedFiles[i], L"-x64")) + continue; + +#ifdef VC_COMREG + if ( wcsstr(szCompressedFiles[i], L".zip") || wcsstr(szCompressedFiles[i], L".inf") + || wcsstr(szCompressedFiles[i], L".cat") || wcsstr(szCompressedFiles[i], L".txt") + || wcsstr(szCompressedFiles[i], L"LICENSE") || wcsstr(szCompressedFiles[i], L"NOTICE") + ) + continue; +#endif + StringCbPrintfW (szTmpFilePath, sizeof(szTmpFilePath), L"%s%s", szDestDir, szCompressedFiles[i]); if (!FileExists (szTmpFilePath)) @@ -215,6 +251,17 @@ BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir) DWORD tmpFileSize; unsigned char *tmpBuffer; + if (bSkipX64 && wcsstr(szCompressedFiles[i], L"-x64")) + continue; + +#ifdef VC_COMREG + if ( wcsstr(szCompressedFiles[i], L".zip") || wcsstr(szCompressedFiles[i], L".inf") + || wcsstr(szCompressedFiles[i], L".cat") || wcsstr(szCompressedFiles[i], L".txt") + || wcsstr(szCompressedFiles[i], L"LICENSE") || wcsstr(szCompressedFiles[i], L"NOTICE") + ) + continue; +#endif + StringCbPrintfW (szTmpFilePath, sizeof(szTmpFilePath), L"%s%s", szDestDir, szCompressedFiles[i]); tmpBuffer = LoadFile (szTmpFilePath, &tmpFileSize); @@ -485,6 +532,8 @@ void FreeAllFileBuffers (void) Decompressed_Files[fileNo].fileLength = 0; Decompressed_Files[fileNo].crc = 0; } + + Decompressed_Files_Count = 0; } @@ -492,7 +541,7 @@ void FreeAllFileBuffers (void) // Creates a table of pointers to buffers containing the following objects for each file: // filename size, filename (not null-terminated!), file size, file CRC-32, uncompressed file contents. // For details, see the definition of the DECOMPRESSED_FILE structure. -BOOL SelfExtractInMemory (wchar_t *path) +BOOL SelfExtractInMemory (wchar_t *path, BOOL bSkipCountCheck) { int filePos = 0, fileNo = 0; int fileDataEndPos = 0; @@ -546,9 +595,17 @@ BOOL SelfExtractInMemory (wchar_t *path) if (compressedLen != fileDataEndPos - fileDataStartPos - 8 + 1) { Error ("DIST_PACKAGE_CORRUPTED", NULL); + return FALSE; } - decompressedDataLen = uncompressedLen + 524288; // + 512K reserve + // Test to make Coverity happy. It will always be false + if (uncompressedLen >= (INT_MAX - 524288)) + { + Error ("DIST_PACKAGE_CORRUPTED", NULL); + return FALSE; + } + + decompressedDataLen = uncompressedLen; DecompressedData = malloc (decompressedDataLen); if (DecompressedData == NULL) { @@ -607,12 +664,14 @@ BOOL SelfExtractInMemory (wchar_t *path) fileNo++; } - if (fileNo < NBR_COMPRESSED_FILES) + if (!bSkipCountCheck && (fileNo < NBR_COMPRESSED_FILES)) { Error ("DIST_PACKAGE_CORRUPTED", NULL); goto sem_end; } + Decompressed_Files_Count = fileNo; + free (compressedData); return TRUE; @@ -635,7 +694,7 @@ void __cdecl ExtractAllFilesThread (void *hwndDlg) GetModuleFileName (NULL, packageFile, ARRAYSIZE (packageFile)); - if (!(bSuccess = SelfExtractInMemory (packageFile))) + if (!(bSuccess = SelfExtractInMemory (packageFile, FALSE))) goto eaf_end; if (mkfulldir (DestExtractPath, TRUE) != 0) diff --git a/src/Setup/SelfExtract.h b/src/Setup/SelfExtract.h index ed4b6655..bcdb6fdb 100644 --- a/src/Setup/SelfExtract.h +++ b/src/Setup/SelfExtract.h @@ -27,11 +27,12 @@ typedef struct } DECOMPRESSED_FILE; extern DECOMPRESSED_FILE Decompressed_Files [NBR_COMPRESSED_FILES]; +extern int Decompressed_Files_Count; void SelfExtractStartupInit (void); -BOOL SelfExtractInMemory (wchar_t *path); +BOOL SelfExtractInMemory (wchar_t *path, BOOL bSkipCountCheck); void __cdecl ExtractAllFilesThread (void *hwndDlg); -BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir); +BOOL MakeSelfExtractingPackage (HWND hwndDlg, wchar_t *szDestDir, BOOL bSkipX64); BOOL VerifyPackageIntegrity (const wchar_t *path); BOOL VerifySelfPackageIntegrity (void); BOOL IsSelfExtractingPackage (void); diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index 6423b6b0..6edc0ea9 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -74,6 +74,8 @@ BOOL UnloadDriver = TRUE; BOOL bSystemRestore = TRUE; BOOL bDisableSwapFiles = FALSE; BOOL bForAllUsers = TRUE; +BOOL bDisableMemoryProtection = FALSE; +BOOL bOriginalDisableMemoryProtection = FALSE; BOOL bRegisterFileExt = TRUE; BOOL bAddToStartMenu = TRUE; BOOL bDesktopIcon = TRUE; @@ -570,25 +572,12 @@ 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) + ) { - if ( (ERROR_SUCCESS == RegQueryValueEx (hKey, L"RPSessionInterval", NULL, NULL, (LPBYTE) &dwValue, &cbValue)) - && (dwValue == 1) - ) - { - bEnabled = TRUE; - } + bEnabled = TRUE; } - else - { - if ( (ERROR_SUCCESS == RegQueryValueEx (hKey, L"DisableSR", NULL, NULL, (LPBYTE) &dwValue, &cbValue)) - && (dwValue == 0) - ) - { - bEnabled = TRUE; - } - } - RegCloseKey (hKey); } @@ -720,10 +709,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); @@ -787,7 +772,7 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir) GetModuleFileName (NULL, szTmp, ARRAYSIZE (szTmp)); - if (!SelfExtractInMemory (szTmp)) + if (!SelfExtractInMemory (szTmp, FALSE)) return FALSE; } @@ -819,7 +804,8 @@ BOOL DoFilesInstall (HWND hwndDlg, wchar_t *szDestDir) if (Is64BitOs ()) driver64 = TRUE; - GetSystemDirectory (szDir, ARRAYSIZE (szDir)); + if (!GetSystemDirectory (szDir, ARRAYSIZE (szDir))) + StringCbCopyW(szDir, sizeof(szDir), L"C:\\Windows\\System32"); x = wcslen (szDir); if (szDir[x - 1] != L'\\') @@ -1360,13 +1346,10 @@ error: } // Register COM servers for UAC - if (IsOSAtLeast (WIN_VISTA)) + if (!RegisterComServers (szDir)) { - if (!RegisterComServers (szDir)) - { - Error ("COM_REG_FAILED", hwndDlg); - return FALSE; - } + Error ("COM_REG_FAILED", hwndDlg); + return FALSE; } return bOK; @@ -1439,16 +1422,9 @@ BOOL DoApplicationDataUninstall (HWND hwndDlg) BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated) { wchar_t regk [64]; - typedef LSTATUS (WINAPI *RegDeleteKeyExWFn) (HKEY hKey,LPCWSTR lpSubKey,REGSAM samDesired,WORD Reserved); - RegDeleteKeyExWFn RegDeleteKeyExWPtr = NULL; - HMODULE hAdvapiDll = LoadLibrary (L"Advapi32.dll"); - if (hAdvapiDll) - { - RegDeleteKeyExWPtr = (RegDeleteKeyExWFn) GetProcAddress(hAdvapiDll, "RegDeleteKeyExW"); - } // Unregister COM servers - if (!bRemoveDeprecated && IsOSAtLeast (WIN_VISTA)) + if (!bRemoveDeprecated) { if (!UnregisterComServers (InstallationPath)) StatusMessage (hwndDlg, "COM_DEREG_FAILED"); @@ -1457,16 +1433,9 @@ BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated) if (!bRemoveDeprecated) StatusMessage (hwndDlg, "REMOVING_REG"); - if (RegDeleteKeyExWPtr) - { - RegDeleteKeyExWPtr (HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\VeraCrypt", KEY_WOW64_32KEY, 0); - RegDeleteKeyExWPtr (HKEY_CURRENT_USER, L"Software\\VeraCrypt", KEY_WOW64_32KEY, 0); - } - else - { - RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\VeraCrypt"); - RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\VeraCrypt"); - } + RegDeleteKeyExW (HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\VeraCrypt", KEY_WOW64_32KEY, 0); + RegDeleteKeyExW (HKEY_CURRENT_USER, L"Software\\VeraCrypt", KEY_WOW64_32KEY, 0); + RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\Classes\\VeraCryptVolume\\Shell\\open\\command"); RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\Classes\\VeraCryptVolume\\Shell\\open"); RegDeleteKey (HKEY_LOCAL_MACHINE, L"Software\\Classes\\VeraCryptVolume\\Shell"); @@ -1505,9 +1474,6 @@ BOOL DoRegUninstall (HWND hwndDlg, BOOL bRemoveDeprecated) SHChangeNotify (SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); } - if (hAdvapiDll) - FreeLibrary (hAdvapiDll); - return TRUE; } @@ -1726,6 +1692,10 @@ BOOL DoDriverUnload (HWND hwndDlg) if (CurrentOSMajor == 6 && CurrentOSMinor == 0 && CurrentOSServicePack < 1) AbortProcess ("SYS_ENCRYPTION_UPGRADE_UNSUPPORTED_ON_VISTA_SP0"); + // check if we are upgrading a system encrypted with unsupported algorithms + if (bootEnc.IsUsingUnsupportedAlgorithm(driverVersion)) + AbortProcess ("SYS_ENCRYPTION_UPGRADE_UNSUPPORTED_ALGORITHM"); + SystemEncryptionUpdate = TRUE; PortableMode = FALSE; } @@ -1750,13 +1720,6 @@ BOOL DoDriverUnload (HWND hwndDlg) // 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) @@ -2231,227 +2194,6 @@ void DoUninstall (void *arg) OutcomePrompt (hwndDlg, bOK); } -/* IDRIX code signing certificate */ - -unsigned char g_pbCodeSignCert[1903] = { - 0x30, 0x82, 0x07, 0x6B, 0x30, 0x82, 0x05, 0x53, 0xA0, 0x03, 0x02, 0x01, - 0x02, 0x02, 0x0C, 0x05, 0xA8, 0x0D, 0x83, 0x5C, 0x41, 0x78, 0x8E, 0x65, - 0x03, 0x28, 0x4C, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, - 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x5C, 0x31, 0x0B, 0x30, 0x09, - 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x42, 0x45, 0x31, 0x19, 0x30, - 0x17, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x10, 0x47, 0x6C, 0x6F, 0x62, - 0x61, 0x6C, 0x53, 0x69, 0x67, 0x6E, 0x20, 0x6E, 0x76, 0x2D, 0x73, 0x61, - 0x31, 0x32, 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x29, 0x47, - 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x53, 0x69, 0x67, 0x6E, 0x20, 0x47, 0x43, - 0x43, 0x20, 0x52, 0x34, 0x35, 0x20, 0x45, 0x56, 0x20, 0x43, 0x6F, 0x64, - 0x65, 0x53, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, 0x20, 0x43, 0x41, 0x20, - 0x32, 0x30, 0x32, 0x30, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x31, 0x30, 0x38, - 0x32, 0x32, 0x32, 0x30, 0x31, 0x30, 0x34, 0x32, 0x5A, 0x17, 0x0D, 0x32, - 0x32, 0x30, 0x32, 0x31, 0x31, 0x31, 0x32, 0x31, 0x36, 0x31, 0x38, 0x5A, - 0x30, 0x81, 0xD0, 0x31, 0x1D, 0x30, 0x1B, 0x06, 0x03, 0x55, 0x04, 0x0F, - 0x0C, 0x14, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x4F, 0x72, - 0x67, 0x61, 0x6E, 0x69, 0x7A, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x31, 0x14, - 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x05, 0x13, 0x0B, 0x34, 0x39, 0x30, - 0x20, 0x30, 0x30, 0x30, 0x20, 0x36, 0x31, 0x39, 0x31, 0x13, 0x30, 0x11, - 0x06, 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x3C, 0x02, 0x01, - 0x03, 0x13, 0x02, 0x46, 0x52, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, - 0x04, 0x06, 0x13, 0x02, 0x46, 0x52, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, - 0x55, 0x04, 0x08, 0x13, 0x0D, 0x69, 0x6C, 0x65, 0x2D, 0x64, 0x65, 0x2D, - 0x46, 0x72, 0x61, 0x6E, 0x63, 0x65, 0x31, 0x0E, 0x30, 0x0C, 0x06, 0x03, - 0x55, 0x04, 0x07, 0x13, 0x05, 0x50, 0x61, 0x72, 0x69, 0x73, 0x31, 0x25, - 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x09, 0x13, 0x1C, 0x39, 0x20, 0x72, - 0x75, 0x65, 0x20, 0x64, 0x75, 0x20, 0x44, 0x6F, 0x63, 0x74, 0x65, 0x75, - 0x72, 0x20, 0x47, 0x65, 0x72, 0x6D, 0x61, 0x69, 0x6E, 0x20, 0x53, 0x65, - 0x65, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x0A, - 0x49, 0x44, 0x52, 0x49, 0x58, 0x20, 0x53, 0x41, 0x52, 0x4C, 0x31, 0x13, - 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0A, 0x49, 0x44, 0x52, - 0x49, 0x58, 0x20, 0x53, 0x41, 0x52, 0x4C, 0x30, 0x82, 0x02, 0x22, 0x30, - 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, - 0x05, 0x00, 0x03, 0x82, 0x02, 0x0F, 0x00, 0x30, 0x82, 0x02, 0x0A, 0x02, - 0x82, 0x02, 0x01, 0x00, 0xCF, 0x50, 0x72, 0x0E, 0x92,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x81, 0x9F, 0x06, 0x08, 0x2B, 0x06, - 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x81, 0x92, 0x30, 0x81, 0x8F, - 0x30, 0x4C, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, - 0x86, 0x40, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x65, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, - 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x63, 0x61, 0x63, 0x65, 0x72, - 0x74, 0x2F, 0x67, 0x73, 0x67, 0x63, 0x63, 0x72, 0x34, 0x35, 0x65, 0x76, - 0x63, 0x6F, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6E, 0x63, 0x61, 0x32, 0x30, - 0x32, 0x30, 0x2E, 0x63, 0x72, 0x74, 0x30, 0x3F, 0x06, 0x08, 0x2B, 0x06, - 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x33, 0x68, 0x74, 0x74, 0x70, - 0x3A, 0x2F, 0x2F, 0x6F, 0x63, 0x73, 0x70, 0x2E, 0x67, 0x6C, 0x6F, 0x62, - 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x67, - 0x73, 0x67, 0x63, 0x63, 0x72, 0x34, 0x35, 0x65, 0x76, 0x63, 0x6F, 0x64, - 0x65, 0x73, 0x69, 0x67, 0x6E, 0x63, 0x61, 0x32, 0x30, 0x32, 0x30, 0x30, - 0x55, 0x06, 0x03, 0x55, 0x1D, 0x20, 0x04, 0x4E, 0x30, 0x4C, 0x30, 0x41, - 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xA0, 0x32, 0x01, 0x02, 0x30, - 0x34, 0x30, 0x32, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, - 0x01, 0x16, 0x26, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x77, - 0x77, 0x77, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, - 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x72, 0x65, 0x70, 0x6F, 0x73, 0x69, - 0x74, 0x6F, 0x72, 0x79, 0x2F, 0x30, 0x07, 0x06, 0x05, 0x67, 0x81, 0x0C, - 0x01, 0x03, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x02, 0x30, - 0x00, 0x30, 0x47, 0x06, 0x03, 0x55, 0x1D, 0x1F, 0x04, 0x40, 0x30, 0x3E, - 0x30, 0x3C, 0xA0, 0x3A, 0xA0, 0x38, 0x86, 0x36, 0x68, 0x74, 0x74, 0x70, - 0x3A, 0x2F, 0x2F, 0x63, 0x72, 0x6C, 0x2E, 0x67, 0x6C, 0x6F, 0x62, 0x61, - 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x67, 0x73, - 0x67, 0x63, 0x63, 0x72, 0x34, 0x35, 0x65, 0x76, 0x63, 0x6F, 0x64, 0x65, - 0x73, 0x69, 0x67, 0x6E, 0x63, 0x61, 0x32, 0x30, 0x32, 0x30, 0x2E, 0x63, - 0x72, 0x6C, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C, 0x30, - 0x0A, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x30, - 0x1F, 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, - 0x25, 0x9D, 0xD0, 0xFC, 0x59, 0x09, 0x86, 0x63, 0xC5, 0xEC, 0xF3, 0xB1, - 0x13, 0x3B, 0x57, 0x1C, 0x03, 0x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 0x17, 0x1F, 0xF8, 0xC6, - 0x6D, 0x56, 0x18, 0x9F, 0x27, 0xCF, 0xC8, 0x9E, 0x09, 0x30, 0x25, 0xC3, - 0xB3, 0xFA, 0x04, 0xE0, 0x37, 0x4D, 0xD7 -}; - -typedef PCCERT_CONTEXT (WINAPI *CertCreateCertificateContextType)( - __in DWORD dwCertEncodingType, - __in_bcount(cbCertEncoded) const BYTE *pbCertEncoded, - __in DWORD cbCertEncoded - ); - -typedef HCERTSTORE (WINAPI *CertOpenStoreType)( - __in LPCSTR lpszStoreProvider, - __in DWORD dwEncodingType, - __in_opt HCRYPTPROV_LEGACY hCryptProv, - __in DWORD dwFlags, - __in_opt const void *pvPara - ); - -typedef BOOL (WINAPI *CertAddCertificateContextToStoreType)( - __in_opt HCERTSTORE hCertStore, - __in PCCERT_CONTEXT pCertContext, - __in DWORD dwAddDisposition, - __deref_opt_out PCCERT_CONTEXT *ppStoreContext - ); - -typedef BOOL (WINAPI *CertCloseStoreType)( - __in_opt HCERTSTORE hCertStore, - __in DWORD dwFlags - ); - -typedef BOOL (WINAPI *CertFreeCertificateContextType)( - __in_opt PCCERT_CONTEXT pCertContext - ); - -void AddCertificateToTrustedPublisher () -{ - // load crypt32.dll functions dynamically to avoid linking to them since they are used only on Windows XP - CertCreateCertificateContextType CertCreateCertificateContextFn = (CertCreateCertificateContextType) GetProcAddress(hcrypt32dll, "CertCreateCertificateContext"); - CertOpenStoreType CertOpenStoreFn = (CertOpenStoreType) GetProcAddress(hcrypt32dll, "CertOpenStore"); - CertAddCertificateContextToStoreType CertAddCertificateContextToStoreFn = (CertAddCertificateContextToStoreType) GetProcAddress(hcrypt32dll, "CertAddCertificateContextToStore"); - CertCloseStoreType CertCloseStoreFn = (CertCloseStoreType) GetProcAddress(hcrypt32dll, "CertCloseStore"); - CertFreeCertificateContextType CertFreeCertificateContextFn = (CertFreeCertificateContextType) GetProcAddress(hcrypt32dll, "CertFreeCertificateContext"); - - if (CertCreateCertificateContextFn && CertOpenStoreFn && CertAddCertificateContextToStoreFn && CertCloseStoreFn && CertFreeCertificateContextFn) - { - PCCERT_CONTEXT pCodeSignCert = CertCreateCertificateContextFn(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, g_pbCodeSignCert, sizeof (g_pbCodeSignCert)); - if (pCodeSignCert) - { - DWORD dwFlags = CERT_SYSTEM_STORE_LOCAL_MACHINE; - HCERTSTORE hStore = CertOpenStoreFn(CERT_STORE_PROV_SYSTEM, PKCS_7_ASN_ENCODING|X509_ASN_ENCODING, - NULL, dwFlags, L"TrustedPublisher"); - if (hStore) - { - CertAddCertificateContextToStoreFn(hStore, pCodeSignCert, CERT_STORE_ADD_NEW, NULL); - CertCloseStoreFn(hStore, 0); - } - CertFreeCertificateContextFn(pCodeSignCert); - } - } -} - void DoInstall (void *arg) { HWND hwndDlg = (HWND) arg; @@ -2541,11 +2283,6 @@ void DoInstall (void *arg) UpdateProgressBarProc(50); - if ((nCurrentOS == WIN_XP) || (nCurrentOS == WIN_XP64)) - { - AddCertificateToTrustedPublisher(); - } - // Remove deprecated DoServiceUninstall (hwndDlg, L"VeraCryptService"); @@ -2600,6 +2337,12 @@ void DoInstall (void *arg) if (bSystemRestore) SetSystemRestorePoint (hwndDlg, TRUE); + if (bOK && (bDisableMemoryProtection != bOriginalDisableMemoryProtection)) + { + WriteMemoryProtectionConfig(bDisableMemoryProtection? FALSE : TRUE); + bRestartRequired = TRUE; // Restart is required to apply the new memory protection settings + } + if (bOK) { UpdateProgressBarProc(100); @@ -2812,20 +2555,46 @@ typedef struct static tLanguageEntry g_languagesEntries[] = { {L"العربية", IDR_LANG_AR, LANG_ARABIC, "ar", NULL}, + {L"Беларуская", IDR_LANG_BE, LANG_BELARUSIAN, "be", NULL}, + {L"Български", IDR_LANG_BG, LANG_BULGARIAN, "bg", NULL}, + {L"Català", IDR_LANG_CA, LANG_CATALAN, "ca", NULL}, + {L"Corsu", IDR_LANG_CO, LANG_CORSICAN, "co", NULL}, {L"Čeština", IDR_LANG_CS, LANG_CZECH, "cs", NULL}, + {L"Dansk", IDR_LANG_DA, LANG_DANISH, "da", NULL}, {L"Deutsch", IDR_LANG_DE, LANG_GERMAN, "de", NULL}, + {L"Ελληνικά", IDR_LANG_EL, LANG_GREEK, "el", NULL}, {L"English", IDR_LANGUAGE, LANG_ENGLISH, "en", NULL}, {L"Español", IDR_LANG_ES, LANG_SPANISH, "es", NULL}, + {L"Eesti", IDR_LANG_ET, LANG_ESTONIAN, "et", NULL}, + {L"Euskara", IDR_LANG_EU, LANG_BASQUE, "eu", NULL}, + {L"فارسي", IDR_LANG_FA, LANG_PERSIAN, "fa", NULL}, + {L"Suomi", IDR_LANG_FI, LANG_FINNISH, "fi", NULL}, {L"Français", IDR_LANG_FR, LANG_FRENCH, "fr", NULL}, + {L"עברית", IDR_LANG_HE, LANG_HEBREW, "he", NULL}, + {L"Magyar", IDR_LANG_HU, LANG_HUNGARIAN, "hu", NULL}, + {L"Bahasa Indonesia", IDR_LANG_ID, LANG_INDONESIAN, "id", NULL}, {L"Italiano", IDR_LANG_IT, LANG_ITALIAN, "it", NULL}, {L"日本語", IDR_LANG_JA, LANG_JAPANESE, "ja", NULL}, + {L"ქართული", IDR_LANG_KA, LANG_GEORGIAN, "ka", NULL}, + {L"한국어", IDR_LANG_KO, LANG_KOREAN, "ko", NULL}, + {L"Latviešu", IDR_LANG_LV, LANG_LATVIAN, "lv", NULL}, {L"Nederlands", IDR_LANG_NL, LANG_DUTCH, "nl", NULL}, + {L"Norsk Nynorsk", IDR_LANG_NN, LANG_NORWEGIAN, "nn", NULL}, {L"Polski", IDR_LANG_PL, LANG_POLISH, "pl", NULL}, {L"Română", IDR_LANG_RO, LANG_ROMANIAN, "ro", NULL}, {L"Русский", IDR_LANG_RU, LANG_RUSSIAN, "ru", NULL}, + {L"Português-Brasil", IDR_LANG_PTBR, LANG_PORTUGUESE, "pt-br", L"pt-BR"}, + {L"Slovenčina", IDR_LANG_SK, LANG_SLOVAK, "sk", NULL}, + {L"Slovenščina", IDR_LANG_SL, LANG_SLOVENIAN, "sl", NULL}, + {L"Svenska", IDR_LANG_SV, LANG_SWEDISH, "sv", NULL}, + {L"ภาษาไทย", IDR_LANG_TH, LANG_THAI, "th", NULL}, + {L"Türkçe", IDR_LANG_TR, LANG_TURKISH, "tr", NULL}, + {L"Українська", IDR_LANG_UK, LANG_UKRAINIAN, "uk", NULL}, + {L"Ўзбекча", IDR_LANG_UZ, LANG_UZBEK, "uz", NULL}, {L"Tiếng Việt", IDR_LANG_VI, LANG_VIETNAMESE, "vi", NULL}, {L"简体中文", IDR_LANG_ZHCN, LANG_CHINESE, "zh-cn", L"zh-CN"}, - {L"繁體中文", IDR_LANG_ZHHK, LANG_CHINESE, "zh-hk", L"zh-HK"}, + {L"繁體中文(香港)", IDR_LANG_ZHHK, LANG_CHINESE, "zh-hk", L"zh-HK"}, + {L"繁體中文", IDR_LANG_ZHTW, LANG_CHINESE, "zh-tw", L"zh-TW"}, }; typedef int (WINAPI *LCIDToLocaleNameFn)( @@ -2988,7 +2757,6 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz if (IsAdmin () != TRUE) if (MessageBoxW (NULL, GetString ("SETUP_ADMIN"), lpszTitle, MB_YESNO | MB_ICONQUESTION) != IDYES) { - FinalizeApp (); exit (1); } #endif @@ -3005,7 +2773,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz { /* Create self-extracting package */ - MakeSelfExtractingPackage (NULL, SetupFilesDir); + MakeSelfExtractingPackage (NULL, SetupFilesDir, FALSE); } else { @@ -3041,7 +2809,6 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz #else MessageBox (NULL, L"Error: This portable installer file does not contain any compressed files.\n\nTo create a self-extracting portable installation package (with embedded compressed files), run:\n\"VeraCrypt Portable.exe\" /p", L"VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST); #endif - FinalizeApp (); exit (1); } @@ -3062,7 +2829,6 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz bUninstall = TRUE; break; default: - FinalizeApp (); exit (1); } } @@ -3088,7 +2854,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz if (!bUninstall) { - if (!bDevm && !LocalizationActive && (nCurrentOS >= WIN_VISTA)) + if (!bDevm && !LocalizationActive) { BOOL bHasPreferredLanguage = (strlen (GetPreferredLangId ()) > 0)? TRUE : FALSE; if ((IDCANCEL == DialogBoxParamW (hInstance, MAKEINTRESOURCEW (IDD_INSTALL_LANGUAGE), NULL, (DLGPROC) SelectLanguageDialogProc, (LPARAM) 0 )) @@ -3096,7 +2862,6 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz ) { // Language dialog cancelled by user: exit the installer - FinalizeApp (); exit (1); } } @@ -3133,6 +2898,5 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz } #endif } - FinalizeApp (); return 0; } diff --git a/src/Setup/Setup.h b/src/Setup/Setup.h index e38dd75a..70a04555 100644 --- a/src/Setup/Setup.h +++ b/src/Setup/Setup.h @@ -120,6 +120,8 @@ extern BOOL bReinstallMode; extern BOOL bSystemRestore; extern BOOL bDisableSwapFiles; extern BOOL bForAllUsers; +extern BOOL bDisableMemoryProtection; +extern BOOL bOriginalDisableMemoryProtection; extern BOOL bRegisterFileExt; extern BOOL bAddToStartMenu; extern BOOL bDesktopIcon; diff --git a/src/Setup/Setup.manifest b/src/Setup/Setup.manifest index afd4c1c0..abc1ef65 100644 --- a/src/Setup/Setup.manifest +++ b/src/Setup/Setup.manifest @@ -14,7 +14,13 @@ </asmv3:application> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> - <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> + <!-- Windows 10 and Windows 11 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> + <!-- Windows 8.1 --> + <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> + <!-- Windows 8 --> + <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> + <!-- Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> </application> </compatibility> diff --git a/src/Setup/Setup.rc b/src/Setup/Setup.rc index 1c055869..89457692 100644 --- a/src/Setup/Setup.rc +++ b/src/Setup/Setup.rc @@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,25,4,0 - PRODUCTVERSION 1,25,4,0 + FILEVERSION 1,26,10,0 + PRODUCTVERSION 1,26,10,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -46,11 +46,11 @@ BEGIN BEGIN VALUE "CompanyName", "IDRIX" VALUE "FileDescription", "VeraCrypt Setup" - VALUE "FileVersion", "1.25" + VALUE "FileVersion", "1.26.10" VALUE "LegalTrademarks", "VeraCrypt" VALUE "OriginalFilename", "VeraCrypt Setup.exe" VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.25" + VALUE "ProductVersion", "1.26.10" END END BLOCK "VarFileInfo" @@ -93,6 +93,32 @@ 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_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" ///////////////////////////////////////////////////////////////////////////// // @@ -120,12 +146,15 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN EDITTEXT IDC_DESTINATION,11,41,260,13,ES_AUTOHSCROLL PUSHBUTTON "Bro&wse...",IDC_BROWSE,278,40,59,14 - CONTROL "Install &for all users",IDC_ALL_USERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,77,168,11 + CONTROL "Install &for all users",IDC_ALL_USERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,68,168,11 + CONTROL "Add VeraCrypt to &Start menu",IDC_PROG_GROUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,80,168,11 + CONTROL "Add VeraCrypt icon to &desktop",IDC_DESKTOP_ICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,92,168,11 CONTROL "Associate the .hc file &extension with VeraCrypt",IDC_FILE_TYPE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,113,232,11 - CONTROL "Add VeraCrypt to &Start menu",IDC_PROG_GROUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,89,168,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,104,232,11 + CONTROL "Disable memory protection for Accessibility tools compatibility",IDC_DISABLE_MEMORY_PROTECTION, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,115,315,10 + PUSHBUTTON "?",IDC_DISABLE_MEMORY_PROTECTION_HELP,337,111,7,14 CONTROL "Create System &Restore point",IDC_SYSTEM_RESTORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,125,194,11 - CONTROL "Add VeraCrypt icon to &desktop",IDC_DESKTOP_ICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,101,168,11 LTEXT "Please select or type the location where you want to install the VeraCrypt program files. If the specified folder does not exist, it will be automatically created.",IDT_INSTALL_DESTINATION,11,14,319,25 END @@ -155,14 +184,14 @@ BEGIN PUSHBUTTON "",IDC_PREV,209,211,50,14 DEFPUSHBUTTON "",IDC_NEXT,259,211,50,14 PUSHBUTTON "Cancel",IDCANCEL,317,211,50,14 - LTEXT "",IDC_BOX_TITLE,11,5,324,12,0,WS_EX_TRANSPARENT + LTEXT "",IDC_BOX_TITLE,11,2,324,12,0,WS_EX_TRANSPARENT CONTROL 107,IDC_BITMAP_SETUP_WIZARD,"Static",SS_BITMAP | SS_NOTIFY,139,3,228,30 CONTROL 109,IDC_SETUP_WIZARD_BKG,"Static",SS_BITMAP,0,0,11,10 CONTROL "",IDC_SETUP_WIZARD_GFX_AREA,"Static",SS_GRAYRECT | NOT WS_VISIBLE,0,0,378,36,WS_EX_TRANSPARENT | WS_EX_STATICEDGE CONTROL "",IDC_HR_BOTTOM,"Static",SS_ETCHEDHORZ,67,204,306,1,WS_EX_STATICEDGE CONTROL "",IDC_HR,"Static",SS_ETCHEDHORZ,0,35,399,1,WS_EX_STATICEDGE LTEXT "VeraCrypt Installer",IDC_STATIC,4,200,62,8,WS_DISABLED - LTEXT "",IDC_BOX_INFO,18,18,317,13,0,WS_EX_TRANSPARENT + LTEXT "",IDC_BOX_INFO,18,15,317,16,0,WS_EX_TRANSPARENT LTEXT "",IDC_MAIN_CONTENT_CANVAS,0,36,374,164 LTEXT "",IDC_POS_BOX,14,42,346,155,0,WS_EX_TRANSPARENT END diff --git a/src/Setup/Setup.vcxproj b/src/Setup/Setup.vcxproj index 622e84ef..d1159c0b 100644 --- a/src/Setup/Setup.vcxproj +++ b/src/Setup/Setup.vcxproj @@ -91,7 +91,7 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>SETUP;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> @@ -105,10 +105,10 @@ </ClCompile> <Link> <AdditionalOptions>/NODEFAULTLIB:LIBCMTD %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>libcmtd.lib;atlsd.lib;mpr.lib;..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>libcmtd.lib;atlsd.lib;mpr.lib;..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;..\Common\Debug\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> <ProgramDatabaseFile>$(OutDir)Setup.pdb</ProgramDatabaseFile> <SubSystem>Windows</SubSystem> @@ -122,7 +122,7 @@ <PostBuildEvent> <Command>md "..\Debug\Setup Files" 2>NUL: copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt Setup.exe" >NUL: -copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NUL: + </Command> </PostBuildEvent> </ItemDefinitionGroup> @@ -130,7 +130,7 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>SETUP;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> @@ -144,10 +144,10 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>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> @@ -168,7 +168,7 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> - <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>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)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <BufferSecurityCheck>true</BufferSecurityCheck> @@ -182,10 +182,10 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>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> @@ -199,14 +199,14 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> </Manifest> <PostBuildEvent> - <Command>copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt Setup.exe" && copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt COMReg.exe"</Command> + <Command>copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt Setup.exe"</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;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <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> @@ -220,10 +220,10 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>mpr.lib;..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>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> @@ -326,6 +326,9 @@ copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt COMReg.exe" >NU <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> + <ProjectReference Include="..\Common\Lzma.vcxproj"> + <Project>{b896fe1f-6bf3-4f75-9148-f841829073d9}</Project> + </ProjectReference> <ProjectReference Include="..\ExpandVolume\ExpandVolume.vcxproj"> <Project>{9715ff1d-599b-4bbc-ad96-bef6e08ff827}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c index 7de3ef0c..abf76f69 100644 --- a/src/Setup/Wizard.c +++ b/src/Setup/Wizard.c @@ -45,8 +45,8 @@ enum wizard_pages HWND hCurPage = NULL; /* Handle to current wizard page */ int nCurPageNo = -1; /* The current wizard page */ -wchar_t WizardDestInstallPath [TC_MAX_PATH]; -wchar_t WizardDestExtractPath [TC_MAX_PATH]; +wchar_t WizardDestInstallPath [TC_MAX_PATH] = { 0 }; +wchar_t WizardDestExtractPath [TC_MAX_PATH] = { 0 }; wchar_t SelfFile [TC_MAX_PATH]; HBITMAP hbmWizardBitmapRescaled = NULL; @@ -212,6 +212,7 @@ static int GetDonVal (int minVal, int maxVal) BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static char PageDebugId[128]; + static HWND hDisableMemProtectionTooltipWnd = NULL; WORD lw = LOWORD (wParam); WORD hw = HIWORD (wParam); @@ -439,9 +440,16 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa EnableWindow (GetDlgItem (hwndDlg, IDC_SYSTEM_RESTORE), FALSE); } + hDisableMemProtectionTooltipWnd = CreateToolTip (IDC_DISABLE_MEMORY_PROTECTION, hwndDlg, "DISABLE_MEMORY_PROTECTION_WARNING"); + // make IDC_DISABLE_MEMORY_PROTECTION control fit the text so that the tooltip is shown only when mouse is over the text + AccommodateCheckBoxTextWidth(hwndDlg, IDC_DISABLE_MEMORY_PROTECTION); + // make the help button adjacent to the checkbox + MakeControlsContiguous(hwndDlg, IDC_DISABLE_MEMORY_PROTECTION, IDC_DISABLE_MEMORY_PROTECTION_HELP); + SetCheckBox (hwndDlg, IDC_ALL_USERS, bForAllUsers); SetCheckBox (hwndDlg, IDC_FILE_TYPE, bRegisterFileExt); SetCheckBox (hwndDlg, IDC_PROG_GROUP, bAddToStartMenu); + SetCheckBox (hwndDlg, IDC_DISABLE_MEMORY_PROTECTION, bDisableMemoryProtection); SetCheckBox (hwndDlg, IDC_DESKTOP_ICON, bDesktopIcon); SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString (bUpgrade ? "UPGRADE" : "INSTALL")); @@ -646,7 +654,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa switch (lw) { case IDC_BROWSE: - if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath)) + if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestExtractPath, WizardDestExtractPath)) { if (WizardDestExtractPath [wcslen(WizardDestExtractPath)-1] != L'\\') { @@ -667,7 +675,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa switch (lw) { case IDC_BROWSE: - if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath)) + if (BrowseDirectories (hwndDlg, "SELECT_DEST_DIR", WizardDestInstallPath, WizardDestInstallPath)) { if (WizardDestInstallPath [wcslen(WizardDestInstallPath)-1] != L'\\') { @@ -685,6 +693,18 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa bForAllUsers = IsButtonChecked (GetDlgItem (hCurPage, IDC_ALL_USERS)); return 1; + case IDC_DISABLE_MEMORY_PROTECTION: + bDisableMemoryProtection = IsButtonChecked (GetDlgItem (hCurPage, IDC_DISABLE_MEMORY_PROTECTION)); + if (bDisableMemoryProtection) + { + Warning ("DISABLE_MEMORY_PROTECTION_WARNING", hwndDlg); + } + return 1; + + case IDC_DISABLE_MEMORY_PROTECTION_HELP: + Applink("memoryprotection"); + return 1; + case IDC_FILE_TYPE: bRegisterFileExt = IsButtonChecked (GetDlgItem (hCurPage, IDC_FILE_TYPE)); return 1; @@ -760,6 +780,16 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa } return 0; + case WM_DESTROY: + + if (hDisableMemProtectionTooltipWnd != NULL) + { + DestroyWindow (hDisableMemProtectionTooltipWnd); + hDisableMemProtectionTooltipWnd = NULL; + } + + break; + } return 0; @@ -853,6 +883,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa DonColorSchemeId = GetDonVal (2, 9); + // get the initial value of bDisableMemoryProtection by reading the registry + bDisableMemoryProtection = bOriginalDisableMemoryProtection = ReadMemoryProtectionConfig()? FALSE : TRUE; + if (bDevm) { InitWizardDestInstallPath (); |