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

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

Issue 1914213002: Support rollback with installerdata in mini_installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr Created 4 years, 7 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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 "too many distribution types"); 1509 "too many distribution types");
1510 const Products& products = installer_state.products(); 1510 const Products& products = installer_state.products();
1511 for (Products::const_iterator it = products.begin(); it < products.end(); 1511 for (Products::const_iterator it = products.begin(); it < products.end();
1512 ++it) { 1512 ++it) {
1513 const Product& product = **it; 1513 const Product& product = **it;
1514 const ProductState* product_state = 1514 const ProductState* product_state =
1515 original_state.GetProductState(system_install, 1515 original_state.GetProductState(system_install,
1516 product.distribution()->GetType()); 1516 product.distribution()->GetType());
1517 if (product_state != NULL && 1517 if (product_state != NULL &&
1518 (product_state->version().CompareTo(*installer_version) > 0)) { 1518 (product_state->version().CompareTo(*installer_version) > 0)) {
1519 LOG(ERROR) << "Higher version of " 1519 LOG(ERROR) << "Higher version of "
grt (UTC plus 2) 2016/04/28 16:55:30 i think this ERROR will be confusing to see in the
zmin 2016/04/28 17:51:29 How about we also bypass this part when downgrade
grt (UTC plus 2) 2016/04/28 20:13:45 sgtm
1520 << product.distribution()->GetDisplayName() 1520 << product.distribution()->GetDisplayName()
1521 << " is already installed."; 1521 << " is already installed.";
1522 higher_products |= (1 << product.distribution()->GetType()); 1522 higher_products |= (1 << product.distribution()->GetType());
1523 } 1523 }
1524 } 1524 }
1525 1525
1526 if (higher_products != 0) { 1526 if (higher_products != 0 && !CanDowngradeVersion(prefs)) {
1527 static_assert(BrowserDistribution::NUM_TYPES == 3, 1527 static_assert(BrowserDistribution::NUM_TYPES == 3,
1528 "add support for new products here"); 1528 "add support for new products here");
1529 int message_id = IDS_INSTALL_HIGHER_VERSION_BASE; 1529 int message_id = IDS_INSTALL_HIGHER_VERSION_BASE;
1530 proceed_with_installation = false; 1530 proceed_with_installation = false;
1531 install_status = HIGHER_VERSION_EXISTS; 1531 install_status = HIGHER_VERSION_EXISTS;
1532 installer_state.WriteInstallerResult(install_status, message_id, NULL); 1532 installer_state.WriteInstallerResult(install_status, message_id, NULL);
1533 } 1533 }
1534 1534
1535 if (proceed_with_installation) { 1535 if (proceed_with_installation) {
1536 base::FilePath prefs_source_path(cmd_line.GetSwitchValueNative( 1536 base::FilePath prefs_source_path(cmd_line.GetSwitchValueNative(
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 // to pass through, since this is only returned on uninstall which is 1848 // to pass through, since this is only returned on uninstall which is
1849 // never invoked directly by Google Update. 1849 // never invoked directly by Google Update.
1850 return_code = InstallUtil::GetInstallReturnCode(install_status); 1850 return_code = InstallUtil::GetInstallReturnCode(install_status);
1851 } 1851 }
1852 1852
1853 installer::EndPersistentHistogramStorage(installer_state.target_path()); 1853 installer::EndPersistentHistogramStorage(installer_state.target_path());
1854 VLOG(1) << "Installation complete, returning: " << return_code; 1854 VLOG(1) << "Installation complete, returning: " << return_code;
1855 1855
1856 return return_code; 1856 return return_code;
1857 } 1857 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698