Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 5848005: base/version: remove wstring version (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retry Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/helper_unittest.cc ('k') | chrome/installer/util/package.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 87 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
88 if (!key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ) || 88 if (!key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ) ||
89 !key.ReadValue(google_update::kRegVersionField, &version_str)) { 89 !key.ReadValue(google_update::kRegVersionField, &version_str)) {
90 VLOG(1) << "No existing Chrome install found."; 90 VLOG(1) << "No existing Chrome install found.";
91 key.Close(); 91 key.Close();
92 return NULL; 92 return NULL;
93 } 93 }
94 key.Close(); 94 key.Close();
95 VLOG(1) << "Existing Chrome version found " << version_str; 95 VLOG(1) << "Existing Chrome version found " << version_str;
96 return Version::GetVersionFromString(version_str); 96 return Version::GetVersionFromString(WideToASCII(version_str));
97 } 97 }
98 98
99 bool InstallUtil::IsOSSupported() { 99 bool InstallUtil::IsOSSupported() {
100 int major, minor; 100 int major, minor;
101 base::win::Version version = base::win::GetVersion(); 101 base::win::Version version = base::win::GetVersion();
102 base::win::GetServicePackLevel(&major, &minor); 102 base::win::GetServicePackLevel(&major, &minor);
103 103
104 // We do not support Win2K or older, or XP without service pack 2. 104 // We do not support Win2K or older, or XP without service pack 2.
105 VLOG(1) << "Windows Version: " << version 105 VLOG(1) << "Windows Version: " << version
106 << ", Service Pack: " << major << "." << minor; 106 << ", Service Pack: " << major << "." << minor;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 const std::wstring& value_name) { 187 const std::wstring& value_name) {
188 RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS); 188 RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS);
189 VLOG(1) << "Deleting registry value " << value_name; 189 VLOG(1) << "Deleting registry value " << value_name;
190 if (key.ValueExists(value_name.c_str()) && 190 if (key.ValueExists(value_name.c_str()) &&
191 !key.DeleteValue(value_name.c_str())) { 191 !key.DeleteValue(value_name.c_str())) {
192 LOG(ERROR) << "Failed to delete registry value: " << value_name; 192 LOG(ERROR) << "Failed to delete registry value: " << value_name;
193 return false; 193 return false;
194 } 194 }
195 return true; 195 return true;
196 } 196 }
OLDNEW
« no previous file with comments | « chrome/installer/util/helper_unittest.cc ('k') | chrome/installer/util/package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698