From 2cabfb19bccf822c5bc42573d302d7694168f2a1 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Wed, 17 Mar 2010 01:36:33 +0000 Subject: Restored operation under 32 bit Windows git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@479 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/extern.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'updater/extern.cpp') diff --git a/updater/extern.cpp b/updater/extern.cpp index 68b572a..39277ed 100644 --- a/updater/extern.cpp +++ b/updater/extern.cpp @@ -119,14 +119,23 @@ int ExternProcess(bool restart) { GetModuleFileName(hInst, szBuf, MAX_PATH); } -// p = _tcsrchr(szBuf, _T('\\')); -// if (p) *p = 0; +#ifdef _WIN64 + mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE \"%s\",ExternalUpdate %s"), szBuf, data_filename); +#else + p = _tcsrchr(szBuf, _T('\\')); + if (p) *p = 0; // rundll32 hates spaces in the arg, but quotes aren't allowed in earlier versions... // GetShortPath can return paths with spaces (at least on XP with 8.3 filenames disabled)... // so we must 'CreateProcess' with the updater.dll location as the startup directory and pass only updater.dll as the arg +#ifdef _MSC_VER + // MSVC exports differently than gcc/mingw + _stprintf(szParams, _T("RUNDLL32.EXE .\\updater.dll,_ExternalUpdate@16 %s"), data_filename); +#else + _stprintf(szParams, _T("RUNDLL32.EXE .\\updater.dll,ExternalUpdate@16 %s"), data_filename); +#endif - mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE \"%s\",ExternalUpdate %s"), szBuf, data_filename); +#endif PROCESS_INFORMATION pi = {0}; STARTUPINFO si = {0}; -- cgit v1.2.3