OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 5 #include <string> |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include <msi.h> | 7 #include <msi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 | 10 |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/process_util.h" |
16 #include "base/registry.h" | 17 #include "base/registry.h" |
17 #include "base/scoped_handle_win.h" | 18 #include "base/scoped_handle_win.h" |
18 #include "base/string_util.h" | 19 #include "base/string_util.h" |
19 #include "base/win_util.h" | 20 #include "base/win_util.h" |
20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/installer/setup/install.h" | 22 #include "chrome/installer/setup/install.h" |
22 #include "chrome/installer/setup/setup_constants.h" | 23 #include "chrome/installer/setup/setup_constants.h" |
23 #include "chrome/installer/setup/setup_util.h" | 24 #include "chrome/installer/setup/setup_util.h" |
24 #include "chrome/installer/setup/uninstall.h" | 25 #include "chrome/installer/setup/uninstall.h" |
25 #include "chrome/installer/util/browser_distribution.h" | 26 #include "chrome/installer/util/browser_distribution.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 status = installer_util::OS_ERROR; | 170 status = installer_util::OS_ERROR; |
170 InstallUtil::WriteInstallerResult(system_install, status, | 171 InstallUtil::WriteInstallerResult(system_install, status, |
171 IDS_INSTALL_OS_ERROR_BASE, NULL); | 172 IDS_INSTALL_OS_ERROR_BASE, NULL); |
172 return false; | 173 return false; |
173 } else { | 174 } else { |
174 status = installer_util::EXISTING_VERSION_LAUNCHED; | 175 status = installer_util::EXISTING_VERSION_LAUNCHED; |
175 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); | 176 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); |
176 chrome_exe = L"\"" + chrome_exe + L"\" --" | 177 chrome_exe = L"\"" + chrome_exe + L"\" --" |
177 + ASCIIToWide(switches::kFirstRun); | 178 + ASCIIToWide(switches::kFirstRun); |
178 InstallUtil::WriteInstallerResult(system_install, status, | 179 InstallUtil::WriteInstallerResult(system_install, status, |
179 0, &chrome_exe); | 180 0, NULL); |
180 LOG(INFO) << "Launching existing system-level chrome instead."; | 181 LOG(INFO) << "Launching existing system-level chrome instead."; |
| 182 base::LaunchApp(chrome_exe, false, false, NULL); |
181 return false; | 183 return false; |
182 } | 184 } |
183 } | 185 } |
184 // This is an update, not an install. Omaha should know the difference | 186 // This is an update, not an install. Omaha should know the difference |
185 // and not show a dialog. | 187 // and not show a dialog. |
186 status = system_install ? installer_util::USER_LEVEL_INSTALL_EXISTS : | 188 status = system_install ? installer_util::USER_LEVEL_INSTALL_EXISTS : |
187 installer_util::SYSTEM_LEVEL_INSTALL_EXISTS; | 189 installer_util::SYSTEM_LEVEL_INSTALL_EXISTS; |
188 int str_id = system_install ? IDS_INSTALL_USER_LEVEL_EXISTS_BASE : | 190 int str_id = system_install ? IDS_INSTALL_USER_LEVEL_EXISTS_BASE : |
189 IDS_INSTALL_SYSTEM_LEVEL_EXISTS_BASE; | 191 IDS_INSTALL_SYSTEM_LEVEL_EXISTS_BASE; |
190 InstallUtil::WriteInstallerResult(system_install, status, str_id, NULL); | 192 InstallUtil::WriteInstallerResult(system_install, status, str_id, NULL); |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 if (!(parsed_command_line.HasSwitch(installer_util::switches::kMsi) && | 717 if (!(parsed_command_line.HasSwitch(installer_util::switches::kMsi) && |
716 parsed_command_line.HasSwitch(installer_util::switches::kUninstall))) { | 718 parsed_command_line.HasSwitch(installer_util::switches::kUninstall))) { |
717 // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT | 719 // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT |
718 // to pass through, since this is only returned on uninstall which is never | 720 // to pass through, since this is only returned on uninstall which is never |
719 // invoked directly by Google Update. | 721 // invoked directly by Google Update. |
720 dist->GetInstallReturnCode(install_status); | 722 dist->GetInstallReturnCode(install_status); |
721 } | 723 } |
722 | 724 |
723 return return_code; | 725 return return_code; |
724 } | 726 } |
OLD | NEW |