OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 return status; | 463 return status; |
464 | 464 |
465 // Check if we need admin rights to cleanup HKLM. If we do, try to launch | 465 // Check if we need admin rights to cleanup HKLM. If we do, try to launch |
466 // another uninstaller (silent) in elevated mode to do HKLM cleanup. | 466 // another uninstaller (silent) in elevated mode to do HKLM cleanup. |
467 // And continue uninstalling in the current process also to do HKCU cleanup. | 467 // And continue uninstalling in the current process also to do HKCU cleanup. |
468 if (remove_all && | 468 if (remove_all && |
469 (!suffix.empty() || CurrentUserHasDefaultBrowser(system_uninstall)) && | 469 (!suffix.empty() || CurrentUserHasDefaultBrowser(system_uninstall)) && |
470 !::IsUserAnAdmin() && | 470 !::IsUserAnAdmin() && |
471 (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) && | 471 (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) && |
472 !cmd_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { | 472 !cmd_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { |
473 std::wstring exe = cmd_line.program(); | 473 std::wstring exe = cmd_line.GetProgram().value(); |
474 std::wstring params(cmd_params); | 474 std::wstring params(cmd_params); |
475 // Append --run-as-admin flag to let the new instance of setup.exe know | 475 // Append --run-as-admin flag to let the new instance of setup.exe know |
476 // that we already tried to launch ourselves as admin. | 476 // that we already tried to launch ourselves as admin. |
477 params.append(L" --"); | 477 params.append(L" --"); |
478 params.append(installer_util::switches::kRunAsAdmin); | 478 params.append(installer_util::switches::kRunAsAdmin); |
479 // Append --remove-chrome-registration to remove registry keys only. | 479 // Append --remove-chrome-registration to remove registry keys only. |
480 params.append(L" --"); | 480 params.append(L" --"); |
481 params.append(installer_util::switches::kRemoveChromeRegistration); | 481 params.append(installer_util::switches::kRemoveChromeRegistration); |
482 if (!suffix.empty()) { | 482 if (!suffix.empty()) { |
483 params.append(L" --"); | 483 params.append(L" --"); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 distribution_data); | 589 distribution_data); |
590 } | 590 } |
591 | 591 |
592 // Try and delete the preserved local state once the post-install | 592 // Try and delete the preserved local state once the post-install |
593 // operations are complete. | 593 // operations are complete. |
594 if (!local_state_path.empty()) | 594 if (!local_state_path.empty()) |
595 file_util::Delete(local_state_path, false); | 595 file_util::Delete(local_state_path, false); |
596 | 596 |
597 return ret; | 597 return ret; |
598 } | 598 } |
OLD | NEW |