summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/DlgUpdate.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-10-09 11:40:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-10-09 11:40:44 +0300
commit69e3d7fa90c2bc4a6af3727b794b3a7dea283192 (patch)
tree44f37af23e5105949ddc519a83601c31a87fa678 /plugins/PluginUpdater/src/DlgUpdate.cpp
parent8b6123bb83988d80cafc113a45bb4fabe38ffefa (diff)
fixes #2586 (Updater cannot delete old OpenSSL dlls)
Diffstat (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp')
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index ff65edc449..dc5a53a527 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -577,7 +577,6 @@ static renameTable[] =
{ L"gtalkext.dll", nullptr },
{ L"importtxt.dll", nullptr },
{ L"langman.dll", nullptr },
- { L"libeay32.mir", nullptr },
{ L"libtox.dll", nullptr },
{ L"lua53.dll", nullptr },
{ L"metacontacts.dll", nullptr },
@@ -588,7 +587,6 @@ static renameTable[] =
{ L"msvcr100.dll", nullptr },
{ L"mtextcontrol.dll", nullptr },
{ L"sms.dll", nullptr },
- { L"ssleay32.mir", nullptr },
{ L"tlen.dll", nullptr },
{ L"whatsapp.dll", nullptr },
{ L"xfire.dll", nullptr },
@@ -663,13 +661,17 @@ static int ScanFolder(const wchar_t *pwszFolder, size_t cbBaseLen, const wchar_t
}
continue;
}
-
+
+ // create full name of the current file
+ mir_snwprintf(wszBuf, L"%s\\%s", pwszFolder, ffd.cFileName);
+
if (isValidExtension(ffd.cFileName)) {
// calculate the current file's relative name and store it into wszNewName
if (CheckFileRename(ffd.cFileName, wszNewName)) {
- Netlib_LogfW(hNetlibUser, L"File %s will be renamed to %s.", ffd.cFileName, wszNewName);
- // Yes, we need the old file name, because this will be hashed later
- mir_snwprintf(wszBuf, L"%s\\%s", pwszFolder, ffd.cFileName);
+ if (wszNewName[0])
+ Netlib_LogfW(hNetlibUser, L"File <%s> will be renamed to <%s>", wszBuf, wszNewName);
+ else
+ Netlib_LogfW(hNetlibUser, L"File <%s> will be deleted", wszBuf);
}
else {
if (level == 0) {
@@ -677,19 +679,16 @@ static int ScanFolder(const wchar_t *pwszFolder, size_t cbBaseLen, const wchar_t
wcsncpy_s(wszNewName, g_plugin.bChangePlatform && !mir_wstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
mir_snwprintf(wszBuf, L"%s\\%s", pwszFolder, wszNewName);
}
- else {
- mir_snwprintf(wszNewName, L"%s\\%s", pwszFolder + cbBaseLen, ffd.cFileName);
- mir_snwprintf(wszBuf, L"%s\\%s", pwszFolder, ffd.cFileName);
- }
+ else mir_snwprintf(wszNewName, L"%s\\%s", pwszFolder + cbBaseLen, ffd.cFileName);
}
}
else {
- // the only exclusion is Libs\\libmdbx.mir
- if (level == 1 && !wcsicmp(ffd.cFileName, L"libmdbx.mir")) {
+ if (level == 1 && !wcsicmp(ffd.cFileName, L"libmdbx.mir")) // move Libs\\libmdbx.mir to the root folder
wszNewName[0] = 0;
- mir_snwprintf(wszBuf, L"%s\\%s", pwszFolder, ffd.cFileName);
- }
- else continue; // skip all another filea
+ else if (!wcsicmp(ffd.cFileName, L"libeay32.mir") || !wcsicmp(ffd.cFileName, L"ssleay32.mir")) // remove old OpenSSL modules
+ wszNewName[0] = 0;
+ else
+ continue; // skip all another files
}
wchar_t *pwszUrl;