diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-02 15:18:50 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-02 15:18:50 +0000 |
commit | 5174b6de32477883b4efe1235643c9faa273521b (patch) | |
tree | 629bc2ebc0cdbebac343cafd14066d8b0253a6bb /plugins/Db3x_mmap/src/dbheaders.cpp | |
parent | 547af691ad60fb3935075f033343bb870dfba464 (diff) |
finally wiping all obsolete stuff from 0.95
git-svn-id: http://svn.miranda-ng.org/main/trunk@9644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbheaders.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbheaders.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index 102fd56fac..8f39fada64 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -52,19 +52,41 @@ int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static TCHAR tszOldHeaders[] = _T("Miranda cannot open the obsolete database. Press Yes to download a solution or No to cancel");
+
int CDb3Mmap::CheckDbHeaders()
{
- if (memcmp(m_dbHeader.signature, &dbSignatureU, sizeof(m_dbHeader.signature)) &&
- memcmp(m_dbHeader.signature, &dbSignatureE, sizeof(m_dbHeader.signature)) &&
- memcmp(m_dbHeader.signature, &dbSignatureIM, sizeof(m_dbHeader.signature)))
+ if (memcmp(m_dbHeader.signature, &dbSignatureU, sizeof(m_dbHeader.signature)) &&
+ memcmp(m_dbHeader.signature, &dbSignatureE, sizeof(m_dbHeader.signature)))
+ {
+ if (!memcmp(&m_dbHeader.signature, &dbSignatureIM, sizeof(m_dbHeader.signature)) ||
+ !memcmp(&m_dbHeader.signature, &dbSignatureSA, sizeof(m_dbHeader.signature)) ||
+ !memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature)))
+ {
+ if (IDYES == MessageBox(NULL, TranslateTS(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONHAND)) {
+ TCHAR tszCurPath[MAX_PATH];
+ GetModuleFileName(NULL, tszCurPath, SIZEOF(tszCurPath));
+
+ HKEY hPathSetting;
+ if (!RegCreateKey(HKEY_CURRENT_USER, _T("Software\\Miranda NG"), &hPathSetting)) {
+ RegSetValue(hPathSetting, _T("InstallPath"), REG_SZ, tszCurPath, sizeof(tszCurPath));
+ RegCloseKey(hPathSetting);
+ }
+
+ CallService(MS_UTILS_OPENURL, 0, LPARAM("http://wiki.miranda-ng.org/index.php?title=Updating_pre-0.94.9_version_to_0.95.1_and_later"));
+ exit(0);
+ }
+ }
return EGROKPRF_UNKHEADER;
+ }
switch (m_dbHeader.version) {
case DB_095_1_VERSION:
case DB_095_VERSION:
- case DB_094_VERSION:
- case DB_OLD_VERSION:
break;
+
default:
return EGROKPRF_VERNEWER;
}
|