diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-03-18 05:44:32 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-03-18 05:44:32 +0000 |
commit | 11b48bfe6ed42439ae6ce47889b78caf92f2eaa5 (patch) | |
tree | c742535502d2d2e75363a1df815c270d1cbc7e26 /updater/extern.cpp | |
parent | 797493a321a7801fee5d4f93da7a4501b320113f (diff) |
Fixed projects
Restored cross compiler portability (should work now regardless of a compiler)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@481 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'updater/extern.cpp')
-rw-r--r-- | updater/extern.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/updater/extern.cpp b/updater/extern.cpp index 915067d..565ba63 100644 --- a/updater/extern.cpp +++ b/updater/extern.cpp @@ -119,26 +119,23 @@ int ExternProcess(bool restart) { GetModuleFileName(hInst, szBuf, MAX_PATH);
}
-#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;
+ if (IsWinVerXPPlus())
+ {
+ 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
+ // 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);
-#else
- _stprintf(szParams, _T("RUNDLL32.EXE .\\updater.dll,ExternalUpdate@16 %s"), data_filename);
-#endif
-
-#endif
+ mir_sntprintf(szParams, SIZEOF(szParams), _T("RUNDLL32.EXE .\\updater.dll,ExternalUpdate %s"), data_filename);
+ }
PROCESS_INFORMATION pi = {0};
STARTUPINFO si = {0};
|