mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 06:45:27 +02:00
Plugins Admin (in progress)
This commit is contained in:
parent
c97b35c815
commit
3101a2f395
@ -691,7 +691,6 @@ bool FileManager::deleteFile(BufferID id)
|
|||||||
|
|
||||||
if (!PathFileExists(fileNamePath.c_str()))
|
if (!PathFileExists(fileNamePath.c_str()))
|
||||||
return false;
|
return false;
|
||||||
//return ::DeleteFile(fileNamePath) != 0;
|
|
||||||
|
|
||||||
SHFILEOPSTRUCT fileOpStruct = {0};
|
SHFILEOPSTRUCT fileOpStruct = {0};
|
||||||
fileOpStruct.hwnd = NULL;
|
fileOpStruct.hwnd = NULL;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "pluginsAdmin.h"
|
#include "pluginsAdmin.h"
|
||||||
#include "ScintillaEditView.h"
|
#include "ScintillaEditView.h"
|
||||||
#include "localization.h"
|
#include "localization.h"
|
||||||
|
#include "Processus.h"
|
||||||
#include "PluginsManager.h"
|
#include "PluginsManager.h"
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
|
|
||||||
@ -351,9 +352,30 @@ void PluginsAdminDlg::collectNppCurrentStatusInfos()
|
|||||||
bool PluginsAdminDlg::installPlugins()
|
bool PluginsAdminDlg::installPlugins()
|
||||||
{
|
{
|
||||||
vector<size_t> indexes = _availableListView.getCheckedIndexes();
|
vector<size_t> indexes = _availableListView.getCheckedIndexes();
|
||||||
|
|
||||||
|
NppParameters *pNppParameters = NppParameters::getInstance();
|
||||||
|
generic_string updaterDir = pNppParameters->getNppPath();
|
||||||
|
updaterDir += TEXT("\\updater\\");
|
||||||
|
|
||||||
|
generic_string updaterFullPath = updaterDir + TEXT("gup.exe");
|
||||||
|
generic_string updaterParams = TEXT("-unzipTo -clean ");
|
||||||
|
|
||||||
for (auto i : indexes)
|
for (auto i : indexes)
|
||||||
{
|
{
|
||||||
printStr(_availablePluginList[i]._name .c_str());
|
//printStr(_availablePluginList[i]._name .c_str());
|
||||||
|
|
||||||
|
// add folder to operate
|
||||||
|
generic_string destFolder = pNppParameters->getAppDataNppDir();
|
||||||
|
PathAppend(destFolder, _availablePluginList[i]._name);
|
||||||
|
|
||||||
|
updaterParams += destFolder;
|
||||||
|
|
||||||
|
// add zipFile's url
|
||||||
|
updaterParams += TEXT(" ");
|
||||||
|
updaterParams += _availablePluginList[i]._repository;
|
||||||
|
|
||||||
|
Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str());
|
||||||
|
updater.run();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -361,9 +383,28 @@ bool PluginsAdminDlg::installPlugins()
|
|||||||
bool PluginsAdminDlg::updatePlugins()
|
bool PluginsAdminDlg::updatePlugins()
|
||||||
{
|
{
|
||||||
vector<size_t> indexes = _updateListView.getCheckedIndexes();
|
vector<size_t> indexes = _updateListView.getCheckedIndexes();
|
||||||
|
|
||||||
|
NppParameters *pNppParameters = NppParameters::getInstance();
|
||||||
|
generic_string updaterDir = pNppParameters->getNppPath();
|
||||||
|
updaterDir += TEXT("\\updater\\");
|
||||||
|
|
||||||
|
generic_string updaterFullPath = updaterDir + TEXT("gup.exe");
|
||||||
|
generic_string updaterParams = TEXT("-unzipTo -clean ");
|
||||||
|
|
||||||
for (auto i : indexes)
|
for (auto i : indexes)
|
||||||
{
|
{
|
||||||
printStr(_updatePluginList[i]._fullFilePath.c_str());
|
// add folder to operate
|
||||||
|
generic_string destFolder = pNppParameters->getAppDataNppDir();
|
||||||
|
PathAppend(destFolder, _availablePluginList[i]._name);
|
||||||
|
|
||||||
|
updaterParams += destFolder;
|
||||||
|
|
||||||
|
// add zipFile's url
|
||||||
|
updaterParams += TEXT(" ");
|
||||||
|
updaterParams += _availablePluginList[i]._repository;
|
||||||
|
|
||||||
|
Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str());
|
||||||
|
updater.run();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -371,9 +412,26 @@ bool PluginsAdminDlg::updatePlugins()
|
|||||||
bool PluginsAdminDlg::removePlugins()
|
bool PluginsAdminDlg::removePlugins()
|
||||||
{
|
{
|
||||||
vector<size_t> indexes = _installedListView.getCheckedIndexes();
|
vector<size_t> indexes = _installedListView.getCheckedIndexes();
|
||||||
|
|
||||||
|
NppParameters *pNppParameters = NppParameters::getInstance();
|
||||||
|
generic_string updaterDir = pNppParameters->getNppPath();
|
||||||
|
updaterDir += TEXT("\\updater\\");
|
||||||
|
|
||||||
|
generic_string updaterFullPath = updaterDir + TEXT("gup.exe");
|
||||||
|
generic_string updaterParams = TEXT("-clean ");
|
||||||
|
|
||||||
for (auto i : indexes)
|
for (auto i : indexes)
|
||||||
{
|
{
|
||||||
printStr(_installedPluginList[i]._fullFilePath.c_str());
|
//printStr(_installedPluginList[i]._fullFilePath.c_str());
|
||||||
|
|
||||||
|
// add folder to operate
|
||||||
|
generic_string destFolder = pNppParameters->getAppDataNppDir();
|
||||||
|
PathAppend(destFolder, _availablePluginList[i]._name);
|
||||||
|
|
||||||
|
updaterParams += destFolder;
|
||||||
|
|
||||||
|
Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str());
|
||||||
|
updater.run();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user