summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup/setup_main.cc
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-06 20:42:39 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-06 20:42:39 +0000
commit5f27dc1b618add9874c21f47adc0f6a57d0c2208 (patch)
treead2f004ec5103555499d4bb443c3e7f13d850b2c /chrome/installer/setup/setup_main.cc
parentada41253c96b1f86b4e84ff6765b043e34ec2f7c (diff)
downloadchromium_src-5f27dc1b618add9874c21f47adc0f6a57d0c2208.zip
chromium_src-5f27dc1b618add9874c21f47adc0f6a57d0c2208.tar.gz
chromium_src-5f27dc1b618add9874c21f47adc0f6a57d0c2208.tar.bz2
Add brand-code migration to the Chrome installer when creating the new multi-install app guid.
When upgrading a product from single to multi, the installer will now check if a Chrome install at that level (user/system) had a brand code, and if so it will copy the brand code to the ClientState key for the multi-install. Also, some yak de-hairing: alter InstallationState such that it can be queried for partial ProductStates for products that are in the process of being installed. This can be used to query e.g. the ap value and the brand code, but not the version (since a product won't have a version until its first install is complete). This removes the need to go and manually re-query the registry in a couple of places, makes the installer's actions based solely on the original InstallationState and generally removes some hackiness. BUG=61609 TEST=setup_unittests.exe, also when upgrading from single to multi, observe that brand codes are copied over. Review URL: http://codereview.chromium.org/6604010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup/setup_main.cc')
-rw-r--r--chrome/installer/setup/setup_main.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index b8a841d..e6df28a 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -250,16 +250,17 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
original_state.GetProductState(system_level,
BrowserDistribution::CHROME_BROWSER);
if (chrome_state != NULL) {
- base::win::RegKey key;
- installer::ChannelInfo cf_channel;
- // Chrome Frame may not yet be installed, so peek into the registry
- // directly to see what channel Google Update has specified. There will
- // be no value if we're not being managed by Google Update.
- if (key.Open(installer_state->root_key(),
- chrome_frame->distribution()->GetStateKey().c_str(),
- KEY_QUERY_VALUE) == ERROR_SUCCESS) {
- cf_channel.Initialize(key);
- }
+ // Chrome Frame may not yet be installed if this is a first install, so
+ // use InstallationState's GetNonVersionedProductState() which will lets
+ // us access the ap value from the partially constructed product state.
+ // There will be no value if we're not being managed by Google Update.
+ const ProductState* cf_non_versioned_state =
+ original_state.GetNonVersionedProductState(
+ system_level, BrowserDistribution::CHROME_FRAME);
+ DCHECK(cf_non_versioned_state);
+ const installer::ChannelInfo& cf_channel(
+ cf_non_versioned_state->channel());
+
// Fail if Chrome is already installed but is on a different update
// channel.
if (!cf_channel.EqualsBaseOf(chrome_state->channel())) {