Plugin list updater (in progress)

This commit is contained in:
Don HO 2019-10-13 21:48:27 +02:00
parent 45d4c8d35c
commit a739eade8e
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
5 changed files with 36 additions and 5 deletions

View File

@ -241,18 +241,25 @@ public:
std::vector<generic_string> addNppComponents(const TCHAR *destDir, const TCHAR *extFilterName, const TCHAR *extFilter); std::vector<generic_string> addNppComponents(const TCHAR *destDir, const TCHAR *extFilterName, const TCHAR *extFilter);
std::vector<generic_string> addNppPlugins(const TCHAR *extFilterName, const TCHAR *extFilter); std::vector<generic_string> addNppPlugins(const TCHAR *extFilterName, const TCHAR *extFilter);
int getHtmlXmlEncoding(const TCHAR *fileName) const; int getHtmlXmlEncoding(const TCHAR *fileName) const;
HACCEL getAccTable() const{ HACCEL getAccTable() const{
return _accelerator.getAccTable(); return _accelerator.getAccTable();
} };
bool emergency(const generic_string& emergencySavedDir); bool emergency(const generic_string& emergencySavedDir);
Buffer* getCurrentBuffer() { Buffer* getCurrentBuffer() {
return _pEditView->getCurrentBuffer(); return _pEditView->getCurrentBuffer();
} };
void launchDocumentBackupTask(); void launchDocumentBackupTask();
int getQuoteIndexFrom(const wchar_t* quoter) const; int getQuoteIndexFrom(const wchar_t* quoter) const;
void showQuoteFromIndex(int index) const; void showQuoteFromIndex(int index) const;
void showQuote(const QuoteParams* quote) const; void showQuote(const QuoteParams* quote) const;
generic_string getPluginListVerStr() const {
return _pluginsAdminDlg.getPluginListVerStr();
};
private: private:
Notepad_plus_Window *_pPublicInterface = nullptr; Notepad_plus_Window *_pPublicInterface = nullptr;

View File

@ -92,6 +92,11 @@ public:
_isPrelaunch = val; _isPrelaunch = val;
} }
generic_string getPluginListVerStr() const
{
return _notepad_plus_plus_core.getPluginListVerStr();
}
virtual void destroy() virtual void destroy()
{ {
::DestroyWindow(_hSelf); ::DestroyWindow(_hSelf);

View File

@ -439,6 +439,13 @@ PluginsAdminDlg::PluginsAdminDlg()
#endif #endif
} }
generic_string PluginsAdminDlg::getPluginListVerStr() const
{
Version v;
v.setVersionFrom(_pluginListFullPath);
return v.toString();
}
bool PluginsAdminDlg::exitToInstallRemovePlugins(Operation op, const vector<PluginUpdateInfo*>& puis) bool PluginsAdminDlg::exitToInstallRemovePlugins(Operation op, const vector<PluginUpdateInfo*>& puis)
{ {
generic_string opStr; generic_string opStr;

View File

@ -207,6 +207,7 @@ public :
void changeTabName(LIST_TYPE index, const TCHAR *name2change); void changeTabName(LIST_TYPE index, const TCHAR *name2change);
void changeColumnName(COLUMN_TYPE index, const TCHAR *name2change); void changeColumnName(COLUMN_TYPE index, const TCHAR *name2change);
generic_string getPluginListVerStr() const;
protected: protected:
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -570,12 +570,23 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
if (doUpdatePluginList) if (doUpdatePluginList)
{ {
// Update Plugin List // Update Plugin List
updaterParams += TEXT(" -upPL"); generic_string upPlParams = TEXT("-v");
upPlParams += notepad_plus_plus.getPluginListVerStr();
if (nppParameters.isx64())
{
upPlParams += TEXT(" -px64");
}
upPlParams += TEXT(" -upZip");
// overrided "InfoUrl" in gup.xml // overrided "InfoUrl" in gup.xml
updaterParams += TEXT(" https://notepad-plus-plus.org/update/pluginListDownloadUrl.php"); upPlParams += TEXT(" https://notepad-plus-plus.org/update/pluginListDownloadUrl.php");
Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str()); // indicate the pluginList installation location
upPlParams += nppParameters.getPluginConfDir();
Process updater(updaterFullPath.c_str(), upPlParams.c_str(), updaterDir.c_str());
updater.run(); updater.run();
// TODO: Update next update date // TODO: Update next update date