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/installer_state.h" | 5 #include "chrome/installer/util/installer_state.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <functional> | 10 #include <functional> |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 LOG(ERROR) << "Failed opening key " << state_key_ | 664 LOG(ERROR) << "Failed opening key " << state_key_ |
665 << " to update app channels; result: " << result; | 665 << " to update app channels; result: " << result; |
666 } | 666 } |
667 } | 667 } |
668 | 668 |
669 void InstallerState::WriteInstallerResult( | 669 void InstallerState::WriteInstallerResult( |
670 InstallStatus status, | 670 InstallStatus status, |
671 int string_resource_id, | 671 int string_resource_id, |
672 const std::wstring* const launch_cmd) const { | 672 const std::wstring* const launch_cmd) const { |
673 // Use a no-rollback list since this is a best-effort deal. | 673 // Use a no-rollback list since this is a best-effort deal. |
674 std::unique_ptr<WorkItemList> install_list(WorkItem::CreateWorkItemList()); | 674 std::unique_ptr<WorkItemList> install_list( |
675 install_list->set_log_message("Write Installer Result"); | 675 WorkItem::CreateNoRollbackWorkItemList()); |
676 install_list->set_best_effort(true); | |
677 install_list->set_rollback_enabled(false); | |
678 const bool system_install = this->system_install(); | 676 const bool system_install = this->system_install(); |
679 // Write the value for all products upon which we're operating. | 677 // Write the value for all products upon which we're operating. |
680 Products::const_iterator end = products().end(); | 678 Products::const_iterator end = products().end(); |
681 for (Products::const_iterator scan = products().begin(); scan != end; | 679 for (Products::const_iterator scan = products().begin(); scan != end; |
682 ++scan) { | 680 ++scan) { |
683 InstallUtil::AddInstallerResultItems( | 681 InstallUtil::AddInstallerResultItems( |
684 system_install, (*scan)->distribution()->GetStateKey(), status, | 682 system_install, (*scan)->distribution()->GetStateKey(), status, |
685 string_resource_id, launch_cmd, install_list.get()); | 683 string_resource_id, launch_cmd, install_list.get()); |
686 } | 684 } |
687 // And for the binaries if this is a multi-install. | 685 // And for the binaries if this is a multi-install. |
688 if (is_multi_install()) { | 686 if (is_multi_install()) { |
689 InstallUtil::AddInstallerResultItems( | 687 InstallUtil::AddInstallerResultItems( |
690 system_install, multi_package_binaries_distribution()->GetStateKey(), | 688 system_install, multi_package_binaries_distribution()->GetStateKey(), |
691 status, string_resource_id, launch_cmd, install_list.get()); | 689 status, string_resource_id, launch_cmd, install_list.get()); |
692 } | 690 } |
693 install_list->Do(); | 691 if (!install_list->Do()) |
| 692 LOG(ERROR) << "Failed to record installer error information in registry."; |
694 } | 693 } |
695 | 694 |
696 bool InstallerState::RequiresActiveSetup() const { | 695 bool InstallerState::RequiresActiveSetup() const { |
697 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); | 696 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); |
698 } | 697 } |
699 | 698 |
700 } // namespace installer | 699 } // namespace installer |
OLD | NEW |