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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 << BrowserDistribution::GetSpecificDistribution( | 105 << BrowserDistribution::GetSpecificDistribution( |
106 dist_type)->GetDisplayName() | 106 dist_type)->GetDisplayName() |
107 << " is somehow already set to the desired new value of " | 107 << " is somehow already set to the desired new value of " |
108 << channel_info.value(); | 108 << channel_info.value(); |
109 } | 109 } |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 // Makes appropriate changes to the Google Update "ap" value in the registry. | 113 // Makes appropriate changes to the Google Update "ap" value in the registry. |
114 // Specifically, removes the flags associated with this product ("-chrome" or | 114 // Specifically, removes the flags associated with this product ("-chrome" or |
115 // "-chromeframe[-readymode]") from the "ap" values for all other | 115 // "-chromeframe") from the "ap" values for all other installed products and for |
116 // installed products and for the multi-installer package. | 116 // the multi-installer package. |
117 void ProcessGoogleUpdateItems( | 117 void ProcessGoogleUpdateItems( |
118 const installer::InstallationState& original_state, | 118 const installer::InstallationState& original_state, |
119 const installer::InstallerState& installer_state, | 119 const installer::InstallerState& installer_state, |
120 const installer::Product& product) { | 120 const installer::Product& product) { |
121 DCHECK(installer_state.is_multi_install()); | 121 DCHECK(installer_state.is_multi_install()); |
122 const bool system_level = installer_state.system_install(); | 122 const bool system_level = installer_state.system_install(); |
123 BrowserDistribution* distribution = product.distribution(); | 123 BrowserDistribution* distribution = product.distribution(); |
124 const installer::ProductState* product_state = | 124 const installer::ProductState* product_state = |
125 original_state.GetProductState(system_level, distribution->GetType()); | 125 original_state.GetProductState(system_level, distribution->GetType()); |
126 DCHECK(product_state != NULL); | 126 DCHECK(product_state != NULL); |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 if (loaded_hive) { | 1053 if (loaded_hive) { |
1054 user_reg_root.Close(); | 1054 user_reg_root.Close(); |
1055 if (RegUnLoadKey(HKEY_USERS, profile_sid) == ERROR_SUCCESS) | 1055 if (RegUnLoadKey(HKEY_USERS, profile_sid) == ERROR_SUCCESS) |
1056 VLOG(1) << "Unloaded registry hive for " << profile_sid; | 1056 VLOG(1) << "Unloaded registry hive for " << profile_sid; |
1057 else | 1057 else |
1058 LOG(ERROR) << "Error unloading registry hive for " << profile_sid; | 1058 LOG(ERROR) << "Error unloading registry hive for " << profile_sid; |
1059 } | 1059 } |
1060 } | 1060 } |
1061 } | 1061 } |
1062 | 1062 |
1063 bool ProcessChromeFrameWorkItems(const InstallationState& original_state, | |
1064 const InstallerState& installer_state, | |
1065 const base::FilePath& setup_path, | |
1066 const Product& product) { | |
1067 if (!product.is_chrome_frame()) | |
1068 return false; | |
1069 | |
1070 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); | |
1071 AddChromeFrameWorkItems(original_state, installer_state, setup_path, | |
1072 Version(), product, item_list.get()); | |
1073 return item_list->Do(); | |
1074 } | |
1075 | |
1076 InstallStatus UninstallProduct(const InstallationState& original_state, | 1063 InstallStatus UninstallProduct(const InstallationState& original_state, |
1077 const InstallerState& installer_state, | 1064 const InstallerState& installer_state, |
1078 const base::FilePath& setup_path, | 1065 const base::FilePath& setup_path, |
1079 const Product& product, | 1066 const Product& product, |
1080 bool remove_all, | 1067 bool remove_all, |
1081 bool force_uninstall, | 1068 bool force_uninstall, |
1082 const CommandLine& cmd_line) { | 1069 const CommandLine& cmd_line) { |
1083 InstallStatus status = installer::UNINSTALL_CONFIRMED; | 1070 InstallStatus status = installer::UNINSTALL_CONFIRMED; |
1084 BrowserDistribution* browser_dist = product.distribution(); | 1071 BrowserDistribution* browser_dist = product.distribution(); |
1085 const string16 chrome_exe( | 1072 const string16 chrome_exe( |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 if (!has_legacy_app_launcher) { | 1258 if (!has_legacy_app_launcher) { |
1272 BrowserDistribution* shadow_app_launcher_dist = | 1259 BrowserDistribution* shadow_app_launcher_dist = |
1273 BrowserDistribution::GetSpecificDistribution( | 1260 BrowserDistribution::GetSpecificDistribution( |
1274 BrowserDistribution::CHROME_APP_HOST); | 1261 BrowserDistribution::CHROME_APP_HOST); |
1275 InstallUtil::DeleteRegistryKey(reg_root, | 1262 InstallUtil::DeleteRegistryKey(reg_root, |
1276 shadow_app_launcher_dist->GetVersionKey()); | 1263 shadow_app_launcher_dist->GetVersionKey()); |
1277 } | 1264 } |
1278 } | 1265 } |
1279 } | 1266 } |
1280 | 1267 |
1281 if (product.is_chrome_frame()) { | |
1282 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, | |
1283 product); | |
1284 } | |
1285 | |
1286 if (installer_state.is_multi_install()) { | 1268 if (installer_state.is_multi_install()) { |
1287 ProcessGoogleUpdateItems(original_state, installer_state, product); | 1269 ProcessGoogleUpdateItems(original_state, installer_state, product); |
1288 | 1270 |
1289 ProcessQuickEnableWorkItems(installer_state, original_state); | 1271 ProcessQuickEnableWorkItems(installer_state, original_state); |
1290 } | 1272 } |
1291 | 1273 |
1292 // Get the state of the installed product (if any) | 1274 // Get the state of the installed product (if any) |
1293 const ProductState* product_state = | 1275 const ProductState* product_state = |
1294 original_state.GetProductState(installer_state.system_install(), | 1276 original_state.GetProductState(installer_state.system_install(), |
1295 browser_dist->GetType()); | 1277 browser_dist->GetType()); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 // If we need a reboot to continue, schedule the parent directories for | 1435 // If we need a reboot to continue, schedule the parent directories for |
1454 // deletion unconditionally. If they are not empty, the session manager | 1436 // deletion unconditionally. If they are not empty, the session manager |
1455 // will not delete them on reboot. | 1437 // will not delete them on reboot. |
1456 ScheduleParentAndGrandparentForDeletion(target_path); | 1438 ScheduleParentAndGrandparentForDeletion(target_path); |
1457 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1439 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
1458 *uninstall_status = UNINSTALL_FAILED; | 1440 *uninstall_status = UNINSTALL_FAILED; |
1459 } | 1441 } |
1460 } | 1442 } |
1461 | 1443 |
1462 } // namespace installer | 1444 } // namespace installer |
OLD | NEW |