Index: chrome/installer/setup/setup_main.cc |
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc |
index ee2601f50fcf4f65074f4a426bd15201f6a7d62a..75c37072bcd6f2d07068148b818fe90d773775a6 100644 |
--- a/chrome/installer/setup/setup_main.cc |
+++ b/chrome/installer/setup/setup_main.cc |
@@ -1654,14 +1654,35 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state, |
// If the installation completed successfully... |
if (InstallUtil::GetInstallReturnCode(install_status) == 0) { |
// Update the DisplayVersion created by an MSI-based install. |
+ base::FilePath master_preferences_file( |
+ installer_state.target_path().AppendASCII( |
+ installer::kDefaultMasterPrefs)); |
std::string install_id; |
if (prefs.GetString(installer::master_preferences::kMsiProductId, |
&install_id)) { |
+ // A currently active MSI install will have specified the master- |
+ // preferences file on the command-line that includes the product-id. |
+ // We must delay the setting of the DisplayVersion until after the |
+ // grandparent "msiexec" process has exited. |
base::FilePath new_setup = |
installer_state.GetInstallerDirectory(*installer_version) |
.Append(kSetupExe); |
DelayedOverwriteDisplayVersions( |
new_setup, install_id, *installer_version); |
+ } else { |
+ // Only when called by the MSI installer do we need to delay setting |
+ // the DisplayVersion. In other runs, such as those done by the auto- |
+ // update action, we set the value immediately. |
+ const Product* chrome = installer_state.FindProduct( |
+ BrowserDistribution::CHROME_BROWSER); |
+ if (chrome != NULL) { |
+ // Get the app's GUID and remove surrounding braces. |
+ 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
|
+ ->GetAppGuid().substr(1, 36); |
+ OverwriteDisplayVersions(app_guid, |
+ base::UTF8ToUTF16( |
+ installer_version->GetString())); |
+ } |
} |
// Return the path to the directory containing the newly installed |
// setup.exe and uncompressed archive if the caller requested it. |