diff --git a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp index f1136d3b..3949ba59 100644 --- a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp +++ b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp @@ -418,30 +418,50 @@ vector PluginViewList::fromUiIndexesToPluginInfos(const std:: PluginsAdminDlg::PluginsAdminDlg() { + // Get wingup path NppParameters *pNppParameters = NppParameters::getInstance(); _updaterDir = pNppParameters->getNppPath(); PathAppend(_updaterDir, TEXT("updater")); - _updaterFullPath = _updaterDir; PathAppend(_updaterFullPath, TEXT("gup.exe")); + // get plugin-list path + _pluginListFullPath = getPluginConfigPath(); + #ifdef DEBUG // if not debug, then it's release - // load from nppPluginList.json instead of nppPluginList.dll - _pluginListFullPath = TEXT("C:\\tmp\\nppPluginList.json"); - + PathAppend(_pluginListFullPath, TEXT("nppPluginList.json")); #else //RELEASE - -#ifdef _WIN64 - _pluginListFullPath = TEXT("C:\\sources\\nppPluginList\\vcxproj\\x64\\Debug\\nppPluginList.dll"); -#else - _pluginListFullPath = TEXT("C:\\sources\\nppPluginList\\vcxproj\\Debug\\nppPluginList.dll"); -#endif - + PathAppend(_pluginListFullPath, TEXT("nppPluginList.dll")); #endif ; } +generic_string PluginsAdminDlg::getPluginConfigPath() const +{ + NppParameters *pNppParameters = NppParameters::getInstance(); + generic_string nppPluginsConfDir; + + if (pNppParameters->isLocal()) + { + nppPluginsConfDir = pNppParameters->getNppPath(); + } + else + { + nppPluginsConfDir = pNppParameters->getAppDataNppDir(); + } + + PathAppend(nppPluginsConfDir, TEXT("plugins")); + PathAppend(nppPluginsConfDir, TEXT("Config")); + + if (!::PathFileExists(nppPluginsConfDir.c_str())) + { + ::CreateDirectory(nppPluginsConfDir.c_str(), NULL); + } + + return nppPluginsConfDir; +} + generic_string PluginsAdminDlg::getPluginsPath() const { NppParameters *pNppParameters = NppParameters::getInstance(); diff --git a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.h b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.h index 53dc4ed0..6624c0fb 100644 --- a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.h +++ b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.h @@ -183,6 +183,7 @@ public : bool updateListAndLoadFromJson(); void setAdminMode(bool isAdm) { _nppCurrentStatus._isAdminMode = isAdm; }; generic_string getPluginsPath() const; + generic_string getPluginConfigPath() const; bool installPlugins(); bool updatePlugins();