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 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 original_state.GetProductState(system_level, distribution->GetType()); | 131 original_state.GetProductState(system_level, distribution->GetType()); |
132 DCHECK(product_state != NULL); | 132 DCHECK(product_state != NULL); |
133 ChannelInfo channel_info; | 133 ChannelInfo channel_info; |
134 | 134 |
135 // Remove product's flags from the channel value. | 135 // Remove product's flags from the channel value. |
136 channel_info.set_value(product_state->channel().value()); | 136 channel_info.set_value(product_state->channel().value()); |
137 const bool modified = product.SetChannelFlags(false, &channel_info); | 137 const bool modified = product.SetChannelFlags(false, &channel_info); |
138 | 138 |
139 // Apply the new channel value to all other products and to the multi package. | 139 // Apply the new channel value to all other products and to the multi package. |
140 if (modified) { | 140 if (modified) { |
141 std::unique_ptr<WorkItemList> update_list(WorkItem::CreateWorkItemList()); | 141 std::unique_ptr<WorkItemList> update_list( |
142 update_list->set_log_message("Channel Value Update"); | 142 WorkItem::CreateNoRollbackWorkItemList()); |
143 update_list->set_best_effort(true); | |
144 update_list->set_rollback_enabled(false); | |
145 std::vector<BrowserDistribution::Type> dist_types; | 143 std::vector<BrowserDistribution::Type> dist_types; |
146 for (size_t i = 0; i < BrowserDistribution::NUM_TYPES; ++i) { | 144 for (size_t i = 0; i < BrowserDistribution::NUM_TYPES; ++i) { |
147 BrowserDistribution::Type other_dist_type = | 145 BrowserDistribution::Type other_dist_type = |
148 static_cast<BrowserDistribution::Type>(i); | 146 static_cast<BrowserDistribution::Type>(i); |
149 if (distribution->GetType() != other_dist_type) | 147 if (distribution->GetType() != other_dist_type) |
150 dist_types.push_back(other_dist_type); | 148 dist_types.push_back(other_dist_type); |
151 } | 149 } |
152 AddChannelValueUpdateWorkItems(original_state, installer_state, | 150 AddChannelValueUpdateWorkItems(original_state, installer_state, |
153 channel_info, dist_types, | 151 channel_info, dist_types, |
154 update_list.get()); | 152 update_list.get()); |
155 update_list->Do(); | 153 bool success = update_list->Do(); |
| 154 LOG_IF(ERROR, !success) << "Failed updating channel values."; |
156 } | 155 } |
157 } | 156 } |
158 | 157 |
159 // Processes uninstall WorkItems from install_worker in no-rollback-list. | 158 // Processes uninstall WorkItems from install_worker in no-rollback-list. |
160 void ProcessChromeWorkItems(const InstallerState& installer_state, | 159 void ProcessChromeWorkItems(const InstallerState& installer_state, |
161 const Product& product) { | 160 const Product& product) { |
162 std::unique_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); | 161 std::unique_ptr<WorkItemList> work_item_list( |
163 work_item_list->set_log_message( | 162 WorkItem::CreateNoRollbackWorkItemList()); |
164 "Cleanup OS upgrade command and deprecated per-user registrations"); | |
165 work_item_list->set_best_effort(true); | |
166 work_item_list->set_rollback_enabled(false); | |
167 AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, | 163 AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, |
168 work_item_list.get()); | 164 work_item_list.get()); |
169 // Perform a best-effort cleanup of per-user keys. On system-level installs | 165 // Perform a best-effort cleanup of per-user keys. On system-level installs |
170 // this will only cleanup keys for the user running the uninstall but it was | 166 // this will only cleanup keys for the user running the uninstall but it was |
171 // considered that this was good enough (better than triggering Active Setup | 167 // considered that this was good enough (better than triggering Active Setup |
172 // for all users solely for this cleanup). | 168 // for all users solely for this cleanup). |
173 AddCleanupDeprecatedPerUserRegistrationsWorkItems(product, | 169 AddCleanupDeprecatedPerUserRegistrationsWorkItems(product, |
174 work_item_list.get()); | 170 work_item_list.get()); |
175 work_item_list->Do(); | 171 if (!work_item_list->Do()) |
| 172 LOG(ERROR) << "Failed to process Chrome WorkItems."; |
176 } | 173 } |
177 | 174 |
178 void ProcessIELowRightsPolicyWorkItems(const InstallerState& installer_state) { | 175 void ProcessIELowRightsPolicyWorkItems(const InstallerState& installer_state) { |
179 std::unique_ptr<WorkItemList> work_items(WorkItem::CreateWorkItemList()); | 176 std::unique_ptr<WorkItemList> work_items( |
180 work_items->set_log_message("Delete old IE low rights policy"); | 177 WorkItem::CreateNoRollbackWorkItemList()); |
181 work_items->set_best_effort(true); | |
182 work_items->set_rollback_enabled(false); | |
183 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); | 178 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); |
184 work_items->Do(); | 179 work_items->Do(); |
185 RefreshElevationPolicy(); | 180 RefreshElevationPolicy(); |
186 } | 181 } |
187 | 182 |
188 void ClearRlzProductState() { | 183 void ClearRlzProductState() { |
189 const rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX, | 184 const rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX, |
190 rlz_lib::CHROME_HOME_PAGE, | 185 rlz_lib::CHROME_HOME_PAGE, |
191 rlz_lib::CHROME_APP_LIST, | 186 rlz_lib::CHROME_APP_LIST, |
192 rlz_lib::NO_ACCESS_POINT}; | 187 rlz_lib::NO_ACCESS_POINT}; |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 // If we need a reboot to continue, schedule the parent directories for | 1431 // If we need a reboot to continue, schedule the parent directories for |
1437 // deletion unconditionally. If they are not empty, the session manager | 1432 // deletion unconditionally. If they are not empty, the session manager |
1438 // will not delete them on reboot. | 1433 // will not delete them on reboot. |
1439 ScheduleParentAndGrandparentForDeletion(target_path); | 1434 ScheduleParentAndGrandparentForDeletion(target_path); |
1440 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1435 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
1441 *uninstall_status = UNINSTALL_FAILED; | 1436 *uninstall_status = UNINSTALL_FAILED; |
1442 } | 1437 } |
1443 } | 1438 } |
1444 | 1439 |
1445 } // namespace installer | 1440 } // namespace installer |
OLD | NEW |