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 "chrome/installer/setup/install.h" | 5 #include "chrome/installer/setup/install.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 #include <time.h> | 8 #include <time.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 RegKey key; | 155 RegKey key; |
156 ChannelInfo other_info; | 156 ChannelInfo other_info; |
157 std::vector<std::wstring>::const_iterator kscan = keys.begin(); | 157 std::vector<std::wstring>::const_iterator kscan = keys.begin(); |
158 std::vector<std::wstring>::const_iterator kend = keys.end(); | 158 std::vector<std::wstring>::const_iterator kend = keys.end(); |
159 for (; kscan != kend; ++kscan) { | 159 for (; kscan != kend; ++kscan) { |
160 // Handle the case where the ClientState key doesn't exist by creating it. | 160 // Handle the case where the ClientState key doesn't exist by creating it. |
161 // This takes care of the multi-installer's package key, which is not | 161 // This takes care of the multi-installer's package key, which is not |
162 // created by Google Update for us. | 162 // created by Google Update for us. |
163 if (!key.Open(reg_root, kscan->c_str(), KEY_QUERY_VALUE) || | 163 if (key.Open(reg_root, kscan->c_str(), KEY_QUERY_VALUE) != ERROR_SUCCESS || |
164 !other_info.Initialize(key)) { | 164 !other_info.Initialize(key)) { |
165 other_info.set_value(std::wstring()); | 165 other_info.set_value(std::wstring()); |
166 } | 166 } |
167 if (!other_info.Equals(channel_info)) { | 167 if (!other_info.Equals(channel_info)) { |
168 if (!key.Valid()) | 168 if (!key.Valid()) |
169 install_list->AddCreateRegKeyWorkItem(reg_root, *kscan); | 169 install_list->AddCreateRegKeyWorkItem(reg_root, *kscan); |
170 install_list->AddSetRegValueWorkItem(reg_root, *kscan, | 170 install_list->AddSetRegValueWorkItem(reg_root, *kscan, |
171 google_update::kRegApField, | 171 google_update::kRegApField, |
172 channel_info.value(), true); | 172 channel_info.value(), true); |
173 } | 173 } |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 } | 562 } |
563 | 563 |
564 install.RemoveOldVersionDirectories(existing_version.get() ? | 564 install.RemoveOldVersionDirectories(existing_version.get() ? |
565 *existing_version.get() : new_version); | 565 *existing_version.get() : new_version); |
566 } | 566 } |
567 | 567 |
568 return result; | 568 return result; |
569 } | 569 } |
570 | 570 |
571 } // namespace installer | 571 } // namespace installer |
OLD | NEW |