From e6ccc491112a9183d7ed9249c17f5f00283b4bf5 Mon Sep 17 00:00:00 2001 From: sje Date: Mon, 23 Jul 2007 01:35:02 +0000 Subject: added check for correct version - ansi or unicode git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@301 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/updater.cpp | 23 +++++++++++++++++++++++ updater/version.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/updater/updater.cpp b/updater/updater.cpp index aa7aabe..c5d19a7 100644 --- a/updater/updater.cpp +++ b/updater/updater.cpp @@ -85,6 +85,7 @@ void DeinitNetlib() { HANDLE hEventIdleChanged; int ModulesLoaded(WPARAM wParam, LPARAM lParam) { + LoadOptions(); /* @@ -221,6 +222,28 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { pluginLink = link; + char szVer[128]; + bool unicode_system = (CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(szVer), (LPARAM)szVer) == 0 && strstr(szVer, "Unicode")); +#ifdef _UNICODE + if(!unicode_system) { + TCHAR fp[256], *fn; + GetModuleFileName(hInst, fp, 256); + fn = _tcsrchr(fp, '\\'); + if(fn) fn++; + MessageBox(0, TranslateT("You are using the wrong version of this plugin.\nPlease download the NON-UNICODE version.\nPlugin disabled."), fn, MB_OK); + return 1; + } +#else + if(unicode_system) { + TCHAR fp[256], *fn; + GetModuleFileName(hInst, fp, 256); + fn = _tcsrchr(fp, '\\'); + if(fn) fn++; + MessageBox(0, TranslateT("You are using the wrong version of this plugin.\nPlease download the UNICODE version.\nPlugin disabled."), fn, MB_OK); + return 1; + } +#endif + mainThreadId = GetCurrentThreadId(); DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 ); diff --git a/updater/version.h b/updater/version.h index 9c5353a..6f23f4a 100644 --- a/updater/version.h +++ b/updater/version.h @@ -5,7 +5,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 5 #define __RELEASE_NUM 2 -#define __BUILD_NUM 3 +#define __BUILD_NUM 4 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM #define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -- cgit v1.2.3