summaryrefslogtreecommitdiffstats
path: root/chrome/common/platform_util_win.cc
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 23:11:44 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 23:11:44 +0000
commitb93d15dcab4dd38ed931765b5b77deb2603f832c (patch)
tree6eee4972ce5af95948f5bad48efb7df29c6f762d /chrome/common/platform_util_win.cc
parentdb9ece86cab5495f431fe8659419fa7e9ecc76c7 (diff)
downloadchromium_src-b93d15dcab4dd38ed931765b5b77deb2603f832c.zip
chromium_src-b93d15dcab4dd38ed931765b5b77deb2603f832c.tar.gz
chromium_src-b93d15dcab4dd38ed931765b5b77deb2603f832c.tar.bz2
BUG=http://crbug.com/32479
TEST=Need a machine with an unfriendly registry to confirm the version string modifier is happy, but (in house) we should confirm that running the dev, beta, or release installer shows dev, beta, or "" as the version string modifier (branded builds only) in about:version. Review URL: http://codereview.chromium.org/629004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/platform_util_win.cc')
-rw-r--r--chrome/common/platform_util_win.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/common/platform_util_win.cc b/chrome/common/platform_util_win.cc
index 93da55c..bcf3a58 100644
--- a/chrome/common/platform_util_win.cc
+++ b/chrome/common/platform_util_win.cc
@@ -162,16 +162,24 @@ void SimpleErrorBox(gfx::NativeWindow parent,
namespace {
std::wstring CurrentChromeChannel() {
- // See if we can find the Clients key on the HKLM branch.
+ // Start by seeing if we can find the Clients key on the HKLM branch.
+ // For each search, require confirmation by looking for "name"
+ // inside it. We've noticed problems cleaning up the registry on
+ // uninstall or upgrade (http://crbug.com/33532,
+ // http://crbug.com/33534), and have other reports of inconsistency
+ // (http://crbug.com/32479).
HKEY registry_hive = HKEY_LOCAL_MACHINE;
std::wstring key = google_update::kRegPathClients + std::wstring(L"\\") +
google_update::kChromeUpgradeCode;
RegKey google_update_hklm(registry_hive, key.c_str(), KEY_READ);
- if (!google_update_hklm.Valid()) {
+
+ if (!google_update_hklm.Valid() ||
+ !google_update_hklm.ValueExists(google_update::kRegNameField)) {
// HKLM failed us, try the same for the HKCU branch.
registry_hive = HKEY_CURRENT_USER;
RegKey google_update_hkcu(registry_hive, key.c_str(), KEY_READ);
- if (!google_update_hkcu.Valid()) {
+ if (!google_update_hkcu.Valid() ||
+ !google_update_hkcu.ValueExists(google_update::kRegNameField)) {
// Unknown.
registry_hive = 0;
}