summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-08 11:58:42 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-08 11:58:42 +0000
commit4b4737482b4af117d20cdfc1f8c7fdd005921ea2 (patch)
treea396e397b5c73772bd32af135b778db8841a8a7a /chrome/installer
parentc9d63f3b386a44c4fc42be551807fabf248e6040 (diff)
downloadchromium_src-4b4737482b4af117d20cdfc1f8c7fdd005921ea2.zip
chromium_src-4b4737482b4af117d20cdfc1f8c7fdd005921ea2.tar.gz
chromium_src-4b4737482b4af117d20cdfc1f8c7fdd005921ea2.tar.bz2
Change UpgradeDetectorImpl to use InstallUtil::IsPerUserInstall, which is less flaky than looking for pv values in the registry.
Also remove the restriction on checking only for user-level installs of Chrome (not necessary). BUG=103226 TEST=The upgrade notification on the wrench menu should work as before for both user-level and system-level. Review URL: http://codereview.chromium.org/8491011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/util/install_util.cc6
-rw-r--r--chrome/installer/util/install_util.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index a15ac4e..2d6d1d9 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -193,11 +193,13 @@ Version* InstallUtil::GetChromeVersion(BrowserDistribution* dist,
return ret;
}
-Version* InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist) {
+Version* InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist,
+ bool system_install) {
DCHECK(dist);
RegKey key;
+ HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
LONG result =
- key.Open(HKEY_CURRENT_USER, dist->GetVersionKey().c_str(), KEY_READ);
+ key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_QUERY_VALUE);
string16 version_str;
if (result == ERROR_SUCCESS)
diff --git a/chrome/installer/util/install_util.h b/chrome/installer/util/install_util.h
index 1e47522..20fce08 100644
--- a/chrome/installer/util/install_util.h
+++ b/chrome/installer/util/install_util.h
@@ -48,7 +48,10 @@ class InstallUtil {
// Find the last critical update (version) of Chrome. Returns the version or
// NULL if no such version is found. A critical update is a specially flagged
// version (by Google Update) that contains an important security fix.
- static Version* GetCriticalUpdateVersion(BrowserDistribution* dist);
+ // system_install: if true, looks for version number under the HKLM root,
+ // otherwise looks under the HKCU.
+ static Version* GetCriticalUpdateVersion(BrowserDistribution* dist,
+ bool system_install);
// This function checks if the current OS is supported for Chromium.
static bool IsOSSupported();