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 <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 VLOG(1) << "InstallerState::UpdateChannels noop: " << operation_; | 735 VLOG(1) << "InstallerState::UpdateChannels noop: " << operation_; |
736 return; | 736 return; |
737 } | 737 } |
738 | 738 |
739 // Update the "ap" value for the product being installed/updated. We get the | 739 // Update the "ap" value for the product being installed/updated. We get the |
740 // current value from the registry since the InstallationState instance used | 740 // current value from the registry since the InstallationState instance used |
741 // by the bulk of the installer does not track changes made by UpdateStage. | 741 // by the bulk of the installer does not track changes made by UpdateStage. |
742 // Create the app's ClientState key if it doesn't exist. | 742 // Create the app's ClientState key if it doesn't exist. |
743 ChannelInfo channel_info; | 743 ChannelInfo channel_info; |
744 base::win::RegKey state_key; | 744 base::win::RegKey state_key; |
745 LONG result = | 745 LONG result = state_key.Create(root_key_, state_key_.c_str(), |
746 state_key.Create(root_key_, | 746 KEY_QUERY_VALUE | KEY_SET_VALUE); |
747 state_key_.c_str(), | |
748 KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_WOW64_32KEY); | |
749 if (result == ERROR_SUCCESS) { | 747 if (result == ERROR_SUCCESS) { |
750 channel_info.Initialize(state_key); | 748 channel_info.Initialize(state_key); |
751 | 749 |
752 // This is a multi-install product. | 750 // This is a multi-install product. |
753 bool modified = channel_info.SetMultiInstall(true); | 751 bool modified = channel_info.SetMultiInstall(true); |
754 | 752 |
755 // Add the appropriate modifiers for all products and their options. | 753 // Add the appropriate modifiers for all products and their options. |
756 modified |= SetChannelFlags(true, &channel_info); | 754 modified |= SetChannelFlags(true, &channel_info); |
757 | 755 |
758 VLOG(1) << "ap: " << channel_info.value(); | 756 VLOG(1) << "ap: " << channel_info.value(); |
(...skipping 18 matching lines...) Expand all Loading... |
777 // Always operate on the binaries. | 775 // Always operate on the binaries. |
778 if (i == BrowserDistribution::CHROME_BINARIES) { | 776 if (i == BrowserDistribution::CHROME_BINARIES) { |
779 dist = multi_package_distribution_; | 777 dist = multi_package_distribution_; |
780 } else { | 778 } else { |
781 const Product* product = FindProduct(type); | 779 const Product* product = FindProduct(type); |
782 // Skip this one if it's for a product we're not operating on. | 780 // Skip this one if it's for a product we're not operating on. |
783 if (product == NULL) | 781 if (product == NULL) |
784 continue; | 782 continue; |
785 dist = product->distribution(); | 783 dist = product->distribution(); |
786 } | 784 } |
787 result = | 785 result = state_key.Create(root_key_, dist->GetStateKey().c_str(), |
788 state_key.Create(root_key_, | 786 KEY_QUERY_VALUE | KEY_SET_VALUE); |
789 dist->GetStateKey().c_str(), | |
790 KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_WOW64_32KEY); | |
791 if (result == ERROR_SUCCESS) { | 787 if (result == ERROR_SUCCESS) { |
792 other_info.Initialize(state_key); | 788 other_info.Initialize(state_key); |
793 if (!other_info.Equals(channel_info)) | 789 if (!other_info.Equals(channel_info)) |
794 channel_info.Write(&state_key); | 790 channel_info.Write(&state_key); |
795 } else { | 791 } else { |
796 LOG(ERROR) << "Failed opening key " << dist->GetStateKey() | 792 LOG(ERROR) << "Failed opening key " << dist->GetStateKey() |
797 << " to update app channels; result: " << result; | 793 << " to update app channels; result: " << result; |
798 } | 794 } |
799 } | 795 } |
800 } else { | 796 } else { |
(...skipping 26 matching lines...) Expand all Loading... |
827 } | 823 } |
828 if (!install_list->Do()) | 824 if (!install_list->Do()) |
829 LOG(ERROR) << "Failed to record installer error information in registry."; | 825 LOG(ERROR) << "Failed to record installer error information in registry."; |
830 } | 826 } |
831 | 827 |
832 bool InstallerState::RequiresActiveSetup() const { | 828 bool InstallerState::RequiresActiveSetup() const { |
833 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); | 829 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); |
834 } | 830 } |
835 | 831 |
836 } // namespace installer | 832 } // namespace installer |
OLD | NEW |