| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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> |
| 11 #include <shlobj.h> | 11 #include <shlobj.h> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return false; | 48 return false; |
| 49 | 49 |
| 50 if (exit_code) | 50 if (exit_code) |
| 51 *exit_code = ret_val; | 51 *exit_code = ret_val; |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 std::wstring InstallUtil::GetChromeUninstallCmd(bool system_install) { | 55 std::wstring InstallUtil::GetChromeUninstallCmd(bool system_install) { |
| 56 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 56 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 57 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 57 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 58 RegKey key(root, dist->GetUninstallRegPath().c_str()); | 58 RegKey key(root, dist->GetUninstallRegPath().c_str(), KEY_READ); |
| 59 std::wstring uninstall_cmd; | 59 std::wstring uninstall_cmd; |
| 60 key.ReadValue(installer_util::kUninstallStringField, &uninstall_cmd); | 60 key.ReadValue(installer_util::kUninstallStringField, &uninstall_cmd); |
| 61 return uninstall_cmd; | 61 return uninstall_cmd; |
| 62 } | 62 } |
| 63 | 63 |
| 64 installer::Version* InstallUtil::GetChromeVersion(bool system_install) { | 64 installer::Version* InstallUtil::GetChromeVersion(bool system_install) { |
| 65 RegKey key; | 65 RegKey key; |
| 66 std::wstring version_str; | 66 std::wstring version_str; |
| 67 | 67 |
| 68 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 68 HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 const std::wstring& value_name) { | 274 const std::wstring& value_name) { |
| 275 RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS); | 275 RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS); |
| 276 LOG(INFO) << "Deleting registry value " << value_name; | 276 LOG(INFO) << "Deleting registry value " << value_name; |
| 277 if (key.ValueExists(value_name.c_str()) && | 277 if (key.ValueExists(value_name.c_str()) && |
| 278 !key.DeleteValue(value_name.c_str())) { | 278 !key.DeleteValue(value_name.c_str())) { |
| 279 LOG(ERROR) << "Failed to delete registry value: " << value_name; | 279 LOG(ERROR) << "Failed to delete registry value: " << value_name; |
| 280 return false; | 280 return false; |
| 281 } | 281 } |
| 282 return true; | 282 return true; |
| 283 } | 283 } |
| OLD | NEW |