| 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 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <msi.h> | 6 #include <msi.h> |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // First, add the multi-install binaries, if relevant. | 223 // First, add the multi-install binaries, if relevant. |
| 224 if (installer_state->is_multi_install()) | 224 if (installer_state->is_multi_install()) |
| 225 dists[num_dists++] = installer_state->multi_package_binaries_distribution(); | 225 dists[num_dists++] = installer_state->multi_package_binaries_distribution(); |
| 226 // Next, add all products we're operating on. std::transform can handily do | 226 // Next, add all products we're operating on. std::transform can handily do |
| 227 // this for us, but this is discouraged as being too tricky. | 227 // this for us, but this is discouraged as being too tricky. |
| 228 const Products& products = installer_state->products(); | 228 const Products& products = installer_state->products(); |
| 229 for (Products::size_type i = 0; i < products.size(); ++i) { | 229 for (Products::size_type i = 0; i < products.size(); ++i) { |
| 230 dists[num_dists++] = products[i]->distribution(); | 230 dists[num_dists++] = products[i]->distribution(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 // Add work items to delete the "opv" and "cmd" values from all distributions. | 233 // Add work items to delete the "opv", "cpv", and "cmd" values from all |
| 234 // distributions. |
| 234 HKEY reg_root = installer_state->root_key(); | 235 HKEY reg_root = installer_state->root_key(); |
| 235 std::wstring version_key; | 236 std::wstring version_key; |
| 236 for (int i = 0; i < num_dists; ++i) { | 237 for (int i = 0; i < num_dists; ++i) { |
| 237 version_key = dists[i]->GetVersionKey(); | 238 version_key = dists[i]->GetVersionKey(); |
| 238 install_list->AddDeleteRegValueWorkItem(reg_root, | 239 install_list->AddDeleteRegValueWorkItem( |
| 239 version_key, | 240 reg_root, version_key, google_update::kRegOldVersionField); |
| 240 google_update::kRegOldVersionField); | 241 install_list->AddDeleteRegValueWorkItem( |
| 241 install_list->AddDeleteRegValueWorkItem(reg_root, | 242 reg_root, version_key, google_update::kRegCriticalVersionField); |
| 242 version_key, | 243 install_list->AddDeleteRegValueWorkItem( |
| 243 google_update::kRegRenameCmdField); | 244 reg_root, version_key, google_update::kRegRenameCmdField); |
| 244 } | 245 } |
| 245 installer::InstallStatus ret = installer::RENAME_SUCCESSFUL; | 246 installer::InstallStatus ret = installer::RENAME_SUCCESSFUL; |
| 246 if (!install_list->Do()) { | 247 if (!install_list->Do()) { |
| 247 LOG(ERROR) << "Renaming of executables failed. Rolling back any changes."; | 248 LOG(ERROR) << "Renaming of executables failed. Rolling back any changes."; |
| 248 install_list->Rollback(); | 249 install_list->Rollback(); |
| 249 ret = installer::RENAME_FAILED; | 250 ret = installer::RENAME_FAILED; |
| 250 } | 251 } |
| 251 // temp_path's dtor will take care of deleting or scheduling itself for | 252 // temp_path's dtor will take care of deleting or scheduling itself for |
| 252 // deletion at reboot when this scope closes. | 253 // deletion at reboot when this scope closes. |
| 253 VLOG(1) << "Deleting temporary directory " << temp_path.path().value(); | 254 VLOG(1) << "Deleting temporary directory " << temp_path.path().value(); |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 if (!(installer_state.is_msi() && is_uninstall)) | 1337 if (!(installer_state.is_msi() && is_uninstall)) |
| 1337 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1338 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
| 1338 // to pass through, since this is only returned on uninstall which is | 1339 // to pass through, since this is only returned on uninstall which is |
| 1339 // never invoked directly by Google Update. | 1340 // never invoked directly by Google Update. |
| 1340 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1341 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 1341 | 1342 |
| 1342 VLOG(1) << "Installation complete, returning: " << return_code; | 1343 VLOG(1) << "Installation complete, returning: " << return_code; |
| 1343 | 1344 |
| 1344 return return_code; | 1345 return return_code; |
| 1345 } | 1346 } |
| OLD | NEW |