| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/common/chrome_result_codes.h" | 27 #include "chrome/common/chrome_result_codes.h" |
| 28 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | 28 #include "chrome/installer/launcher_support/chrome_launcher_support.h" |
| 29 #include "chrome/installer/setup/install.h" | 29 #include "chrome/installer/setup/install.h" |
| 30 #include "chrome/installer/setup/install_worker.h" | 30 #include "chrome/installer/setup/install_worker.h" |
| 31 #include "chrome/installer/setup/setup_constants.h" | 31 #include "chrome/installer/setup/setup_constants.h" |
| 32 #include "chrome/installer/setup/setup_util.h" | 32 #include "chrome/installer/setup/setup_util.h" |
| 33 #include "chrome/installer/util/auto_launch_util.h" | 33 #include "chrome/installer/util/auto_launch_util.h" |
| 34 #include "chrome/installer/util/browser_distribution.h" | 34 #include "chrome/installer/util/browser_distribution.h" |
| 35 #include "chrome/installer/util/channel_info.h" | 35 #include "chrome/installer/util/channel_info.h" |
| 36 #include "chrome/installer/util/delete_after_reboot_helper.h" | 36 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 37 #include "chrome/installer/util/firewall_manager.h" |
| 37 #include "chrome/installer/util/google_update_constants.h" | 38 #include "chrome/installer/util/google_update_constants.h" |
| 38 #include "chrome/installer/util/google_update_settings.h" | 39 #include "chrome/installer/util/google_update_settings.h" |
| 39 #include "chrome/installer/util/helper.h" | 40 #include "chrome/installer/util/helper.h" |
| 40 #include "chrome/installer/util/install_util.h" | 41 #include "chrome/installer/util/install_util.h" |
| 41 #include "chrome/installer/util/installation_state.h" | 42 #include "chrome/installer/util/installation_state.h" |
| 42 #include "chrome/installer/util/installer_state.h" | 43 #include "chrome/installer/util/installer_state.h" |
| 43 #include "chrome/installer/util/logging_installer.h" | 44 #include "chrome/installer/util/logging_installer.h" |
| 44 #include "chrome/installer/util/self_cleaning_temp_dir.h" | 45 #include "chrome/installer/util/self_cleaning_temp_dir.h" |
| 45 #include "chrome/installer/util/shell_util.h" | 46 #include "chrome/installer/util/shell_util.h" |
| 46 #include "chrome/installer/util/util_constants.h" | 47 #include "chrome/installer/util/util_constants.h" |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 if (loaded_hive) { | 1036 if (loaded_hive) { |
| 1036 user_reg_root.Close(); | 1037 user_reg_root.Close(); |
| 1037 if (RegUnLoadKey(HKEY_USERS, profile_sid) == ERROR_SUCCESS) | 1038 if (RegUnLoadKey(HKEY_USERS, profile_sid) == ERROR_SUCCESS) |
| 1038 VLOG(1) << "Unloaded registry hive for " << profile_sid; | 1039 VLOG(1) << "Unloaded registry hive for " << profile_sid; |
| 1039 else | 1040 else |
| 1040 LOG(ERROR) << "Error unloading registry hive for " << profile_sid; | 1041 LOG(ERROR) << "Error unloading registry hive for " << profile_sid; |
| 1041 } | 1042 } |
| 1042 } | 1043 } |
| 1043 } | 1044 } |
| 1044 | 1045 |
| 1046 void UninstallFirewallRules(BrowserDistribution* dist, |
| 1047 const base::FilePath& chrome_exe) { |
| 1048 scoped_ptr<FirewallManager> firewall_manager( |
| 1049 FirewallManager::Create(dist, chrome_exe)); |
| 1050 if (firewall_manager) |
| 1051 firewall_manager->DeleteUDPFirewallRule(); |
| 1052 } |
| 1053 |
| 1045 InstallStatus UninstallProduct(const InstallationState& original_state, | 1054 InstallStatus UninstallProduct(const InstallationState& original_state, |
| 1046 const InstallerState& installer_state, | 1055 const InstallerState& installer_state, |
| 1047 const base::FilePath& setup_path, | 1056 const base::FilePath& setup_path, |
| 1048 const Product& product, | 1057 const Product& product, |
| 1049 bool remove_all, | 1058 bool remove_all, |
| 1050 bool force_uninstall, | 1059 bool force_uninstall, |
| 1051 const CommandLine& cmd_line) { | 1060 const CommandLine& cmd_line) { |
| 1052 InstallStatus status = installer::UNINSTALL_CONFIRMED; | 1061 InstallStatus status = installer::UNINSTALL_CONFIRMED; |
| 1053 BrowserDistribution* browser_dist = product.distribution(); | 1062 BrowserDistribution* browser_dist = product.distribution(); |
| 1054 const base::string16 chrome_exe( | 1063 const base::string16 chrome_exe( |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 DeleteChromeRegistrationKeys(installer_state, browser_dist, | 1224 DeleteChromeRegistrationKeys(installer_state, browser_dist, |
| 1216 HKEY_LOCAL_MACHINE, suffix, &ret); | 1225 HKEY_LOCAL_MACHINE, suffix, &ret); |
| 1217 } | 1226 } |
| 1218 | 1227 |
| 1219 ProcessDelegateExecuteWorkItems(installer_state, product); | 1228 ProcessDelegateExecuteWorkItems(installer_state, product); |
| 1220 | 1229 |
| 1221 ProcessOnOsUpgradeWorkItems(installer_state, product); | 1230 ProcessOnOsUpgradeWorkItems(installer_state, product); |
| 1222 | 1231 |
| 1223 UninstallActiveSetupEntries(installer_state, product); | 1232 UninstallActiveSetupEntries(installer_state, product); |
| 1224 | 1233 |
| 1234 UninstallFirewallRules(browser_dist, base::FilePath(chrome_exe)); |
| 1235 |
| 1225 // Notify the shell that associations have changed since Chrome was likely | 1236 // Notify the shell that associations have changed since Chrome was likely |
| 1226 // unregistered. | 1237 // unregistered. |
| 1227 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); | 1238 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); |
| 1228 | 1239 |
| 1229 // TODO(huangs): Implement actual migration code and remove the hack below. | 1240 // TODO(huangs): Implement actual migration code and remove the hack below. |
| 1230 // Remove the "shadow" App Launcher registry keys. | 1241 // Remove the "shadow" App Launcher registry keys. |
| 1231 if (installer_state.is_multi_install()) { | 1242 if (installer_state.is_multi_install()) { |
| 1232 // If we're not uninstalling the legacy App Launcher, and if it was | 1243 // If we're not uninstalling the legacy App Launcher, and if it was |
| 1233 // not installed in the first place, then delete the "shadow" keys. | 1244 // not installed in the first place, then delete the "shadow" keys. |
| 1234 chrome_launcher_support::InstallationState level_to_check = | 1245 chrome_launcher_support::InstallationState level_to_check = |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 // If we need a reboot to continue, schedule the parent directories for | 1425 // If we need a reboot to continue, schedule the parent directories for |
| 1415 // deletion unconditionally. If they are not empty, the session manager | 1426 // deletion unconditionally. If they are not empty, the session manager |
| 1416 // will not delete them on reboot. | 1427 // will not delete them on reboot. |
| 1417 ScheduleParentAndGrandparentForDeletion(target_path); | 1428 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1418 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1429 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
| 1419 *uninstall_status = UNINSTALL_FAILED; | 1430 *uninstall_status = UNINSTALL_FAILED; |
| 1420 } | 1431 } |
| 1421 } | 1432 } |
| 1422 | 1433 |
| 1423 } // namespace installer | 1434 } // namespace installer |
| OLD | NEW |