diff options
author | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-11 13:28:34 +0000 |
---|---|---|
committer | grt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-11 13:28:34 +0000 |
commit | 2589396510cb9ec9a4e3520dcef3524e65fecd58 (patch) | |
tree | 54824cb5227354c24f04c7f34b5c104c78a14943 /chrome/installer/util/installer_state.h | |
parent | c7959c98c6625ad4e0758bd8e95e35be3442219a (diff) | |
download | chromium_src-2589396510cb9ec9a4e3520dcef3524e65fecd58.zip chromium_src-2589396510cb9ec9a4e3520dcef3524e65fecd58.tar.gz chromium_src-2589396510cb9ec9a4e3520dcef3524e65fecd58.tar.bz2 |
Add support for --critical-update-version to installer.
The installer may now be given a --critical-update-version=W.X.Y.Z option on the command line. If this is present for an in-use update and the indicated version is newer than the in-use Chrome, a new "cpv" value is dropped in the registry alongside "opv" and "cmd" (the other state associated with an in-use update). Thanks to Finnur, Chrome will eventually notice that there's a pending critical update and do magical things to keep our users safe and secure. Go users!
Other things I did while I was at it:
- switched version string conversions from UTF8ToWide to ASCIIToWide since version numbers are always ASCII dotted numbers.
- renamed the reg value from "CriticalUpdate" to "cpv" so it fits in nicely with the other cryptic values in the product's Clients key (a.k.a. Version key).
BUG=103526,97665
TEST=Install version N, launch it with --check-for-update-interval=5, then install verison M>N with --critical-update-version=M. After a few seconds, Chrome should do something fantastic. Note that the alternate_version_generator can be used to create a newer versioned mini_installer from an existing one (just build it and run it).
Review URL: http://codereview.chromium.org/8517012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/installer_state.h')
-rw-r--r-- | chrome/installer/util/installer_state.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/installer/util/installer_state.h b/chrome/installer/util/installer_state.h index 04417be..987bf1b 100644 --- a/chrome/installer/util/installer_state.h +++ b/chrome/installer/util/installer_state.h @@ -14,6 +14,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" +#include "base/version.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/product.h" #include "chrome/installer/util/util_constants.h" @@ -144,6 +145,14 @@ class InstallerState { // products are installed. Ownership is passed to the caller. Version* GetCurrentVersion(const InstallationState& machine_state) const; + // Returns the critical update version if all of the following are true: + // * --critical-update-version=CUV was specified on the command-line. + // * current_version == NULL or current_version < CUV. + // * new_version >= CUV. + // Otherwise, returns an invalid version. + Version DetermineCriticalVersion(const Version* current_version, + const Version& new_version) const; + // Returns whether or not there is currently a Chrome Frame instance running. // Note that there isn't a mechanism to lock Chrome Frame in place, so Chrome // Frame may either exit or start up after this is called. @@ -211,6 +220,7 @@ class InstallerState { BrowserDistribution::Type state_type_; ScopedVector<Product> products_; BrowserDistribution* multi_package_distribution_; + Version critical_update_version_; Level level_; PackageType package_type_; #if defined(OS_WIN) |