From 0bfda1eea2a829b31d117f4f3cd8eb2bc6d00f74 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 28 Aug 2018 18:57:10 +0300 Subject: fixes #1554 (PluginUpdater should delete *.pdb if update channel is "without symbols") --- plugins/PluginUpdater/src/Options.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'plugins/PluginUpdater/src') diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 8d5c3db7c7..337f1b2dd7 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -289,11 +289,13 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar mir_forkthread(InitTimer, (void*)1); + bool bNoSymbols = false; if (IsDlgButtonChecked(hwndDlg, IDC_STABLE)) { db_set_b(NULL, MODULENAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE); if (!opts.bChangePlatform) opts.bForceRedownload = 0; db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD); + bNoSymbols = true; } else if (IsDlgButtonChecked(hwndDlg, IDC_STABLE_SYMBOLS)) { // Only set ForceRedownload if the previous UpdateMode was different @@ -308,6 +310,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar if (!opts.bChangePlatform) opts.bForceRedownload = 0; db_unset(NULL, MODULENAME, DB_SETTING_REDOWNLOAD); + bNoSymbols = true; } else if (IsDlgButtonChecked(hwndDlg, IDC_TRUNK_SYMBOLS)) { // Only set ForceRedownload if the previous UpdateMode was different @@ -332,6 +335,22 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar } else db_set_b(NULL, MODULENAME, DB_SETTING_CHANGEPLATFORM, opts.bChangePlatform = 0); + // if user selected update channel without symbols, remove PDBs + if (bNoSymbols) { + CMStringW wszPath(VARSW(L"%miranda_path%")); + wszPath.AppendChar('\\'); + + WIN32_FIND_DATA ffd; + HANDLE hFind = FindFirstFile(wszPath + L"*.pdb", &ffd); + if (hFind != INVALID_HANDLE_VALUE) { + do { + DeleteFileW(wszPath + ffd.cFileName); + } + while (FindNextFile(hFind, &ffd) != 0); + } + FindClose(hFind); + } + // if user tried to change the channel, run the update dialog immediately if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM))) CallService(MS_PU_CHECKUPDATES, 0, 0); -- cgit v1.2.3