| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <msi.h> | 7 #include <msi.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 chrome_exe = L"\"" + chrome_exe + L"\""; | 377 chrome_exe = L"\"" + chrome_exe + L"\""; |
| 378 InstallUtil::WriteInstallerResult(system_install, install_status, | 378 InstallUtil::WriteInstallerResult(system_install, install_status, |
| 379 0, &chrome_exe); | 379 0, &chrome_exe); |
| 380 } | 380 } |
| 381 } else { | 381 } else { |
| 382 installer::LaunchChrome(system_install); | 382 installer::LaunchChrome(system_install); |
| 383 } | 383 } |
| 384 } else if (install_status == installer_util::NEW_VERSION_UPDATED) { | 384 } else if (install_status == installer_util::NEW_VERSION_UPDATED) { |
| 385 // This is temporary hack and will be deleted after one release. | 385 // This is temporary hack and will be deleted after one release. |
| 386 UpdateChromeOpenCmd(system_install); | 386 UpdateChromeOpenCmd(system_install); |
| 387 | |
| 388 #if defined(GOOGLE_CHROME_BUILD) | |
| 389 // TODO(kuchhal): This is just temporary until all users move to the | |
| 390 // new Chromium version which ships with gears.dll. | |
| 391 LOG(INFO) << "Google Chrome updated. Uninstalling gears msi."; | |
| 392 wchar_t product[39]; // GUID + '\0' | |
| 393 MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); // Don't show any UI | |
| 394 for (int i = 0; | |
| 395 MsiEnumRelatedProducts(google_update::kGearsUpgradeCode, 0, | |
| 396 i, product) != ERROR_NO_MORE_ITEMS; ++i) { | |
| 397 LOG(INFO) << "Uninstalling Gears - " << product; | |
| 398 unsigned int ret = MsiConfigureProduct(product, | |
| 399 INSTALLLEVEL_MAXIMUM, INSTALLSTATE_ABSENT); | |
| 400 if (ret != ERROR_SUCCESS) | |
| 401 LOG(ERROR) << "Failed to uninstall Gears " << product; | |
| 402 } | |
| 403 #endif | |
| 404 } | 387 } |
| 405 } | 388 } |
| 406 } | 389 } |
| 407 } | 390 } |
| 408 | 391 |
| 409 // Delete temporary files. These include install temporary directory | 392 // Delete temporary files. These include install temporary directory |
| 410 // and master profile file if present. | 393 // and master profile file if present. |
| 411 scoped_ptr<WorkItemList> cleanup_list(WorkItem::CreateWorkItemList()); | 394 scoped_ptr<WorkItemList> cleanup_list(WorkItem::CreateWorkItemList()); |
| 412 LOG(INFO) << "Deleting temporary directory " << temp_path; | 395 LOG(INFO) << "Deleting temporary directory " << temp_path; |
| 413 cleanup_list->AddDeleteTreeWorkItem(temp_path, std::wstring()); | 396 cleanup_list->AddDeleteTreeWorkItem(temp_path, std::wstring()); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 } else { | 517 } else { |
| 535 install_status = InstallChrome(parsed_command_line, | 518 install_status = InstallChrome(parsed_command_line, |
| 536 installed_version.get(), | 519 installed_version.get(), |
| 537 options); | 520 options); |
| 538 } | 521 } |
| 539 | 522 |
| 540 CoUninitialize(); | 523 CoUninitialize(); |
| 541 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 524 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 542 return dist->GetInstallReturnCode(install_status); | 525 return dist->GetInstallReturnCode(install_status); |
| 543 } | 526 } |
| OLD | NEW |