| 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 = state_key.Create(root_key_, state_key_.c_str(), | 745 LONG result = |
| 746 KEY_QUERY_VALUE | KEY_SET_VALUE); | 746 state_key.Create(root_key_, |
| 747 state_key_.c_str(), |
| 748 KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_WOW64_32KEY); |
| 747 if (result == ERROR_SUCCESS) { | 749 if (result == ERROR_SUCCESS) { |
| 748 channel_info.Initialize(state_key); | 750 channel_info.Initialize(state_key); |
| 749 | 751 |
| 750 // This is a multi-install product. | 752 // This is a multi-install product. |
| 751 bool modified = channel_info.SetMultiInstall(true); | 753 bool modified = channel_info.SetMultiInstall(true); |
| 752 | 754 |
| 753 // Add the appropriate modifiers for all products and their options. | 755 // Add the appropriate modifiers for all products and their options. |
| 754 modified |= SetChannelFlags(true, &channel_info); | 756 modified |= SetChannelFlags(true, &channel_info); |
| 755 | 757 |
| 756 VLOG(1) << "ap: " << channel_info.value(); | 758 VLOG(1) << "ap: " << channel_info.value(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 775 // Always operate on the binaries. | 777 // Always operate on the binaries. |
| 776 if (i == BrowserDistribution::CHROME_BINARIES) { | 778 if (i == BrowserDistribution::CHROME_BINARIES) { |
| 777 dist = multi_package_distribution_; | 779 dist = multi_package_distribution_; |
| 778 } else { | 780 } else { |
| 779 const Product* product = FindProduct(type); | 781 const Product* product = FindProduct(type); |
| 780 // Skip this one if it's for a product we're not operating on. | 782 // Skip this one if it's for a product we're not operating on. |
| 781 if (product == NULL) | 783 if (product == NULL) |
| 782 continue; | 784 continue; |
| 783 dist = product->distribution(); | 785 dist = product->distribution(); |
| 784 } | 786 } |
| 785 result = state_key.Create(root_key_, dist->GetStateKey().c_str(), | 787 result = |
| 786 KEY_QUERY_VALUE | KEY_SET_VALUE); | 788 state_key.Create(root_key_, |
| 789 dist->GetStateKey().c_str(), |
| 790 KEY_QUERY_VALUE | KEY_SET_VALUE | KEY_WOW64_32KEY); |
| 787 if (result == ERROR_SUCCESS) { | 791 if (result == ERROR_SUCCESS) { |
| 788 other_info.Initialize(state_key); | 792 other_info.Initialize(state_key); |
| 789 if (!other_info.Equals(channel_info)) | 793 if (!other_info.Equals(channel_info)) |
| 790 channel_info.Write(&state_key); | 794 channel_info.Write(&state_key); |
| 791 } else { | 795 } else { |
| 792 LOG(ERROR) << "Failed opening key " << dist->GetStateKey() | 796 LOG(ERROR) << "Failed opening key " << dist->GetStateKey() |
| 793 << " to update app channels; result: " << result; | 797 << " to update app channels; result: " << result; |
| 794 } | 798 } |
| 795 } | 799 } |
| 796 } else { | 800 } else { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 823 } | 827 } |
| 824 if (!install_list->Do()) | 828 if (!install_list->Do()) |
| 825 LOG(ERROR) << "Failed to record installer error information in registry."; | 829 LOG(ERROR) << "Failed to record installer error information in registry."; |
| 826 } | 830 } |
| 827 | 831 |
| 828 bool InstallerState::RequiresActiveSetup() const { | 832 bool InstallerState::RequiresActiveSetup() const { |
| 829 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); | 833 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); |
| 830 } | 834 } |
| 831 | 835 |
| 832 } // namespace installer | 836 } // namespace installer |
| OLD | NEW |