diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-23 01:35:02 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-23 01:35:02 +0000 |
commit | e6ccc491112a9183d7ed9249c17f5f00283b4bf5 (patch) | |
tree | 0aced8418166608471b6a22ff66c4977bf2728b5 | |
parent | 56e3be2de31fb7c0d41c04e162677b7b16c73df0 (diff) |
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
-rw-r--r-- | updater/updater.cpp | 23 | ||||
-rw-r--r-- | updater/version.h | 2 |
2 files changed, 24 insertions, 1 deletions
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
|