From a7d62ddc856e55582e5cd86070abde7d045455c3 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Mon, 22 Nov 2010 01:51:38 +0000 Subject: Added ability to update in directories protected by UAC git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@577 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/scan.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'updater/scan.cpp') diff --git a/updater/scan.cpp b/updater/scan.cpp index 6296743..fc5db50 100644 --- a/updater/scan.cpp +++ b/updater/scan.cpp @@ -45,24 +45,19 @@ void ScanPlugins(FilenameMap *fn_map, UpdateList *update_list) { if (!XMLDataAvailable(MC_PLUGINS)) return; - TCHAR mir_exe[MAX_PATH], plugins_folder[MAX_PATH], - dll_path[MAX_PATH]; + TCHAR plugins_folder[MAX_PATH], dll_path[MAX_PATH]; TCHAR *dll_name; Miranda_Plugin_Info dll_info_func; Miranda_Plugin_Info_Ex dll_info_func_ex; DWORD mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0); PLUGININFO *pluginInfo; - GetModuleFileName(NULL, mir_exe, MAX_PATH); - - // get plugin folder - _tcscpy(plugins_folder, mir_exe); - TCHAR *p = _tcsrchr(plugins_folder, _T('\\')); - if(p) *p = 0; + GetRootDir(plugins_folder); _tcscat(plugins_folder, _T("\\Plugins")); _tcscpy(dll_path, plugins_folder); _tcscat(dll_path, _T("\\")); + // set dll_name to point into the dll_path string, at the point where we can write the plugin name // to end up with the full dll path dll_name = dll_path + _tcslen(dll_path); @@ -194,12 +189,7 @@ void ScanLangpacks(FilenameMap *fn_map, UpdateList *update_list) TCHAR mir_folder[MAX_PATH], langpack_path[MAX_PATH], *langpack_name; - GetModuleFileName(NULL, mir_folder, MAX_PATH); - - // get program folder - TCHAR *p = _tcsrchr(mir_folder, '\\'); if(p) *p = 0; - _tcscat(mir_folder, _T("\\")); - + GetRootDir(mir_folder); _tcscat(mir_folder, _T("\\")); _tcscpy(langpack_path, mir_folder); // set langpack_name to point into the langpack_name string, at the point where we can write the file name -- cgit v1.2.3