summaryrefslogtreecommitdiff
path: root/src/miranda32
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-17 22:06:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-17 22:06:13 +0000
commit2d26921c87c663de4725963d7da87c6eacd1e3d3 (patch)
tree8bc8f94c8b1468d2d9ceb0645a5c7ae903f3e858 /src/miranda32
parent46c77425ebf39fe8221a3cc3d026fbd611be9ca4 (diff)
we delete only needed dlls, not everything but msvcr*.dll
git-svn-id: http://svn.miranda-ng.org/main/trunk@14240 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/miranda32')
-rw-r--r--src/miranda32/src/checker.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/miranda32/src/checker.cpp b/src/miranda32/src/checker.cpp
index 0d2ce78369..0ba46a5c7f 100644
--- a/src/miranda32/src/checker.cpp
+++ b/src/miranda32/src/checker.cpp
@@ -196,34 +196,31 @@ bool TryDeleteFile(const TCHAR *ptszFileName)
/////////////////////////////////////////////////////////////////////////////////////////
+static TCHAR *arDlls[] = { _T("mir_app.dll"), _T("mir_core.dll"), _T("pcre16.dll"), _T("zlib.dll"), _T("libtox.dll") };
+
bool CheckDlls()
{
- WIN32_FIND_DATA findData;
- HANDLE hSearch = FindFirstFile(_T("*.dll"), &findData);
- if (hSearch == INVALID_HANDLE_VALUE) // no dlls? why bother
- return true;
-
bool bInit = false;
- do {
- // skip Visual Studio runtime if present
- if (!_tcsnicmp(findData.cFileName, _T("msvc"), 4))
+
+ for (int i = 0; i < _countof(arDlls); i++) {
+ // if dll is missing - skip it
+ if (_taccess(arDlls[i], 0) != 0)
continue;
// there's smth to delete. init UAC
if (!bInit) {
// failed? then we need UAC
if (!PrepareEscalation()) {
-LBL_Error: MessageBox(NULL, _T("Miranda failed to delete the obsolete file. Do it manually"), findData.cFileName, MB_ICONEXCLAMATION | MB_OK);
+LBL_Error: MessageBox(NULL, _T("Miranda failed to delete the obsolete file. Do it manually"), arDlls[i], MB_ICONEXCLAMATION | MB_OK);
return false;
}
bInit = true;
}
- if (!TryDeleteFile(findData.cFileName))
+ if (!TryDeleteFile(arDlls[i]))
goto LBL_Error;
}
- while (FindNextFile(hSearch, &findData));
return true;
}