diff options
author | George Hazan <ghazan@miranda.im> | 2018-08-28 18:57:10 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-08-28 18:57:10 +0300 |
commit | 0bfda1eea2a829b31d117f4f3cd8eb2bc6d00f74 (patch) | |
tree | 16d95ee8813adcc63fe987574df170b3024dad27 | |
parent | 44cf6c34d5bad9ab76f78ec40f0f062590a33481 (diff) |
fixes #1554 (PluginUpdater should delete *.pdb if update channel is "without symbols")
-rw-r--r-- | plugins/PluginUpdater/src/Options.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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);
|