From 74f60367575de4a2a5742fe833053afc3d4a5819 Mon Sep 17 00:00:00 2001 From: Jochen Tucht Date: Sun, 16 May 2010 14:44:19 +0000 Subject: [PATCH] =?utf8?q?=E2=80=A2=20Read=207-Zip=20version=20from=207z.d?= =?utf8?q?ll=20(which=20has=20long=20ago=20replaced=20the=20various=20form?= =?utf8?q?at=20and=20codec=20DLLs)=20=E2=80=A2=20Change=20recommended=20ve?= =?utf8?q?rsion=20of=207-Zip=20to=204.65?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Src/7zCommon.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Src/7zCommon.cpp b/Src/7zCommon.cpp index 61b78fb0b..f6291ee0b 100644 --- a/Src/7zCommon.cpp +++ b/Src/7zCommon.cpp @@ -89,6 +89,9 @@ DATE: BY: DESCRIPTION: 2007-06-16 Jochen Neubeck FIX [1723263] "Zip --> Both" operation... 2007-12-22 Jochen Neubeck Fix Merge7z UI lang for new translation system Change recommended version of 7-Zip to 4.57 +2010-05-16 Jochen Neubeck Read 7-Zip version from 7z.dll (which has long + ago replaced the various format and codec DLLs) + Change recommended version of 7-Zip to 4.65 */ // ID line follows -- this is updated by SVN @@ -102,7 +105,7 @@ DATE: BY: DESCRIPTION: #include "MainFrm.h" #include "7zCommon.h" //#include "ExternalArchiveFormat.h" -#include "markdown.h" +#include "version.h" #include #include #include @@ -212,7 +215,7 @@ protected: /** * @brief Recommended version of 7-Zip. */ -const DWORD C7ZipMismatchException::m_dwVer7zRecommended = DWORD MAKELONG(57,4); +const DWORD C7ZipMismatchException::m_dwVer7zRecommended = DWORD MAKELONG(65,4); /** * @brief Registry key for C7ZipMismatchException's ReportError() popup. @@ -604,8 +607,8 @@ CString NTAPI GetClearTempPath(LPVOID pOwner, LPCTSTR pchExt) CString strPath; strPath.Format ( - pOwner ? _T("%sWINMERGE.%08lX\\%08lX.%s") : _T("%sWINMERGE.%08lX"), - env_GetTempPath(), GetCurrentProcessId(), pOwner, pchExt + pOwner ? _T("%s\\%08lX.7z%s") : _T("%s"), + env_GetTempPath(), pOwner, pchExt ); // SHFileOperation expects a ZZ terminated list of paths! int cchPath = strPath.GetLength(); @@ -646,20 +649,11 @@ DWORD NTAPI VersionOf7z(BOOL bLocal) DWORD size = sizeof path; SHGetValue(HKEY_LOCAL_MACHINE, szSubKey, szValue, &type, path, &size); } - PathAppend(path, _T("7zip_pad.xml")); - CMarkdown::String version - ( - CMarkdown::File(path) - .Move("XML_DIZ_INFO").Pop() - .Move("Program_Info").Pop() - .Move("Program_Version").GetInnerText() - ); - DWORD ver = (WORD)StrToIntA(version.A) << 16; - if (LPSTR p = StrChrA(version.A, '.')) - { - ver |= (WORD)StrToIntA(p + 1); - } - return ver; + PathAppend(path, _T("7z.dll")); + DWORD versionMS = 0; + DWORD versionLS = 0; + CVersionInfo(path).GetFixedFileVersion(versionMS, versionLS); + return versionMS; } /** -- 2.11.0