| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 std::wstring params(cmd_params); | 462 std::wstring params(cmd_params); |
| 463 // Append --run-as-admin flag to let the new instance of setup.exe know | 463 // Append --run-as-admin flag to let the new instance of setup.exe know |
| 464 // that we already tried to launch ourselves as admin. | 464 // that we already tried to launch ourselves as admin. |
| 465 params.append(L" --"); | 465 params.append(L" --"); |
| 466 params.append(installer_util::switches::kRunAsAdmin); | 466 params.append(installer_util::switches::kRunAsAdmin); |
| 467 // Append --remove-chrome-registration to remove registry keys only. | 467 // Append --remove-chrome-registration to remove registry keys only. |
| 468 params.append(L" --"); | 468 params.append(L" --"); |
| 469 params.append(installer_util::switches::kRemoveChromeRegistration); | 469 params.append(installer_util::switches::kRemoveChromeRegistration); |
| 470 if (!suffix.empty()) { | 470 if (!suffix.empty()) { |
| 471 params.append(L" --"); | 471 params.append(L" --"); |
| 472 params.append(installer_util::switches::kRegisterChromeBrowserSuffix); | 472 params.append(ASCIIToWide( |
| 473 installer_util::switches::kRegisterChromeBrowserSuffix)); |
| 473 params.append(L"=\"" + suffix + L"\""); | 474 params.append(L"=\"" + suffix + L"\""); |
| 474 } | 475 } |
| 475 DWORD exit_code = installer_util::UNKNOWN_STATUS; | 476 DWORD exit_code = installer_util::UNKNOWN_STATUS; |
| 476 InstallUtil::ExecuteExeAsAdmin(exe, params, &exit_code); | 477 InstallUtil::ExecuteExeAsAdmin(exe, params, &exit_code); |
| 477 } | 478 } |
| 478 } | 479 } |
| 479 | 480 |
| 480 // Get the version of installed Chrome (if any) | 481 // Get the version of installed Chrome (if any) |
| 481 scoped_ptr<installer::Version> | 482 scoped_ptr<installer::Version> |
| 482 installed_version(InstallUtil::GetChromeVersion(system_uninstall)); | 483 installed_version(InstallUtil::GetChromeVersion(system_uninstall)); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 distribution_data); | 570 distribution_data); |
| 570 } | 571 } |
| 571 | 572 |
| 572 // Try and delete the preserved local state once the post-install | 573 // Try and delete the preserved local state once the post-install |
| 573 // operations are complete. | 574 // operations are complete. |
| 574 if (!local_state_path.empty()) | 575 if (!local_state_path.empty()) |
| 575 file_util::Delete(local_state_path, false); | 576 file_util::Delete(local_state_path, false); |
| 576 | 577 |
| 577 return ret; | 578 return ret; |
| 578 } | 579 } |
| OLD | NEW |