| 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 #include "chrome/installer/setup/setup_main.h" | 5 #include "chrome/installer/setup/setup_main.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <msi.h> | 8 #include <msi.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 // Generate a command line to run Chrome's installer. | 675 // Generate a command line to run Chrome's installer. |
| 676 base::string16 setup_path; | 676 base::string16 setup_path; |
| 677 if (key.ReadValue(installer::kUninstallStringField, | 677 if (key.ReadValue(installer::kUninstallStringField, |
| 678 &setup_path) != ERROR_SUCCESS) { | 678 &setup_path) != ERROR_SUCCESS) { |
| 679 LOG(ERROR) << "RepairChrome: Failed to read Chrome's UninstallString."; | 679 LOG(ERROR) << "RepairChrome: Failed to read Chrome's UninstallString."; |
| 680 return; | 680 return; |
| 681 } | 681 } |
| 682 | 682 |
| 683 // Replace --uninstall with --do-not-launch-chrome to cause chrome to | 683 // Replace --uninstall with --do-not-launch-chrome to cause chrome to |
| 684 // self-repair. | 684 // self-repair. |
| 685 ReplaceFirstSubstringAfterOffset( | 685 base::ReplaceFirstSubstringAfterOffset( |
| 686 &setup_args, 0, base::UTF8ToUTF16(installer::switches::kUninstall), | 686 &setup_args, 0, base::UTF8ToUTF16(installer::switches::kUninstall), |
| 687 base::UTF8ToUTF16(installer::switches::kDoNotLaunchChrome)); | 687 base::UTF8ToUTF16(installer::switches::kDoNotLaunchChrome)); |
| 688 base::CommandLine setup_command(base::CommandLine::NO_PROGRAM); | 688 base::CommandLine setup_command(base::CommandLine::NO_PROGRAM); |
| 689 InstallUtil::ComposeCommandLine(setup_path, setup_args, &setup_command); | 689 InstallUtil::ComposeCommandLine(setup_path, setup_args, &setup_command); |
| 690 | 690 |
| 691 // Run Chrome's installer so that it repairs itself. Break away from any job | 691 // Run Chrome's installer so that it repairs itself. Break away from any job |
| 692 // in which this operation is running so that Google Update doesn't wait | 692 // in which this operation is running so that Google Update doesn't wait |
| 693 // around for the repair. Retry once without the attempt to break away in case | 693 // around for the repair. Retry once without the attempt to break away in case |
| 694 // this process doesn't have JOB_OBJECT_LIMIT_BREAKAWAY_OK. | 694 // this process doesn't have JOB_OBJECT_LIMIT_BREAKAWAY_OK. |
| 695 base::LaunchOptions launch_options; | 695 base::LaunchOptions launch_options; |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1723 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1723 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
| 1724 // to pass through, since this is only returned on uninstall which is | 1724 // to pass through, since this is only returned on uninstall which is |
| 1725 // never invoked directly by Google Update. | 1725 // never invoked directly by Google Update. |
| 1726 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1726 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 1727 } | 1727 } |
| 1728 | 1728 |
| 1729 VLOG(1) << "Installation complete, returning: " << return_code; | 1729 VLOG(1) << "Installation complete, returning: " << return_code; |
| 1730 | 1730 |
| 1731 return return_code; | 1731 return return_code; |
| 1732 } | 1732 } |
| OLD | NEW |