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

Unified Diff: chrome/installer/setup/installer_state.cc

Issue 2507293005: Force migrate all clients from multi-install back to single-install. (Closed)
Patch Set: mini_installer too Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/installer_state.cc
diff --git a/chrome/installer/setup/installer_state.cc b/chrome/installer/setup/installer_state.cc
index 17ad861605e25984979ea73caf1f70eb05999456..3e7dde64eb23e23b91b8b9d0dfbccbb9f2ddaba9 100644
--- a/chrome/installer/setup/installer_state.cc
+++ b/chrome/installer/setup/installer_state.cc
@@ -73,7 +73,8 @@ InstallerState::InstallerState()
root_key_(NULL),
msi_(false),
background_mode_(false),
- verbose_logging_(false) {}
+ verbose_logging_(false),
+ is_migrating_to_single_(false) {}
InstallerState::InstallerState(Level level)
: operation_(UNINITIALIZED),
@@ -84,7 +85,8 @@ InstallerState::InstallerState(Level level)
root_key_(NULL),
msi_(false),
background_mode_(false),
- verbose_logging_(false) {
+ verbose_logging_(false),
+ is_migrating_to_single_(false) {
// Use set_level() so that root_key_ is updated properly.
set_level(level);
}
@@ -138,6 +140,10 @@ void InstallerState::Initialize(const base::CommandLine& command_line,
// For a single-install, the current browser dist is the operand.
operand = BrowserDistribution::GetDistribution();
operation_ = SINGLE_INSTALL_OR_UPDATE;
+ // Is this a migration from multi-install to single-install?
+ const ProductState* state =
+ machine_state.GetProductState(system_install(), operand->GetType());
+ is_migrating_to_single_ = state && state->is_multi_install();
} else if (IsMultiInstallUpdate(prefs, machine_state)) {
// Updates driven by Google Update take place under the multi-installer's
// app guid.
@@ -473,6 +479,7 @@ void InstallerState::Clear() {
root_key_ = NULL;
msi_ = false;
verbose_logging_ = false;
+ is_migrating_to_single_ = false;
}
bool InstallerState::AnyExistsAndIsInUse(const InstallationState& machine_state,
@@ -625,6 +632,16 @@ void InstallerState::WriteInstallerResult(
InstallUtil::AddInstallerResultItems(
system_install, multi_package_binaries_distribution()->GetStateKey(),
status, string_resource_id, launch_cmd, install_list.get());
+ } else if (is_migrating_to_single()) {
gab 2016/12/12 21:38:16 Wait... my assumptions are breaking down... so we
grt (UTC plus 2) 2016/12/13 09:20:37 No, we can't be in multi_install anymore -- the bl
+ // Also write to the binaries if this is a migration back to single-install.
+ // Writing in both locations ensures that Google Update will pick up the
+ // results regardless of whether this migration originates from Chrome's or
+ // from the binaries' update config.
+ InstallUtil::AddInstallerResultItems(
+ system_install, BrowserDistribution::GetSpecificDistribution(
+ BrowserDistribution::CHROME_BINARIES)
+ ->GetStateKey(),
+ status, string_resource_id, launch_cmd, install_list.get());
}
install_list->Do();
}

Powered by Google App Engine
This is Rietveld 408576698