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 <windows.h> | 5 #include <windows.h> |
6 #include <msi.h> | 6 #include <msi.h> |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 } | 1163 } |
1164 installer::InstallStatus tmp = installer::UNKNOWN_STATUS; | 1164 installer::InstallStatus tmp = installer::UNKNOWN_STATUS; |
1165 const Product* chrome_install = | 1165 const Product* chrome_install = |
1166 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); | 1166 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); |
1167 DCHECK(chrome_install); | 1167 DCHECK(chrome_install); |
1168 if (chrome_install) { | 1168 if (chrome_install) { |
1169 installer::DeleteChromeRegistrationKeys(chrome_install->distribution(), | 1169 installer::DeleteChromeRegistrationKeys(chrome_install->distribution(), |
1170 HKEY_LOCAL_MACHINE, suffix, installer_state->target_path(), &tmp); | 1170 HKEY_LOCAL_MACHINE, suffix, installer_state->target_path(), &tmp); |
1171 } | 1171 } |
1172 *exit_code = tmp; | 1172 *exit_code = tmp; |
| 1173 } else if (cmd_line.HasSwitch(installer::switches::kOnOsUpgrade)) { |
| 1174 const Product* chrome_install = |
| 1175 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); |
| 1176 if (chrome_install) { |
| 1177 installer::HandleOsUpgradeForBrowser(*installer_state, |
| 1178 *chrome_install, |
| 1179 cmd_line.GetProgram()); |
| 1180 } |
| 1181 *exit_code = InstallUtil::GetInstallReturnCode(installer::INSTALL_REPAIRED); |
1173 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) { | 1182 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) { |
1174 // Launch the inactive user toast experiment. | 1183 // Launch the inactive user toast experiment. |
1175 int flavor = -1; | 1184 int flavor = -1; |
1176 base::StringToInt(cmd_line.GetSwitchValueNative( | 1185 base::StringToInt(cmd_line.GetSwitchValueNative( |
1177 installer::switches::kInactiveUserToast), &flavor); | 1186 installer::switches::kInactiveUserToast), &flavor); |
1178 std::string experiment_group = | 1187 std::string experiment_group = |
1179 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup); | 1188 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup); |
1180 DCHECK_NE(-1, flavor); | 1189 DCHECK_NE(-1, flavor); |
1181 if (flavor == -1) { | 1190 if (flavor == -1) { |
1182 *exit_code = installer::UNKNOWN_STATUS; | 1191 *exit_code = installer::UNKNOWN_STATUS; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 if (!(installer_state.is_msi() && is_uninstall)) | 1508 if (!(installer_state.is_msi() && is_uninstall)) |
1500 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1509 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1501 // to pass through, since this is only returned on uninstall which is | 1510 // to pass through, since this is only returned on uninstall which is |
1502 // never invoked directly by Google Update. | 1511 // never invoked directly by Google Update. |
1503 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1512 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1504 | 1513 |
1505 VLOG(1) << "Installation complete, returning: " << return_code; | 1514 VLOG(1) << "Installation complete, returning: " << return_code; |
1506 | 1515 |
1507 return return_code; | 1516 return return_code; |
1508 } | 1517 } |
OLD | NEW |