OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 Version* InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, | 196 Version* InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, |
197 bool system_install) { | 197 bool system_install) { |
198 DCHECK(dist); | 198 DCHECK(dist); |
199 RegKey key; | 199 RegKey key; |
200 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 200 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
201 LONG result = | 201 LONG result = |
202 key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_QUERY_VALUE); | 202 key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_QUERY_VALUE); |
203 | 203 |
204 string16 version_str; | 204 string16 version_str; |
205 if (result == ERROR_SUCCESS) | 205 if (result == ERROR_SUCCESS) |
206 result = key.ReadValue(google_update::kRegCriticalUpdateField, | 206 result = key.ReadValue(google_update::kRegCriticalVersionField, |
207 &version_str); | 207 &version_str); |
208 | 208 |
209 Version* ret = NULL; | 209 Version* ret = NULL; |
210 if (result == ERROR_SUCCESS && !version_str.empty()) { | 210 if (result == ERROR_SUCCESS && !version_str.empty()) { |
211 VLOG(1) << "Critical Update version for " << dist->GetApplicationName() | 211 VLOG(1) << "Critical Update version for " << dist->GetApplicationName() |
212 << " found " << version_str; | 212 << " found " << version_str; |
213 ret = Version::GetVersionFromString(WideToASCII(version_str)); | 213 ret = Version::GetVersionFromString(WideToASCII(version_str)); |
214 } else { | 214 } else { |
215 DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); | 215 DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); |
216 VLOG(1) << "No existing " << dist->GetApplicationName() | 216 VLOG(1) << "No existing " << dist->GetApplicationName() |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, | 468 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, |
469 date_str, arraysize(date_str)); | 469 date_str, arraysize(date_str)); |
470 if (len) { | 470 if (len) { |
471 --len; // Subtract terminating \0. | 471 --len; // Subtract terminating \0. |
472 } else { | 472 } else { |
473 PLOG(DFATAL) << "GetDateFormat"; | 473 PLOG(DFATAL) << "GetDateFormat"; |
474 } | 474 } |
475 | 475 |
476 return std::wstring(date_str, len); | 476 return std::wstring(date_str, len); |
477 } | 477 } |
OLD | NEW |