Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/installer/setup/setup_main.cc

Issue 10823437: Callback flow to register Chrome and update shortcuts after OS upgrade to Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactoring; changing return value of --on-os-upgrade flow. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 *exit_code = installer::INSTALL_REPAIRED; // Success.
gab 2012/08/30 20:26:28 Use the style in this file, i.e. have HandleOsUpgr
huangs 2012/08/30 20:46:31 As discussed, doing some other way.
1181 } else {
1182 *exit_code = installer::HANDLE_OS_UPGRADE_FAILED;
1183 }
1173 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) { 1184 } else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) {
1174 // Launch the inactive user toast experiment. 1185 // Launch the inactive user toast experiment.
1175 int flavor = -1; 1186 int flavor = -1;
1176 base::StringToInt(cmd_line.GetSwitchValueNative( 1187 base::StringToInt(cmd_line.GetSwitchValueNative(
1177 installer::switches::kInactiveUserToast), &flavor); 1188 installer::switches::kInactiveUserToast), &flavor);
1178 std::string experiment_group = 1189 std::string experiment_group =
1179 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup); 1190 cmd_line.GetSwitchValueASCII(installer::switches::kExperimentGroup);
1180 DCHECK_NE(-1, flavor); 1191 DCHECK_NE(-1, flavor);
1181 if (flavor == -1) { 1192 if (flavor == -1) {
1182 *exit_code = installer::UNKNOWN_STATUS; 1193 *exit_code = installer::UNKNOWN_STATUS;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 if (!(installer_state.is_msi() && is_uninstall)) 1510 if (!(installer_state.is_msi() && is_uninstall))
1500 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1511 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1501 // to pass through, since this is only returned on uninstall which is 1512 // to pass through, since this is only returned on uninstall which is
1502 // never invoked directly by Google Update. 1513 // never invoked directly by Google Update.
1503 return_code = InstallUtil::GetInstallReturnCode(install_status); 1514 return_code = InstallUtil::GetInstallReturnCode(install_status);
1504 1515
1505 VLOG(1) << "Installation complete, returning: " << return_code; 1516 VLOG(1) << "Installation complete, returning: " << return_code;
1506 1517
1507 return return_code; 1518 return return_code;
1508 } 1519 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698