From b8cff0aaaabe04a00756e01831f9ecdb9b61ae59 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 22 Feb 2025 14:28:53 +0200 Subject: =?UTF-8?q?fixes=20#4883=20(PluginUpdater=20=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=D0=B2=D0=BB=D0=B8=D0=B2=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=B2=D1=81=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BF?= =?UTF-8?q?=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/PluginUpdater/src/DlgListNew.cpp | 27 +++++++++++++++++++-------- plugins/PluginUpdater/src/version.h | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 2ac37ce98d..7a15dd5a34 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -294,6 +294,17 @@ public: FillList(); } + bool DownloadUpdate(FILEINFO *p, HNETLIBCONN nlc, TFileName wszBackupFolder) + { + if (DownloadFile(&p->File, nlc) != ERROR_SUCCESS) + return false; + + if (!unzip(p->File.wszDiskPath, g_mirandaPath, wszBackupFolder, false)) + PU::SafeDeleteFile(p->File.wszDiskPath); // remove .zip after successful update + db_unset(0, DB_MODULE_NEW_FILES, _T2A(p->wszOldName)); + return true; + } + void Unpack() { // create needed folders after escalating priviledges. Folders creates when we actually install updates @@ -303,21 +314,21 @@ public: HNETLIBCONN nlc = nullptr; int i = 0; for (auto &p : *todo) { - if (p->IsFiltered(m_wszFilter)) + if (p->IsFiltered(m_wszFilter)) { + // this update is hidden from screen, so we do not update anything + if (p->bEnabled) + DownloadUpdate(p, nlc, wszBackupFolder); continue; + } m_list.EnsureVisible(i, FALSE); if (p->bEnabled) { // download update m_list.SetItemText(i, 1, TranslateT("Downloading...")); - - if (DownloadFile(&p->File, nlc) == ERROR_SUCCESS) { + if (DownloadUpdate(p, nlc, wszBackupFolder)) m_list.SetItemText(i, 1, TranslateT("Succeeded.")); - if (!unzip(p->File.wszDiskPath, g_mirandaPath, wszBackupFolder, false)) - PU::SafeDeleteFile(p->File.wszDiskPath); // remove .zip after successful update - db_unset(0, DB_MODULE_NEW_FILES, _T2A(p->wszOldName)); - } - else m_list.SetItemText(i, 1, TranslateT("Failed!")); + else + m_list.SetItemText(i, 1, TranslateT("Failed!")); } else m_list.SetItemText(i, 1, TranslateT("Skipped.")); i++; diff --git a/plugins/PluginUpdater/src/version.h b/plugins/PluginUpdater/src/version.h index f1a433408d..dde05d4a1f 100644 --- a/plugins/PluginUpdater/src/version.h +++ b/plugins/PluginUpdater/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 2 #define __RELEASE_NUM 1 -#define __BUILD_NUM 7 +#define __BUILD_NUM 8 #include -- cgit v1.2.3