Chromium Code Reviews| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 return state.uninstall_command(); | 166 return state.uninstall_command(); |
| 167 } | 167 } |
| 168 return CommandLine(CommandLine::NO_PROGRAM); | 168 return CommandLine(CommandLine::NO_PROGRAM); |
| 169 } | 169 } |
| 170 | 170 |
| 171 Version* InstallUtil::GetChromeVersion(BrowserDistribution* dist, | 171 Version* InstallUtil::GetChromeVersion(BrowserDistribution* dist, |
| 172 bool system_install) { | 172 bool system_install) { |
| 173 DCHECK(dist); | 173 DCHECK(dist); |
| 174 RegKey key; | 174 RegKey key; |
| 175 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 175 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 176 LONG result = key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ); | 176 LONG result = key.Open(reg_root, dist->GetVersionKey().c_str(), |
| 177 KEY_QUERY_VALUE); | |
|
grt (UTC plus 2)
2011/12/01 04:45:02
thank you!
| |
| 177 | 178 |
| 178 std::wstring version_str; | 179 std::wstring version_str; |
| 179 if (result == ERROR_SUCCESS) | 180 if (result == ERROR_SUCCESS) |
| 180 result = key.ReadValue(google_update::kRegVersionField, &version_str); | 181 result = key.ReadValue(google_update::kRegVersionField, &version_str); |
| 181 | 182 |
| 182 Version* ret = NULL; | 183 Version* ret = NULL; |
| 183 if (result == ERROR_SUCCESS && !version_str.empty()) { | 184 if (result == ERROR_SUCCESS && !version_str.empty()) { |
| 184 VLOG(1) << "Existing " << dist->GetApplicationName() | 185 VLOG(1) << "Existing " << dist->GetApplicationName() |
| 185 << " version found " << version_str; | 186 << " version found " << version_str; |
| 186 ret = Version::GetVersionFromString(WideToASCII(version_str)); | 187 ret = Version::GetVersionFromString(WideToASCII(version_str)); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, | 469 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, |
| 469 date_str, arraysize(date_str)); | 470 date_str, arraysize(date_str)); |
| 470 if (len) { | 471 if (len) { |
| 471 --len; // Subtract terminating \0. | 472 --len; // Subtract terminating \0. |
| 472 } else { | 473 } else { |
| 473 PLOG(DFATAL) << "GetDateFormat"; | 474 PLOG(DFATAL) << "GetDateFormat"; |
| 474 } | 475 } |
| 475 | 476 |
| 476 return std::wstring(date_str, len); | 477 return std::wstring(date_str, len); |
| 477 } | 478 } |
| OLD | NEW |