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

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

Issue 1351453006: Handle upgrade case from previous MSI install. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 for (Products::const_iterator it = products.begin(); it < products.end(); 1647 for (Products::const_iterator it = products.begin(); it < products.end();
1648 ++it) { 1648 ++it) {
1649 const Product& product = **it; 1649 const Product& product = **it;
1650 product.LaunchUserExperiment(setup_path, install_status, system_install); 1650 product.LaunchUserExperiment(setup_path, install_status, system_install);
1651 } 1651 }
1652 } 1652 }
1653 1653
1654 // If the installation completed successfully... 1654 // If the installation completed successfully...
1655 if (InstallUtil::GetInstallReturnCode(install_status) == 0) { 1655 if (InstallUtil::GetInstallReturnCode(install_status) == 0) {
1656 // Update the DisplayVersion created by an MSI-based install. 1656 // Update the DisplayVersion created by an MSI-based install.
1657 base::FilePath master_preferences_file(
1658 installer_state.target_path().AppendASCII(
1659 installer::kDefaultMasterPrefs));
1657 std::string install_id; 1660 std::string install_id;
1658 if (prefs.GetString(installer::master_preferences::kMsiProductId, 1661 if (prefs.GetString(installer::master_preferences::kMsiProductId,
1659 &install_id)) { 1662 &install_id)) {
1663 // A currently active MSI install will have specified the master-
1664 // preferences file on the command-line that includes the product-id.
1665 // We must delay the setting of the DisplayVersion until after the
1666 // grandparent "msiexec" process has exited.
1660 base::FilePath new_setup = 1667 base::FilePath new_setup =
1661 installer_state.GetInstallerDirectory(*installer_version) 1668 installer_state.GetInstallerDirectory(*installer_version)
1662 .Append(kSetupExe); 1669 .Append(kSetupExe);
1663 DelayedOverwriteDisplayVersions( 1670 DelayedOverwriteDisplayVersions(
1664 new_setup, install_id, *installer_version); 1671 new_setup, install_id, *installer_version);
1672 } else {
1673 // Only when called by the MSI installer do we need to delay setting
1674 // the DisplayVersion. In other runs, such as those done by the auto-
1675 // update action, we set the value immediately.
1676 const Product* chrome = installer_state.FindProduct(
1677 BrowserDistribution::CHROME_BROWSER);
1678 if (chrome != NULL) {
1679 // Get the app's GUID and remove surrounding braces.
1680 base::string16 app_guid = chrome->distribution()
grt (UTC plus 2) 2015/10/02 17:55:47 Chrome's appguid for registration with Google Upda
bcwhite 2015/10/02 17:58:20 That's odd. I checked the value and it matched wh
grt (UTC plus 2) 2015/10/02 18:05:19 GetAppGuid() will always return {8A69D345-D564-463
1681 ->GetAppGuid().substr(1, 36);
1682 OverwriteDisplayVersions(app_guid,
1683 base::UTF8ToUTF16(
1684 installer_version->GetString()));
1685 }
1665 } 1686 }
1666 // Return the path to the directory containing the newly installed 1687 // Return the path to the directory containing the newly installed
1667 // setup.exe and uncompressed archive if the caller requested it. 1688 // setup.exe and uncompressed archive if the caller requested it.
1668 if (installer_directory) { 1689 if (installer_directory) {
1669 *installer_directory = 1690 *installer_directory =
1670 installer_state.GetInstallerDirectory(*installer_version); 1691 installer_state.GetInstallerDirectory(*installer_version);
1671 } 1692 }
1672 } 1693 }
1673 1694
1674 // temp_path's dtor will take care of deleting or scheduling itself for 1695 // temp_path's dtor will take care of deleting or scheduling itself for
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1847 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1827 // 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
1828 // never invoked directly by Google Update. 1849 // never invoked directly by Google Update.
1829 return_code = InstallUtil::GetInstallReturnCode(install_status); 1850 return_code = InstallUtil::GetInstallReturnCode(install_status);
1830 } 1851 }
1831 1852
1832 VLOG(1) << "Installation complete, returning: " << return_code; 1853 VLOG(1) << "Installation complete, returning: " << return_code;
1833 1854
1834 return return_code; 1855 return return_code;
1835 } 1856 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698