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

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

Issue 216153006: Invoke setup.exe to reenable updates when the update bubble is clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mad2
Patch Set: Created 6 years, 9 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
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 "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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 *exit_code = installer::CourgettePatchFiles(input_file, 1192 *exit_code = installer::CourgettePatchFiles(input_file,
1193 patch_file, 1193 patch_file,
1194 output_file); 1194 output_file);
1195 } else if (patch_type_str == installer::kBsdiff) { 1195 } else if (patch_type_str == installer::kBsdiff) {
1196 *exit_code = installer::BsdiffPatchFiles(input_file, 1196 *exit_code = installer::BsdiffPatchFiles(input_file,
1197 patch_file, 1197 patch_file,
1198 output_file); 1198 output_file);
1199 } else { 1199 } else {
1200 *exit_code = installer::PATCH_INVALID_ARGUMENTS; 1200 *exit_code = installer::PATCH_INVALID_ARGUMENTS;
1201 } 1201 }
1202 } else if (cmd_line.HasSwitch(installer::switches::kReenableAutoupdates)) {
1203 // setup.exe has been asked to attempt to reenable updates for Chrome.
1204 // Figure out whether we should do so for the multi binaries or the main
1205 // Chrome product.
1206 const ProductState* chrome_state = original_state.GetProductState(
1207 installer_state->system_install(), BrowserDistribution::CHROME_BROWSER);
1208
1209 BrowserDistribution::Type dist_type = BrowserDistribution::CHROME_BROWSER;
1210 if (chrome_state && chrome_state->is_multi_install())
1211 dist_type = BrowserDistribution::CHROME_BINARIES;
1212
1213 BrowserDistribution* dist =
1214 BrowserDistribution::GetSpecificDistribution(dist_type);
1215 bool updates_enabled =
1216 GoogleUpdateSettings::ReenableAutoupdatesForApp(dist->GetAppGuid());
1217 *exit_code = updates_enabled ? installer::REENABLE_UPDATES_SUCCEEDED :
1218 installer::REENABLE_UPDATES_FAILED;
1202 } else { 1219 } else {
1203 handled = false; 1220 handled = false;
1204 } 1221 }
1205 1222
1206 return handled; 1223 return handled;
1207 } 1224 }
1208 1225
1209 bool ShowRebootDialog() { 1226 bool ShowRebootDialog() {
1210 // Get a token for this process. 1227 // Get a token for this process.
1211 HANDLE token; 1228 HANDLE token;
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1834 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1818 // to pass through, since this is only returned on uninstall which is 1835 // to pass through, since this is only returned on uninstall which is
1819 // never invoked directly by Google Update. 1836 // never invoked directly by Google Update.
1820 return_code = InstallUtil::GetInstallReturnCode(install_status); 1837 return_code = InstallUtil::GetInstallReturnCode(install_status);
1821 } 1838 }
1822 1839
1823 VLOG(1) << "Installation complete, returning: " << return_code; 1840 VLOG(1) << "Installation complete, returning: " << return_code;
1824 1841
1825 return return_code; 1842 return return_code;
1826 } 1843 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698