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/setup/chrome_frame_quick_enable.h" | 5 #include "chrome/installer/setup/chrome_frame_quick_enable.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 DCHECK(chrome_state); // Checked in CheckQuickEnablePreconditions. | 93 DCHECK(chrome_state); // Checked in CheckQuickEnablePreconditions. |
94 | 94 |
95 // Temporarily remove Chrome from the product list. | 95 // Temporarily remove Chrome from the product list. |
96 // This is so that the operations below do not affect the installation | 96 // This is so that the operations below do not affect the installation |
97 // state of Chrome. | 97 // state of Chrome. |
98 installer_state->RemoveProduct( | 98 installer_state->RemoveProduct( |
99 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER)); | 99 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER)); |
100 | 100 |
101 FilePath setup_path(chrome_state->GetSetupPath()); | 101 FilePath setup_path(chrome_state->GetSetupPath()); |
102 const Version& new_version = chrome_state->version(); | 102 const Version& new_version = chrome_state->version(); |
| 103 FilePath new_chrome_exe( |
| 104 installer_state->target_path().Append(installer::kChromeNewExe)); |
103 | 105 |
104 // This creates the uninstallation entry for GCF. | 106 // This creates the uninstallation entry for GCF. |
105 AddUninstallShortcutWorkItems(*installer_state, setup_path, new_version, | 107 AddUninstallShortcutWorkItems(*installer_state, setup_path, new_version, |
106 item_list.get(), *cf); | 108 item_list.get(), *cf); |
107 // Always set the "lang" value since quick-enable always happens in the | 109 // Always set the "lang" value since quick-enable always happens in the |
108 // context of an interactive session with a user. | 110 // context of an interactive session with a user. |
109 AddVersionKeyWorkItems(installer_state->root_key(), cf->distribution(), | 111 AddVersionKeyWorkItems(installer_state->root_key(), cf->distribution(), |
110 new_version, true, item_list.get()); | 112 new_version, true, item_list.get()); |
111 AddChromeFrameWorkItems(machine_state, *installer_state, setup_path, | 113 AddChromeFrameWorkItems(machine_state, *installer_state, setup_path, |
112 new_version, *cf, item_list.get()); | 114 new_version, *cf, item_list.get()); |
113 | 115 |
114 const Version* opv = chrome_state->old_version(); | 116 const Version* opv = chrome_state->old_version(); |
115 AppendPostInstallTasks(*installer_state, setup_path, opv, | 117 AppendPostInstallTasks(*installer_state, setup_path, new_chrome_exe, opv, |
116 new_version, temp_path.path(), item_list.get()); | 118 new_version, temp_path.path(), item_list.get()); |
117 | 119 |
118 // Before updating the channel values, add Chrome back to the mix so that | 120 // Before updating the channel values, add Chrome back to the mix so that |
119 // all multi-installed products' channel values get updated. | 121 // all multi-installed products' channel values get updated. |
120 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, | 122 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, |
121 *chrome_state); | 123 *chrome_state); |
122 AddGoogleUpdateWorkItems(machine_state, *installer_state, | 124 AddGoogleUpdateWorkItems(machine_state, *installer_state, |
123 item_list.get()); | 125 item_list.get()); |
124 | 126 |
125 // Add the items to remove the quick-enable-cf command from the registry. | 127 // Add the items to remove the quick-enable-cf command from the registry. |
126 AddQuickEnableChromeFrameWorkItems( | 128 AddQuickEnableWorkItems(*installer_state, machine_state, |
127 *installer_state, machine_state, | 129 &chrome_state->uninstall_command().GetProgram(), |
128 &chrome_state->uninstall_command().GetProgram(), | 130 &chrome_state->version(), |
129 &chrome_state->version(), | 131 item_list.get()); |
130 item_list.get()); | |
131 | 132 |
132 if (!item_list->Do()) { | 133 if (!item_list->Do()) { |
133 item_list->Rollback(); | 134 item_list->Rollback(); |
134 status = INSTALL_FAILED; | 135 status = INSTALL_FAILED; |
135 } else { | 136 } else { |
136 DCHECK_EQ(FIRST_INSTALL_SUCCESS, status); | 137 DCHECK_EQ(FIRST_INSTALL_SUCCESS, status); |
137 VLOG(1) << "Chrome Frame successfully activated."; | 138 VLOG(1) << "Chrome Frame successfully activated."; |
138 } | 139 } |
139 } | 140 } |
140 } | 141 } |
(...skipping 21 matching lines...) Expand all Loading... |
162 BrowserDistribution::CHROME_BINARIES), | 163 BrowserDistribution::CHROME_BINARIES), |
163 true)) { | 164 true)) { |
164 LOG(ERROR) << "Failed to set EULA consent for multi-install binaries."; | 165 LOG(ERROR) << "Failed to set EULA consent for multi-install binaries."; |
165 } | 166 } |
166 } | 167 } |
167 | 168 |
168 return status; | 169 return status; |
169 } | 170 } |
170 | 171 |
171 } // namespace installer | 172 } // namespace installer |
OLD | NEW |