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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 bool success = update_list->Do(); | 147 bool success = update_list->Do(); |
148 LOG_IF(ERROR, !success) << "Failed updating channel values."; | 148 LOG_IF(ERROR, !success) << "Failed updating channel values."; |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 void ProcessOnOsUpgradeWorkItems( | 152 void ProcessOnOsUpgradeWorkItems( |
153 const installer::InstallerState& installer_state, | 153 const installer::InstallerState& installer_state, |
154 const installer::Product& product) { | 154 const installer::Product& product) { |
155 scoped_ptr<WorkItemList> work_item_list( | 155 scoped_ptr<WorkItemList> work_item_list( |
156 WorkItem::CreateNoRollbackWorkItemList()); | 156 WorkItem::CreateNoRollbackWorkItemList()); |
157 AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, | 157 AddOsUpgradeWorkItems(installer_state, base::FilePath(), base::Version(), |
158 work_item_list.get()); | 158 product, work_item_list.get()); |
159 if (!work_item_list->Do()) | 159 if (!work_item_list->Do()) |
160 LOG(ERROR) << "Failed to remove on-os-upgrade command."; | 160 LOG(ERROR) << "Failed to remove on-os-upgrade command."; |
161 } | 161 } |
162 | 162 |
163 void ProcessIELowRightsPolicyWorkItems( | 163 void ProcessIELowRightsPolicyWorkItems( |
164 const installer::InstallerState& installer_state) { | 164 const installer::InstallerState& installer_state) { |
165 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList()); | 165 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList()); |
166 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); | 166 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); |
167 work_items->Do(); | 167 work_items->Do(); |
168 installer::RefreshElevationPolicy(); | 168 installer::RefreshElevationPolicy(); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 if (!vendor_directory.empty()) | 514 if (!vendor_directory.empty()) |
515 result = DeleteEmptyDir(vendor_directory); | 515 result = DeleteEmptyDir(vendor_directory); |
516 } | 516 } |
517 } | 517 } |
518 } | 518 } |
519 if (result == DELETE_NOT_EMPTY) | 519 if (result == DELETE_NOT_EMPTY) |
520 result = DELETE_SUCCEEDED; | 520 result = DELETE_SUCCEEDED; |
521 return result; | 521 return result; |
522 } | 522 } |
523 | 523 |
524 DeleteResult DeleteAppHostFilesAndFolders(const InstallerState& installer_state, | 524 DeleteResult DeleteAppHostFilesAndFolders( |
525 const Version& installed_version) { | 525 const InstallerState& installer_state, |
| 526 const base::Version& installed_version) { |
526 const base::FilePath& target_path = installer_state.target_path(); | 527 const base::FilePath& target_path = installer_state.target_path(); |
527 if (target_path.empty()) { | 528 if (target_path.empty()) { |
528 LOG(ERROR) << "DeleteAppHostFilesAndFolders: no installation destination " | 529 LOG(ERROR) << "DeleteAppHostFilesAndFolders: no installation destination " |
529 << "path."; | 530 << "path."; |
530 return DELETE_FAILED; // Nothing else we can do to uninstall, so we return. | 531 return DELETE_FAILED; // Nothing else we can do to uninstall, so we return. |
531 } | 532 } |
532 | 533 |
533 DeleteInstallTempDir(target_path); | 534 DeleteInstallTempDir(target_path); |
534 | 535 |
535 DeleteResult result = DELETE_SUCCEEDED; | 536 DeleteResult result = DELETE_SUCCEEDED; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 } | 910 } |
910 } | 911 } |
911 | 912 |
912 // Builds and executes a work item list to remove DelegateExecute verb handler | 913 // Builds and executes a work item list to remove DelegateExecute verb handler |
913 // work items for |product|. This will be a noop for products whose | 914 // work items for |product|. This will be a noop for products whose |
914 // corresponding BrowserDistribution implementations do not publish a CLSID via | 915 // corresponding BrowserDistribution implementations do not publish a CLSID via |
915 // GetCommandExecuteImplClsid. | 916 // GetCommandExecuteImplClsid. |
916 bool ProcessDelegateExecuteWorkItems(const InstallerState& installer_state, | 917 bool ProcessDelegateExecuteWorkItems(const InstallerState& installer_state, |
917 const Product& product) { | 918 const Product& product) { |
918 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); | 919 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); |
919 AddDelegateExecuteWorkItems(installer_state, base::FilePath(), Version(), | 920 AddDelegateExecuteWorkItems(installer_state, base::FilePath(), |
920 product, item_list.get()); | 921 base::Version(), product, item_list.get()); |
921 return item_list->Do(); | 922 return item_list->Do(); |
922 } | 923 } |
923 | 924 |
924 // Removes Active Setup entries from the registry. This cannot be done through | 925 // Removes Active Setup entries from the registry. This cannot be done through |
925 // a work items list as usual because of different paths based on conditionals, | 926 // a work items list as usual because of different paths based on conditionals, |
926 // but otherwise respects the no rollback/best effort uninstall mentality. | 927 // but otherwise respects the no rollback/best effort uninstall mentality. |
927 // This will only apply for system-level installs of Chrome/Chromium and will be | 928 // This will only apply for system-level installs of Chrome/Chromium and will be |
928 // a no-op for all other types of installs. | 929 // a no-op for all other types of installs. |
929 void UninstallActiveSetupEntries(const InstallerState& installer_state, | 930 void UninstallActiveSetupEntries(const InstallerState& installer_state, |
930 const Product& product) { | 931 const Product& product) { |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 // If we need a reboot to continue, schedule the parent directories for | 1417 // If we need a reboot to continue, schedule the parent directories for |
1417 // deletion unconditionally. If they are not empty, the session manager | 1418 // deletion unconditionally. If they are not empty, the session manager |
1418 // will not delete them on reboot. | 1419 // will not delete them on reboot. |
1419 ScheduleParentAndGrandparentForDeletion(target_path); | 1420 ScheduleParentAndGrandparentForDeletion(target_path); |
1420 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1421 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
1421 *uninstall_status = UNINSTALL_FAILED; | 1422 *uninstall_status = UNINSTALL_FAILED; |
1422 } | 1423 } |
1423 } | 1424 } |
1424 | 1425 |
1425 } // namespace installer | 1426 } // namespace installer |
OLD | NEW |