Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/process_util.h" | 11 #include "base/process_util.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/registry.h" | 15 #include "base/win/registry.h" |
| 16 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
| 17 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
| 18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
| 19 #include "chrome/common/chrome_paths_internal.h" | 19 #include "chrome/common/chrome_paths_internal.h" |
| 20 #include "chrome/common/chrome_result_codes.h" | 20 #include "chrome/common/chrome_result_codes.h" |
| 21 #include "chrome/installer/setup/install.h" | 21 #include "chrome/installer/setup/install.h" |
| 22 #include "chrome/installer/setup/install_worker.h" | 22 #include "chrome/installer/setup/install_worker.h" |
| 23 #include "chrome/installer/setup/setup_constants.h" | 23 #include "chrome/installer/setup/setup_constants.h" |
| 24 #include "chrome/installer/setup/setup_util.h" | 24 #include "chrome/installer/setup/setup_util.h" |
| 25 #include "chrome/installer/util/auto_launch_util.h" | |
| 25 #include "chrome/installer/util/browser_distribution.h" | 26 #include "chrome/installer/util/browser_distribution.h" |
| 26 #include "chrome/installer/util/channel_info.h" | 27 #include "chrome/installer/util/channel_info.h" |
| 27 #include "chrome/installer/util/delete_after_reboot_helper.h" | 28 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 28 #include "chrome/installer/util/google_update_constants.h" | 29 #include "chrome/installer/util/google_update_constants.h" |
| 29 #include "chrome/installer/util/google_update_settings.h" | 30 #include "chrome/installer/util/google_update_settings.h" |
| 30 #include "chrome/installer/util/helper.h" | 31 #include "chrome/installer/util/helper.h" |
| 31 #include "chrome/installer/util/install_util.h" | 32 #include "chrome/installer/util/install_util.h" |
| 32 #include "chrome/installer/util/installation_state.h" | 33 #include "chrome/installer/util/installation_state.h" |
| 33 #include "chrome/installer/util/installer_state.h" | 34 #include "chrome/installer/util/installer_state.h" |
| 34 #include "chrome/installer/util/logging_installer.h" | 35 #include "chrome/installer/util/logging_installer.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 installer::switches::kRegisterChromeBrowserSuffix, suffix); | 728 installer::switches::kRegisterChromeBrowserSuffix, suffix); |
| 728 } | 729 } |
| 729 DWORD exit_code = installer::UNKNOWN_STATUS; | 730 DWORD exit_code = installer::UNKNOWN_STATUS; |
| 730 InstallUtil::ExecuteExeAsAdmin(new_cmd, &exit_code); | 731 InstallUtil::ExecuteExeAsAdmin(new_cmd, &exit_code); |
| 731 } | 732 } |
| 732 } | 733 } |
| 733 | 734 |
| 734 // Chrome is not in use so lets uninstall Chrome by deleting various files | 735 // Chrome is not in use so lets uninstall Chrome by deleting various files |
| 735 // and registry entries. Here we will just make best effort and keep going | 736 // and registry entries. Here we will just make best effort and keep going |
| 736 // in case of errors. | 737 // in case of errors. |
| 737 if (is_chrome) | 738 if (is_chrome) { |
| 738 ClearRlzProductState(); | 739 ClearRlzProductState(); |
| 740 if (auto_launch_util::WillLaunchAtLogin()) | |
| 741 auto_launch_util::SetWillLaunchAtLogin(false, FilePath()); | |
|
grt (UTC plus 2)
2011/12/01 04:45:02
this has the potential to remove a launch entry fo
| |
| 742 } | |
| 739 | 743 |
| 740 // First delete shortcuts from Start->Programs, Desktop & Quick Launch. | 744 // First delete shortcuts from Start->Programs, Desktop & Quick Launch. |
| 741 DeleteChromeShortcuts(installer_state, product); | 745 DeleteChromeShortcuts(installer_state, product); |
| 742 | 746 |
| 743 // Delete the registry keys (Uninstall key and Version key). | 747 // Delete the registry keys (Uninstall key and Version key). |
| 744 HKEY reg_root = installer_state.root_key(); | 748 HKEY reg_root = installer_state.root_key(); |
| 745 | 749 |
| 746 // Note that we must retrieve the distribution-specific data before deleting | 750 // Note that we must retrieve the distribution-specific data before deleting |
| 747 // product.GetVersionKey(). | 751 // product.GetVersionKey(). |
| 748 std::wstring distribution_data(browser_dist->GetDistributionData(reg_root)); | 752 std::wstring distribution_data(browser_dist->GetDistributionData(reg_root)); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 893 | 897 |
| 894 // Try and delete the preserved local state once the post-install | 898 // Try and delete the preserved local state once the post-install |
| 895 // operations are complete. | 899 // operations are complete. |
| 896 if (!backup_state_file.empty()) | 900 if (!backup_state_file.empty()) |
| 897 file_util::Delete(backup_state_file, false); | 901 file_util::Delete(backup_state_file, false); |
| 898 | 902 |
| 899 return ret; | 903 return ret; |
| 900 } | 904 } |
| 901 | 905 |
| 902 } // namespace installer | 906 } // namespace installer |
| OLD | NEW |