From d4bff57e724e532ef2382137c0c4f6fd59f1a9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 18 Jan 2014 11:58:08 +0000 Subject: Plugin updater: Interrupt updating when some download fails; Version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@7715 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/DlgUpdate.cpp | 14 ++++++++++---- plugins/PluginUpdater/src/Version.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'plugins/PluginUpdater/src') diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 059dcaf552..4448dda157 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -62,7 +62,8 @@ static void ApplyUpdates(void *param) mir_sntprintf(tszFileTemp, SIZEOF(tszFileTemp), _T("%s\\Temp"), tszRoot); SafeCreateDirectory(tszFileTemp); - HANDLE nlc = NULL; + bool error = false; + HANDLE nlc = NULL; for (int i=0; i < todo.getCount(); ++i) { ListView_EnsureVisible(hwndList, i, FALSE); if ( !todo[i].bEnabled) { @@ -78,14 +79,19 @@ static void ApplyUpdates(void *param) SetStringText(hwndList, i, TranslateT("Downloading...")); FILEURL *pFileUrl = &todo[i].File; - if ( !DownloadFile(pFileUrl->tszDownloadURL, pFileUrl->tszDiskPath, pFileUrl->CRCsum, nlc)) + if (!DownloadFile(pFileUrl->tszDownloadURL, pFileUrl->tszDiskPath, pFileUrl->CRCsum, nlc)) { SetStringText(hwndList, i, TranslateT("Failed!")); - else + + // interrupt update as we require all components to be updated + MessageBox(hDlg, TranslateT("Update failed! Some component wasn't downloaded correctly. Try it again later."), TranslateT("Plugin Updater"), MB_OK | MB_ICONERROR); + error = true; + break; + } else SetStringText(hwndList, i, TranslateT("Succeeded.")); } Netlib_CloseHandle(nlc); - if (todo.getCount() > 0) { + if (!error && todo.getCount() > 0) { TCHAR *tszMirandaPath = Utils_ReplaceVarsT(_T("%miranda_path%")); for (int i = 0; i < todo.getCount(); i++) { diff --git a/plugins/PluginUpdater/src/Version.h b/plugins/PluginUpdater/src/Version.h index 89d54f2420..2725439873 100644 --- a/plugins/PluginUpdater/src/Version.h +++ b/plugins/PluginUpdater/src/Version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 1 #define __RELEASE_NUM 1 -#define __BUILD_NUM 6 +#define __BUILD_NUM 7 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -- cgit v1.2.3