summaryrefslogtreecommitdiff
path: root/updater/scan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'updater/scan.cpp')
-rw-r--r--updater/scan.cpp18
1 files changed, 4 insertions, 14 deletions
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