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..08f12921f1bb3f94eaa5aee8a1befe624d3b1803 100644 |
--- a/chrome/installer/setup/setup_main.cc |
+++ b/chrome/installer/setup/setup_main.cc |
@@ -1654,14 +1654,33 @@ 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 if (base::PathExists(master_preferences_file)) { |
grt (UTC plus 2)
2015/09/25 15:01:27
I don't think it's safe to rely on the value being
robertshield
2015/09/25 15:19:20
I tend to agree, relying on master_preferences to
bcwhite
2015/10/01 13:11:53
I'll look into the ClientState key. Is it okay to
grt (UTC plus 2)
2015/10/01 14:37:58
My inclination is to only check the one authoritat
|
+ // In the case of an original MSI install, the master-preferences file |
+ // exists but was not passed on the command-line. We load it explicitly |
+ // to get the product-id and then, because there is no "msiexec" process |
+ // to out-wait, we set the DisplayVersion immediately. |
+ const MasterPreferences mp(master_preferences_file); |
+ if (mp.GetString(installer::master_preferences::kMsiProductId, |
+ &install_id)) { |
+ OverwriteDisplayVersions(base::UTF8ToUTF16(install_id), |
+ 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. |