Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/installer/util/product.h" | 5 #include "chrome/installer/util/product.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 } | 110 } |
| 111 | 111 |
| 112 return success; | 112 return success; |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool Product::SetMsiMarker(bool system_install, bool set) const { | 115 bool Product::SetMsiMarker(bool system_install, bool set) const { |
| 116 HKEY reg_root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 116 HKEY reg_root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 117 RegKey client_state_key; | 117 RegKey client_state_key; |
| 118 LONG result = client_state_key.Open(reg_root, | 118 LONG result = client_state_key.Open(reg_root, |
| 119 distribution_->GetStateKey().c_str(), | 119 distribution_->GetStateKey().c_str(), |
| 120 KEY_READ | KEY_WRITE | KEY_WOW64_32KEY); | 120 KEY_SET_VALUE | KEY_WOW64_32KEY); |
| 121 if (result == ERROR_SUCCESS) { | 121 if (result == ERROR_SUCCESS) { |
| 122 result = client_state_key.WriteValue(google_update::kRegMSIField, | 122 result = client_state_key.WriteValue(google_update::kRegMSIField, |
| 123 set ? 1 : 0); | 123 set ? 1 : 0); |
| 124 } | 124 } |
| 125 | 125 |
| 126 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed to Open or Write MSI value" | 126 if (result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND) |
|
gab
2014/09/08 16:29:58
nit: I'd prefer handling the error in scope and ha
grt (UTC plus 2)
2014/09/08 16:47:56
yeah. my urge to avoid braces made me do it this w
gab
2014/09/08 16:58:41
Mildly. I don't think having to add braces matters
grt (UTC plus 2)
2014/09/08 17:03:29
Done.
| |
| 127 "to client state key. error: " << result; | 127 return true; |
| 128 | 128 |
| 129 return (result == ERROR_SUCCESS); | 129 LOG(ERROR) << "Failed to Open or Write MSI value to client state key. error: " |
| 130 << result; | |
| 131 return false; | |
| 130 } | 132 } |
| 131 | 133 |
| 132 bool Product::ShouldCreateUninstallEntry() const { | 134 bool Product::ShouldCreateUninstallEntry() const { |
| 133 return operations_->ShouldCreateUninstallEntry(options_); | 135 return operations_->ShouldCreateUninstallEntry(options_); |
| 134 } | 136 } |
| 135 | 137 |
| 136 void Product::AddKeyFiles(std::vector<base::FilePath>* key_files) const { | 138 void Product::AddKeyFiles(std::vector<base::FilePath>* key_files) const { |
| 137 operations_->AddKeyFiles(options_, key_files); | 139 operations_->AddKeyFiles(options_, key_files); |
| 138 } | 140 } |
| 139 | 141 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 166 if (distribution_->HasUserExperiments()) { | 168 if (distribution_->HasUserExperiments()) { |
| 167 VLOG(1) << "LaunchUserExperiment status: " << status << " product: " | 169 VLOG(1) << "LaunchUserExperiment status: " << status << " product: " |
| 168 << distribution_->GetDisplayName() | 170 << distribution_->GetDisplayName() |
| 169 << " system_level: " << system_level; | 171 << " system_level: " << system_level; |
| 170 operations_->LaunchUserExperiment( | 172 operations_->LaunchUserExperiment( |
| 171 setup_path, options_, status, system_level); | 173 setup_path, options_, status, system_level); |
| 172 } | 174 } |
| 173 } | 175 } |
| 174 | 176 |
| 175 } // namespace installer | 177 } // namespace installer |
| OLD | NEW |