From e381e98b6c1435da4cfc68cec14e67171441fb68 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 8 Aug 2012 11:32:34 +0000 Subject: adaptation for hashes.zip git-svn-id: http://svn.miranda-ng.org/main/trunk@1399 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Common.h | 4 +++- plugins/PluginUpdater/src/Notifications.cpp | 2 -- plugins/PluginUpdater/src/Scanner.cpp | 15 ++++++++------- plugins/PluginUpdater/src/Version.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index ecf0dd1295..ffe3f9b032 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -142,4 +142,6 @@ INT_PTR CALLBACK DlgMsgPop(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); void __stdcall ExitMe(void*); void __stdcall RestartMe(void*); BOOL AllowUpdateOnStartup(); -VOID InitTimer(); \ No newline at end of file +VOID InitTimer(); + +void unzip(const TCHAR* ptszZipFile, TCHAR* ptszDestPath, TCHAR* ptszBackPath); diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 3955d7100b..0ef119ee9c 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -21,8 +21,6 @@ Boston, MA 02111-1307, USA. HWND hwndDialog = NULL; -void unzip(const TCHAR* ptszZipFile, TCHAR* ptszDestPath, TCHAR* ptszBackPath); - void PopupAction(HWND hWnd, BYTE action) { switch (action) diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp index e8cb5c2f99..cdead4a0ca 100644 --- a/plugins/PluginUpdater/src/Scanner.cpp +++ b/plugins/PluginUpdater/src/Scanner.cpp @@ -108,7 +108,6 @@ static void __stdcall LaunchDialog(void* param) static void CheckUpdates(void *) { - TCHAR tszBuff[2048] = {0}, tszTmpIni[MAX_PATH] = {0}; char szKey[64] = {0}; DBVARIANT dbVar = {0}; @@ -124,20 +123,22 @@ static void CheckUpdates(void *) DBFreeVariant(&dbVar); // Download version info - FILEURL pFileUrl; - mir_sntprintf(pFileUrl.tszDownloadURL, SIZEOF(pFileUrl.tszDownloadURL), _T("%s/hashes.txt"), tszBaseUrl); - mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%s\\tmp.ini"), tszRoot); - lstrcpyn(pFileUrl.tszDiskPath, tszBuff, SIZEOF(pFileUrl.tszDiskPath)); - lstrcpyn(tszTmpIni, tszBuff, SIZEOF(tszTmpIni)); - ShowPopup(NULL, TranslateT("Plugin Updater"), TranslateT("Downloading version info..."), 3, 0); + FILEURL pFileUrl; + mir_sntprintf(pFileUrl.tszDownloadURL, SIZEOF(pFileUrl.tszDownloadURL), _T("%s/hashes.zip"), tszBaseUrl); + mir_sntprintf(pFileUrl.tszDiskPath, SIZEOF(pFileUrl.tszDiskPath), _T("%s\\hashes.zip"), tszRoot); if (!DownloadFile(pFileUrl.tszDownloadURL, pFileUrl.tszDiskPath)) { ShowPopup(0, LPGENT("Plugin Updater"), LPGENT("An error occured while downloading the update."), 1, 0); CheckThread = NULL; return; } + unzip(pFileUrl.tszDiskPath, tszRoot, tszRoot); + DeleteFile(pFileUrl.tszDiskPath); + + TCHAR tszTmpIni[MAX_PATH] = {0}; + mir_sntprintf(tszTmpIni, SIZEOF(tszTmpIni), _T("%s\\hashes.txt"), tszRoot); FILE* fp = _tfopen(tszTmpIni, _T("r")); if (!fp) return; diff --git a/plugins/PluginUpdater/src/Version.h b/plugins/PluginUpdater/src/Version.h index 2938d6763a..cdd963fa6c 100644 --- a/plugins/PluginUpdater/src/Version.h +++ b/plugins/PluginUpdater/src/Version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 0 #define __RELEASE_NUM 1 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM #define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -- cgit v1.2.3