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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 *product, installer_state->target_path()); | 1084 *product, installer_state->target_path()); |
1085 } | 1085 } |
1086 } | 1086 } |
1087 } else if (cmd_line.HasSwitch(installer::switches::kSystemLevelToast)) { | 1087 } else if (cmd_line.HasSwitch(installer::switches::kSystemLevelToast)) { |
1088 const Products& products = installer_state->products(); | 1088 const Products& products = installer_state->products(); |
1089 for (size_t i = 0; i < products.size(); ++i) { | 1089 for (size_t i = 0; i < products.size(); ++i) { |
1090 const Product* product = products[i]; | 1090 const Product* product = products[i]; |
1091 BrowserDistribution* browser_dist = product->distribution(); | 1091 BrowserDistribution* browser_dist = product->distribution(); |
1092 // We started as system-level and have been re-launched as user level | 1092 // We started as system-level and have been re-launched as user level |
1093 // to continue with the toast experiment. | 1093 // to continue with the toast experiment. |
1094 scoped_ptr<Version> installed_version( | 1094 Version installed_version; |
1095 InstallUtil::GetChromeVersion(browser_dist, true)); | 1095 InstallUtil::GetChromeVersion(browser_dist, true, &installed_version); |
1096 if (!installed_version.get()) { | 1096 if (!installed_version.IsValid()) { |
1097 LOG(ERROR) << "No installation of " | 1097 LOG(ERROR) << "No installation of " |
1098 << browser_dist->GetAppShortCutName() | 1098 << browser_dist->GetAppShortCutName() |
1099 << " found for system-level toast."; | 1099 << " found for system-level toast."; |
1100 } else { | 1100 } else { |
1101 browser_dist->LaunchUserExperiment(cmd_line.GetProgram(), | 1101 browser_dist->LaunchUserExperiment(cmd_line.GetProgram(), |
1102 installer::REENTRY_SYS_UPDATE, | 1102 installer::REENTRY_SYS_UPDATE, |
1103 *installed_version, *product, true); | 1103 installed_version, *product, true); |
1104 } | 1104 } |
1105 } | 1105 } |
1106 } else if (cmd_line.HasSwitch( | 1106 } else if (cmd_line.HasSwitch( |
1107 installer::switches::kChromeFrameReadyModeOptIn)) { | 1107 installer::switches::kChromeFrameReadyModeOptIn)) { |
1108 *exit_code = InstallUtil::GetInstallReturnCode( | 1108 *exit_code = InstallUtil::GetInstallReturnCode( |
1109 installer::ChromeFrameReadyModeOptIn(original_state, *installer_state)); | 1109 installer::ChromeFrameReadyModeOptIn(original_state, *installer_state)); |
1110 } else if (cmd_line.HasSwitch( | 1110 } else if (cmd_line.HasSwitch( |
1111 installer::switches::kChromeFrameReadyModeTempOptOut)) { | 1111 installer::switches::kChromeFrameReadyModeTempOptOut)) { |
1112 *exit_code = InstallUtil::GetInstallReturnCode( | 1112 *exit_code = InstallUtil::GetInstallReturnCode( |
1113 installer::ChromeFrameReadyModeTempOptOut(original_state, | 1113 installer::ChromeFrameReadyModeTempOptOut(original_state, |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 if (!(installer_state.is_msi() && is_uninstall)) | 1387 if (!(installer_state.is_msi() && is_uninstall)) |
1388 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1388 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1389 // to pass through, since this is only returned on uninstall which is | 1389 // to pass through, since this is only returned on uninstall which is |
1390 // never invoked directly by Google Update. | 1390 // never invoked directly by Google Update. |
1391 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1391 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1392 | 1392 |
1393 VLOG(1) << "Installation complete, returning: " << return_code; | 1393 VLOG(1) << "Installation complete, returning: " << return_code; |
1394 | 1394 |
1395 return return_code; | 1395 return return_code; |
1396 } | 1396 } |
OLD | NEW |