diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-03-17 05:38:23 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-03-17 05:38:23 +0000 |
commit | 797493a321a7801fee5d4f93da7a4501b320113f (patch) | |
tree | 5f9f19ad4ce2443044b0c5636ebcbcaa93346a02 | |
parent | 2cabfb19bccf822c5bc42573d302d7694168f2a1 (diff) |
Restored operation under 32 bit Windows
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@480 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | updater/extern.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/updater/extern.cpp b/updater/extern.cpp index 39277ed..915067d 100644 --- a/updater/extern.cpp +++ b/updater/extern.cpp @@ -93,7 +93,7 @@ int ExternProcess(bool restart) { }
*/
- TCHAR szParams[MAX_PATH], szBuf[MAX_PATH];
+ TCHAR szParams[MAX_PATH], szBuf[MAX_PATH], *szProcDir;
// try to fire up external process from new dll (if present), so we can overwrite the old one
_tcscpy(szBuf, options.temp_folder);
@@ -121,13 +121,16 @@ int ExternProcess(bool restart) { #ifdef _WIN64
mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE \"%s\",ExternalUpdate %s"), szBuf, data_filename);
+ szProcDir = NULL;
#else
p = _tcsrchr(szBuf, _T('\\'));
if (p) *p = 0;
+ szProcDir = szBuf;
// rundll32 hates spaces in the <dll name> 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);
@@ -143,7 +146,7 @@ int ExternProcess(bool restart) { if(!CreateProcess(0, szParams, 0, 0, 0,
CREATE_NO_WINDOW | DETACHED_PROCESS | NORMAL_PRIORITY_CLASS,
- 0, NULL, &si, &pi))
+ 0, szProcDir, &si, &pi))
{
int err = GetLastError();
TCHAR msg[256];
|