| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines the methods useful for uninstalling Chrome. | 5 // This file defines the methods useful for uninstalling Chrome. |
| 6 | 6 |
| 7 #include "chrome/installer/setup/uninstall.h" | 7 #include "chrome/installer/setup/uninstall.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/registry.h" | 11 #include "base/registry.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/win_util.h" | 15 #include "base/win/windows_version.h" |
| 16 #include "chrome/common/result_codes.h" | 16 #include "chrome/common/result_codes.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_paths_internal.h" | 18 #include "chrome/common/chrome_paths_internal.h" |
| 19 #include "chrome/installer/setup/install.h" | 19 #include "chrome/installer/setup/install.h" |
| 20 #include "chrome/installer/setup/setup_constants.h" | 20 #include "chrome/installer/setup/setup_constants.h" |
| 21 #include "chrome/installer/util/browser_distribution.h" | 21 #include "chrome/installer/util/browser_distribution.h" |
| 22 #include "chrome/installer/util/delete_after_reboot_helper.h" | 22 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 23 #include "chrome/installer/util/helper.h" | 23 #include "chrome/installer/util/helper.h" |
| 24 #include "chrome/installer/util/install_util.h" | 24 #include "chrome/installer/util/install_util.h" |
| 25 #include "chrome/installer/util/logging_installer.h" | 25 #include "chrome/installer/util/logging_installer.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 if (status != installer_util::UNINSTALL_CONFIRMED && | 461 if (status != installer_util::UNINSTALL_CONFIRMED && |
| 462 status != installer_util::UNINSTALL_DELETE_PROFILE) | 462 status != installer_util::UNINSTALL_DELETE_PROFILE) |
| 463 return status; | 463 return status; |
| 464 | 464 |
| 465 // Check if we need admin rights to cleanup HKLM. If we do, try to launch | 465 // Check if we need admin rights to cleanup HKLM. If we do, try to launch |
| 466 // another uninstaller (silent) in elevated mode to do HKLM cleanup. | 466 // another uninstaller (silent) in elevated mode to do HKLM cleanup. |
| 467 // And continue uninstalling in the current process also to do HKCU cleanup. | 467 // And continue uninstalling in the current process also to do HKCU cleanup. |
| 468 if (remove_all && | 468 if (remove_all && |
| 469 (!suffix.empty() || CurrentUserHasDefaultBrowser(system_uninstall)) && | 469 (!suffix.empty() || CurrentUserHasDefaultBrowser(system_uninstall)) && |
| 470 !::IsUserAnAdmin() && | 470 !::IsUserAnAdmin() && |
| 471 (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) && | 471 (base::win::GetVersion() >= base::win::VERSION_VISTA) && |
| 472 !cmd_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { | 472 !cmd_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { |
| 473 std::wstring exe = cmd_line.program(); | 473 std::wstring exe = cmd_line.program(); |
| 474 std::wstring params(cmd_params); | 474 std::wstring params(cmd_params); |
| 475 // Append --run-as-admin flag to let the new instance of setup.exe know | 475 // Append --run-as-admin flag to let the new instance of setup.exe know |
| 476 // that we already tried to launch ourselves as admin. | 476 // that we already tried to launch ourselves as admin. |
| 477 params.append(L" --"); | 477 params.append(L" --"); |
| 478 params.append(installer_util::switches::kRunAsAdmin); | 478 params.append(installer_util::switches::kRunAsAdmin); |
| 479 // Append --remove-chrome-registration to remove registry keys only. | 479 // Append --remove-chrome-registration to remove registry keys only. |
| 480 params.append(L" --"); | 480 params.append(L" --"); |
| 481 params.append(installer_util::switches::kRemoveChromeRegistration); | 481 params.append(installer_util::switches::kRemoveChromeRegistration); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 distribution_data); | 589 distribution_data); |
| 590 } | 590 } |
| 591 | 591 |
| 592 // Try and delete the preserved local state once the post-install | 592 // Try and delete the preserved local state once the post-install |
| 593 // operations are complete. | 593 // operations are complete. |
| 594 if (!local_state_path.empty()) | 594 if (!local_state_path.empty()) |
| 595 file_util::Delete(local_state_path, false); | 595 file_util::Delete(local_state_path, false); |
| 596 | 596 |
| 597 return ret; | 597 return ret; |
| 598 } | 598 } |
| OLD | NEW |