summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Notifications.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-30 14:24:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-30 14:24:30 +0000
commit82ea016e57d36a1e75e57529f8f5dfdd2ac39b63 (patch)
tree21ede386e120d68998f13ea83f4d5728ef0649e8 /plugins/PluginUpdater/src/Notifications.cpp
parentfcf7bd8eaf968e9d3e5dd3b1917a74452d71c9fa (diff)
patch to correctly upgrade old Miranda IM installations
git-svn-id: http://svn.miranda-ng.org/main/trunk@1728 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Notifications.cpp')
-rw-r--r--plugins/PluginUpdater/src/Notifications.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp
index 2a3c93a54a..4a07b446fb 100644
--- a/plugins/PluginUpdater/src/Notifications.cpp
+++ b/plugins/PluginUpdater/src/Notifications.cpp
@@ -30,7 +30,7 @@ void PopupAction(HWND hWnd, BYTE action)
break;
case PCA_DONOTHING:
return;
- }//end* switch
+ }
PUDeletePopUp(hWnd);
}
@@ -220,12 +220,12 @@ void SelectAll(HWND hDlg, bool bEnable)
}
}
-static void SetStringText(HWND hWnd, size_t i, TCHAR* ptszText)
+static void SetStringText(HWND hWnd, size_t i, TCHAR *ptszText)
{
ListView_SetItemText(hWnd, i, 1, ptszText);
}
-static void ApplyUpdates(void* param)
+static void ApplyUpdates(void *param)
{
HWND hDlg = (HWND)param;
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
@@ -272,14 +272,21 @@ static void ApplyUpdates(void* param)
return;
}
- TCHAR* tszMirandaPath = Utils_ReplaceVarsT(_T("%miranda_path%"));
+ TCHAR *tszMirandaPath = Utils_ReplaceVarsT(_T("%miranda_path%"));
for (int i = 0; i < todo.getCount(); i++) {
if ( !todo[i].enabled)
continue;
FILEINFO& p = todo[i];
- if ( unzip(p.File.tszDiskPath, tszMirandaPath, tszFileBack))
+ if (p.tszNewName[0] == 0) { // delete only
+ TCHAR *ptszRelPath = p.tszOldName + _tcslen(tszMirandaPath) + 1;
+ TCHAR tszBackFile[MAX_PATH];
+ mir_sntprintf(tszBackFile, SIZEOF(tszBackFile), _T("%s\\%s"), tszFileBack, ptszRelPath);
+ DeleteFile(tszBackFile);
+ MoveFile(p.tszOldName, tszBackFile);
+ }
+ else if ( unzip(p.tszOldName, p.File.tszDiskPath, tszMirandaPath, tszFileBack))
DeleteFile(p.File.tszDiskPath);
}
@@ -341,7 +348,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_IMAGE;
lvI.iSubItem = 0;
lvI.lParam = (LPARAM)&todo[i];
- lvI.pszText = todo[i].tszDescr;
+ lvI.pszText = todo[i].tszOldName;
lvI.iItem = i;
ListView_InsertItem(hwndList, &lvI);