OLD | NEW |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include <ctime> | 3 #include <ctime> |
4 | 4 |
5 #include "PluginClass.h" | 5 #include "PluginClass.h" |
6 #include "PluginDictionary.h" | 6 #include "PluginDictionary.h" |
7 #include "PluginSettings.h" | 7 #include "PluginSettings.h" |
8 #include "PluginSystem.h" | 8 #include "PluginSystem.h" |
9 #include "PluginConfiguration.h" | 9 #include "PluginConfiguration.h" |
10 #ifdef SUPPORT_FILTER | 10 #ifdef SUPPORT_FILTER |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 { | 226 { |
227 isNewFilterVersion = true; | 227 isNewFilterVersion = true; |
228 } | 228 } |
229 #endif // SUPPORT_FILTER | 229 #endif // SUPPORT_FILTER |
230 | 230 |
231 settings->Write(); | 231 settings->Write(); |
232 | 232 |
233 configuration->Invalidate(); | 233 configuration->Invalidate(); |
234 | 234 |
235 #ifdef SUPPORT_FILTER | 235 #ifdef SUPPORT_FILTER |
| 236 DEBUG_GENERAL("*** before isNewFilterVersion"); |
| 237 |
236 // Update filters, if needed (5 days * (random() * 0.4 + 0.8)) | 238 // Update filters, if needed (5 days * (random() * 0.4 + 0.8)) |
237 if (isNewFilterVersion) | 239 if (isNewFilterVersion) |
238 { | 240 { |
239 | 241 |
| 242 DEBUG_GENERAL("*** before CheckFilterAn
dDownload"); |
240 settings->CheckFilterAndDownload(); | 243 settings->CheckFilterAndDownload(); |
241 | 244 |
242 settings->MakeRequestForUpdate(); | 245 settings->MakeRequestForUpdate(); |
243 | 246 |
244 | 247 |
245 settings->Write(); | 248 settings->Write(); |
246 | 249 |
247 tab->OnUpdate(); | 250 tab->OnUpdate(); |
248 } | 251 } |
249 #endif // SUPPORT_FILTER | 252 #endif // SUPPORT_FILTER |
250 } | 253 } |
251 } | 254 } |
252 | 255 |
253 | 256 |
254 #ifndef ENTERPRISE | 257 #ifndef ENTERPRISE |
255 // -----------------------------------------------------------------
--- | 258 // -----------------------------------------------------------------
--- |
256 // Update plugin | 259 // Update plugin |
257 // -----------------------------------------------------------------
--- | 260 // -----------------------------------------------------------------
--- |
258 | 261 |
259 if (!IsMainThreadDone(hMainThread) && s_isPluginToBeUpdated) | 262 if (!IsMainThreadDone(hMainThread) && s_isPluginToBeUpdated) |
260 { | 263 { |
261 DEBUG_GENERAL(L"*** Displaying download plugin dialog"); | 264 DEBUG_GENERAL(L"*** Displaying download plugin dialog"); |
262 | 265 |
263 s_isPluginToBeUpdated = false; | 266 s_isPluginToBeUpdated = false; |
264 | 267 |
265 try | 268 try |
266 { | 269 { |
267 CString updateUrl = settings->GetString(SETTING_PLUGIN_UPDATE_UR
L); | 270 CString updateUrl = settings->GetString(SETTING_PLUGIN_UPDATE_UR
L); |
268 » » CString updatePath = CPluginSettings::GetTempPath(INSTAL
L_MSI_FILE); | 271 » » » » CString updatePath = L""; |
269 | 272 » » » » if (updateUrl.Find(L".exe") == updateUrl.GetLeng
th() - 4) |
270 » » » » // Delete old installer | 273 » » » » { |
271 » » » » ::DeleteFile(CPluginSettings::GetTempPath(INSTAL
L_MSI_FILE)); | 274 » » » updatePath = CPluginSettings::GetTempPath(INSTAL
L_EXE_FILE); |
| 275 » » » » » // Delete old installer |
| 276 » » » » » ::DeleteFile(CPluginSettings::GetTempPat
h(INSTALL_EXE_FILE)); |
| 277 » » » » } |
| 278 » » » » else |
| 279 » » » » { |
| 280 » » » updatePath = CPluginSettings::GetTempPath(INSTAL
L_MSI_FILE); |
| 281 » » » » » // Delete old installer |
| 282 » » » » » ::DeleteFile(CPluginSettings::GetTempPat
h(INSTALL_MSI_FILE)); |
| 283 » » » » } |
272 | 284 |
273 CPluginDownloadDialog dlDlg; | 285 CPluginDownloadDialog dlDlg; |
274 | 286 |
275 dlDlg.SetUrlAndPath(updateUrl, updatePath); | 287 dlDlg.SetUrlAndPath(updateUrl, updatePath); |
276 if (dlDlg.DoModal(::GetDesktopWindow()) == IDC_INSTALLBT
N) | 288 if (dlDlg.DoModal(::GetDesktopWindow()) == IDC_INSTALLBT
N) |
277 { | 289 { |
278 LaunchUpdater(updatePath); | 290 LaunchUpdater(updatePath); |
279 #ifdef AUTOMATIC_SHUTDOWN | 291 #ifdef AUTOMATIC_SHUTDOWN |
280 settings->EraseTab(); | 292 settings->EraseTab(); |
281 ::ExitProcess(0); | 293 ::ExitProcess(0); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 bool isDone = false; | 348 bool isDone = false; |
337 | 349 |
338 s_criticalSectionLocal.Lock(); | 350 s_criticalSectionLocal.Lock(); |
339 { | 351 { |
340 isDone = s_isMainThreadDone || mainThread != s_hMainThread; | 352 isDone = s_isMainThreadDone || mainThread != s_hMainThread; |
341 } | 353 } |
342 s_criticalSectionLocal.Unlock(); | 354 s_criticalSectionLocal.Unlock(); |
343 | 355 |
344 return isDone; | 356 return isDone; |
345 } | 357 } |
OLD | NEW |