summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
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();