summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/installation_state.h
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/util/installation_state.h
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/util/installation_state.h')
-rw-r--r--chrome/installer/util/installation_state.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/installer/util/installation_state.h b/chrome/installer/util/installation_state.h
index a63627c..a623992 100644
--- a/chrome/installer/util/installation_state.h
+++ b/chrome/installer/util/installation_state.h
@@ -58,6 +58,9 @@ class ProductState {
// caller.
const Version* old_version() const { return old_version_.get(); }
+ // Returns the brand code the product is currently installed with.
+ const std::wstring& brand() const { return brand_; }
+
// Returns the command to be used to update to the new version that is
// awaiting update; may be empty.
const std::wstring& rename_cmd() const { return rename_cmd_; }
@@ -84,6 +87,7 @@ class ProductState {
ChannelInfo channel_;
scoped_ptr<Version> version_;
scoped_ptr<Version> old_version_;
+ std::wstring brand_;
std::wstring rename_cmd_;
CommandLine uninstall_command_;
AppCommands commands_;
@@ -110,6 +114,16 @@ class InstallationState {
const ProductState* GetProductState(bool system_install,
BrowserDistribution::Type type) const;
+ // Returns the state of a product, even one that has not yet been installed.
+ // This is useful during first install, when some but not all ProductState
+ // information has been written by Omaha. Notably absent from the
+ // ProductState returned here are the version numbers. Do NOT try to access
+ // the version numbers from a ProductState returned by this method.
+ // Caller does NOT assume ownership of returned pointer. This method will
+ // never return NULL.
+ const ProductState* GetNonVersionedProductState(
+ bool system_install, BrowserDistribution::Type type) const;
+
protected:
enum {
CHROME_BROWSER_INDEX,