Chromium Code Reviews| 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 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
| 16 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
| 18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 20 #include "base/win/registry.h" | 20 #include "base/win/registry.h" |
| 21 #include "base/win/scoped_handle.h" | 21 #include "base/win/scoped_handle.h" |
| 22 #include "base/win/shortcut.h" | 22 #include "base/win/shortcut.h" |
| 23 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
| 24 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
| 25 #include "chrome/common/chrome_paths_internal.h" | 25 #include "chrome/common/chrome_paths_internal.h" |
| 26 #include "chrome/common/chrome_result_codes.h" | 26 #include "chrome/common/chrome_result_codes.h" |
| 27 #include "chrome/common/chrome_switches.h" | |
|
grt (UTC plus 2)
2013/01/02 17:59:33
remove?
gab
2013/01/02 21:15:48
Oops, leftover from before I moved it all to setup
| |
| 27 #include "chrome/installer/setup/install.h" | 28 #include "chrome/installer/setup/install.h" |
| 28 #include "chrome/installer/setup/install_worker.h" | 29 #include "chrome/installer/setup/install_worker.h" |
| 29 #include "chrome/installer/setup/setup_constants.h" | 30 #include "chrome/installer/setup/setup_constants.h" |
| 30 #include "chrome/installer/setup/setup_util.h" | 31 #include "chrome/installer/setup/setup_util.h" |
| 31 #include "chrome/installer/util/auto_launch_util.h" | 32 #include "chrome/installer/util/auto_launch_util.h" |
| 32 #include "chrome/installer/util/browser_distribution.h" | 33 #include "chrome/installer/util/browser_distribution.h" |
| 33 #include "chrome/installer/util/channel_info.h" | 34 #include "chrome/installer/util/channel_info.h" |
| 34 #include "chrome/installer/util/delete_after_reboot_helper.h" | 35 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 35 #include "chrome/installer/util/google_update_constants.h" | 36 #include "chrome/installer/util/google_update_constants.h" |
| 36 #include "chrome/installer/util/google_update_settings.h" | 37 #include "chrome/installer/util/google_update_settings.h" |
| (...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1320 VLOG(1) << "Uninstallation complete. Launching post-uninstall operations."; | 1321 VLOG(1) << "Uninstallation complete. Launching post-uninstall operations."; |
| 1321 browser_dist->DoPostUninstallOperations(product_state->version(), | 1322 browser_dist->DoPostUninstallOperations(product_state->version(), |
| 1322 backup_state_file, distribution_data); | 1323 backup_state_file, distribution_data); |
| 1323 } | 1324 } |
| 1324 | 1325 |
| 1325 // Try and delete the preserved local state once the post-install | 1326 // Try and delete the preserved local state once the post-install |
| 1326 // operations are complete. | 1327 // operations are complete. |
| 1327 if (!backup_state_file.empty()) | 1328 if (!backup_state_file.empty()) |
| 1328 file_util::Delete(backup_state_file, false); | 1329 file_util::Delete(backup_state_file, false); |
| 1329 | 1330 |
| 1330 // If user-level Chrome is being uninstalled and system-level Chrome is | |
| 1331 // present, launch the system-level Active Setup command to do post-install | |
| 1332 // tasks for this user (i.e., create shortcuts). | |
| 1333 if (product.is_chrome() && !installer_state.system_install() && | |
| 1334 original_state.GetProductState(true, browser_dist->GetType())) { | |
| 1335 InstallUtil::TriggerActiveSetupCommand(); | |
| 1336 } | |
| 1337 | |
| 1338 return ret; | 1331 return ret; |
| 1339 } | 1332 } |
| 1340 | 1333 |
| 1341 void CleanUpInstallationDirectoryAfterUninstall( | 1334 void CleanUpInstallationDirectoryAfterUninstall( |
| 1342 const InstallationState& original_state, | 1335 const InstallationState& original_state, |
| 1343 const InstallerState& installer_state, | 1336 const InstallerState& installer_state, |
| 1344 const CommandLine& cmd_line, | 1337 const CommandLine& cmd_line, |
| 1345 installer::InstallStatus* uninstall_status) { | 1338 installer::InstallStatus* uninstall_status) { |
| 1346 if (*uninstall_status != installer::UNINSTALL_SUCCESSFUL && | 1339 if (*uninstall_status != installer::UNINSTALL_SUCCESSFUL && |
| 1347 *uninstall_status != installer::UNINSTALL_REQUIRES_REBOOT) { | 1340 *uninstall_status != installer::UNINSTALL_REQUIRES_REBOOT) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1409 // deletion unconditionally. If they are not empty, the session manager | 1402 // deletion unconditionally. If they are not empty, the session manager |
| 1410 // will not delete them on reboot. | 1403 // will not delete them on reboot. |
| 1411 ScheduleParentAndGrandparentForDeletion(target_path); | 1404 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1412 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1405 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
| 1413 installer::DELETE_FAILED) { | 1406 installer::DELETE_FAILED) { |
| 1414 *uninstall_status = installer::UNINSTALL_FAILED; | 1407 *uninstall_status = installer::UNINSTALL_FAILED; |
| 1415 } | 1408 } |
| 1416 } | 1409 } |
| 1417 | 1410 |
| 1418 } // namespace installer | 1411 } // namespace installer |
| OLD | NEW |