summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/DlgUpdate.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-09-17 18:14:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-09-17 18:14:24 +0300
commitdcd1fc6f6662c6c513f2e15e42473372e6a0240f (patch)
treeae128e273290576479d0b49c903d45013aeef595 /plugins/PluginUpdater/src/DlgUpdate.cpp
parentf513c977a39875aa8a180c2d70567957567f1724 (diff)
fixes #2554 (PluginUpdater: делать откат в случае неудачи при замене файлов)
Diffstat (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp')
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index d27012b5b7..5396683204 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -91,6 +91,7 @@ class CUpdateDLg : public CDlgBase
mir_snwprintf(wszBackFile, L"%s\\%s", wszBackupFolder, it->wszNewName + wcslen(wszMirandaPath) + 1);
if (dwErrorCode = BackupFile(it->wszNewName, wszBackFile)) {
LBL_Error:
+ RollbackChanges(wszBackupFolder);
Skin_PlaySound("updatefailed");
CMStringW wszError(FORMAT, TranslateT("Unpack operation failed with error code=%d, update terminated"), dwErrorCode);
MessageBox(pDlg->GetHwnd(), wszError, TranslateT("Plugin Updater"), MB_OK | MB_ICONERROR);
@@ -441,6 +442,7 @@ static void DlgUpdateSilent(void *param)
mir_snwprintf(wszBackFile, L"%s\\%s", wszBackupFolder, it->wszNewName + wcslen(wszMirandaPath) + 1);
if (dwErrorCode = BackupFile(it->wszNewName, wszBackFile)) {
LBL_Error:
+ RollbackChanges(wszBackupFolder);
Skin_PlaySound("updatefailed");
delete &UpdateFiles;
return;