| 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 IDS_INSTALL_OS_ERROR_BASE, | 580 IDS_INSTALL_OS_ERROR_BASE, |
| 581 NULL); | 581 NULL); |
| 582 } else { | 582 } else { |
| 583 *status = installer::EXISTING_VERSION_LAUNCHED; | 583 *status = installer::EXISTING_VERSION_LAUNCHED; |
| 584 base::FilePath chrome_exe = | 584 base::FilePath chrome_exe = |
| 585 install_path.Append(installer::kChromeExe); | 585 install_path.Append(installer::kChromeExe); |
| 586 CommandLine cmd(chrome_exe); | 586 CommandLine cmd(chrome_exe); |
| 587 cmd.AppendSwitch(switches::kForceFirstRun); | 587 cmd.AppendSwitch(switches::kForceFirstRun); |
| 588 installer_state->WriteInstallerResult(*status, 0, NULL); | 588 installer_state->WriteInstallerResult(*status, 0, NULL); |
| 589 VLOG(1) << "Launching existing system-level chrome instead."; | 589 VLOG(1) << "Launching existing system-level chrome instead."; |
| 590 base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 590 base::LaunchProcess(cmd, base::LaunchOptions()); |
| 591 } | 591 } |
| 592 } else { | 592 } else { |
| 593 // It's no longer possible for |product| to be anything other than | 593 // It's no longer possible for |product| to be anything other than |
| 594 // Chrome. | 594 // Chrome. |
| 595 NOTREACHED(); | 595 NOTREACHED(); |
| 596 } | 596 } |
| 597 return false; | 597 return false; |
| 598 } | 598 } |
| 599 } | 599 } |
| 600 | 600 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 // delete them. | 722 // delete them. |
| 723 installer::DeleteChromeDirectoriesIfEmpty(installer_state.target_path()); | 723 installer::DeleteChromeDirectoriesIfEmpty(installer_state.target_path()); |
| 724 | 724 |
| 725 // Trigger Active Setup if it was requested for the chrome product. This needs | 725 // Trigger Active Setup if it was requested for the chrome product. This needs |
| 726 // to be done after the UninstallProduct calls as some of them might | 726 // to be done after the UninstallProduct calls as some of them might |
| 727 // otherwise terminate the process launched by TriggerActiveSetupCommand(). | 727 // otherwise terminate the process launched by TriggerActiveSetupCommand(). |
| 728 if (chrome && cmd_line.HasSwitch(installer::switches::kTriggerActiveSetup)) | 728 if (chrome && cmd_line.HasSwitch(installer::switches::kTriggerActiveSetup)) |
| 729 InstallUtil::TriggerActiveSetupCommand(); | 729 InstallUtil::TriggerActiveSetupCommand(); |
| 730 | 730 |
| 731 if (!system_level_cmd.GetProgram().empty()) | 731 if (!system_level_cmd.GetProgram().empty()) |
| 732 base::LaunchProcess(system_level_cmd, base::LaunchOptions(), NULL); | 732 base::LaunchProcess(system_level_cmd, base::LaunchOptions()); |
| 733 | 733 |
| 734 // Tell Google Update that an uninstall has taken place. | 734 // Tell Google Update that an uninstall has taken place. |
| 735 // Ignore the return value: success or failure of Google Update | 735 // Ignore the return value: success or failure of Google Update |
| 736 // has no bearing on the success or failure of Chrome's uninstallation. | 736 // has no bearing on the success or failure of Chrome's uninstallation. |
| 737 google_update::UninstallGoogleUpdate(installer_state.system_install()); | 737 google_update::UninstallGoogleUpdate(installer_state.system_install()); |
| 738 | 738 |
| 739 return install_status; | 739 return install_status; |
| 740 } | 740 } |
| 741 | 741 |
| 742 // Uninstall the binaries if they are the only product present and they're not | 742 // Uninstall the binaries if they are the only product present and they're not |
| (...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1819 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
| 1820 // to pass through, since this is only returned on uninstall which is | 1820 // to pass through, since this is only returned on uninstall which is |
| 1821 // never invoked directly by Google Update. | 1821 // never invoked directly by Google Update. |
| 1822 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1822 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 1823 } | 1823 } |
| 1824 | 1824 |
| 1825 VLOG(1) << "Installation complete, returning: " << return_code; | 1825 VLOG(1) << "Installation complete, returning: " << return_code; |
| 1826 | 1826 |
| 1827 return return_code; | 1827 return return_code; |
| 1828 } | 1828 } |
| OLD | NEW |