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 // This file contains the definitions of the installer functions that build | 5 // This file contains the definitions of the installer functions that build |
6 // the WorkItemList used to install the application. | 6 // the WorkItemList used to install the application. |
7 | 7 |
8 #include "chrome/installer/setup/install_worker.h" | 8 #include "chrome/installer/setup/install_worker.h" |
9 | 9 |
10 #include <oaidl.h> | 10 #include <oaidl.h> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 archive_dst.value(), | 205 archive_dst.value(), |
206 temp_path.value(), | 206 temp_path.value(), |
207 WorkItem::ALWAYS); | 207 WorkItem::ALWAYS); |
208 #endif // COMPONENT_BUILD | 208 #endif // COMPONENT_BUILD |
209 } | 209 } |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 void AddInstallAppCommandWorkItems(const InstallerState& installer_state, | 213 void AddInstallAppCommandWorkItems(const InstallerState& installer_state, |
214 const InstallationState& machine_state, | 214 const InstallationState& machine_state, |
215 const FilePath& setup_path, | |
216 const Version& new_version, | 215 const Version& new_version, |
217 const Product& product, | 216 const Product& product, |
218 WorkItemList* work_item_list) { | 217 WorkItemList* work_item_list) { |
219 DCHECK(product.is_chrome_app_host()); | 218 DCHECK(product.is_chrome_app_host()); |
220 | 219 |
221 string16 cmd_key(product.distribution()->GetVersionKey()); | 220 string16 cmd_key(product.distribution()->GetVersionKey()); |
222 cmd_key.append(1, L'\\').append(google_update::kRegCommandsKey) | 221 cmd_key.append(1, L'\\').append(google_update::kRegCommandsKey) |
223 .append(1, L'\\').append(kCmdInstallApp); | 222 .append(1, L'\\').append(kCmdInstallApp); |
224 | 223 |
225 if (installer_state.operation() == InstallerState::UNINSTALL) { | 224 if (installer_state.operation() == InstallerState::UNINSTALL) { |
(...skipping 20 matching lines...) Expand all Loading... | |
246 const Products& products = installer_state.products(); | 245 const Products& products = installer_state.products(); |
247 for (Products::const_iterator it = products.begin(); it < products.end(); | 246 for (Products::const_iterator it = products.begin(); it < products.end(); |
248 ++it) { | 247 ++it) { |
249 const Product& p = **it; | 248 const Product& p = **it; |
250 if (p.is_chrome_frame()) { | 249 if (p.is_chrome_frame()) { |
251 AddChromeFrameWorkItems(original_state, installer_state, setup_path, | 250 AddChromeFrameWorkItems(original_state, installer_state, setup_path, |
252 new_version, p, list); | 251 new_version, p, list); |
253 } | 252 } |
254 if (p.is_chrome_app_host()) { | 253 if (p.is_chrome_app_host()) { |
255 AddInstallAppCommandWorkItems(installer_state, original_state, | 254 AddInstallAppCommandWorkItems(installer_state, original_state, |
256 setup_path, new_version, p, list); | 255 new_version, p, list); |
257 } | 256 } |
258 if (p.is_chrome()) { | 257 if (p.is_chrome()) { |
259 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, | 258 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
260 list); | 259 list); |
261 } | 260 } |
261 if (p.is_chrome_binaries()) { | |
262 AddQueryEULAAcceptanceWorkItems(installer_state, setup_path, new_version, | |
263 p, list); | |
264 } | |
262 } | 265 } |
263 } | 266 } |
264 | 267 |
265 // This is called when an MSI installation is run. It may be that a user is | 268 // This is called when an MSI installation is run. It may be that a user is |
266 // attempting to install the MSI on top of a non-MSI managed installation. | 269 // attempting to install the MSI on top of a non-MSI managed installation. |
267 // If so, try and remove any existing uninstallation shortcuts, as we want the | 270 // If so, try and remove any existing uninstallation shortcuts, as we want the |
268 // uninstall to be managed entirely by the MSI machinery (accessible via the | 271 // uninstall to be managed entirely by the MSI machinery (accessible via the |
269 // Add/Remove programs dialog). | 272 // Add/Remove programs dialog). |
270 void AddDeleteUninstallShortcutsForMSIWorkItems( | 273 void AddDeleteUninstallShortcutsForMSIWorkItems( |
271 const InstallerState& installer_state, | 274 const InstallerState& installer_state, |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1630 cmd_line.AppendSwitch(installer::switches::kSystemLevel); | 1633 cmd_line.AppendSwitch(installer::switches::kSystemLevel); |
1631 // Log everything for now. | 1634 // Log everything for now. |
1632 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); | 1635 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); |
1633 | 1636 |
1634 AppCommand cmd(cmd_line.GetCommandLineString()); | 1637 AppCommand cmd(cmd_line.GetCommandLineString()); |
1635 cmd.set_is_auto_run_on_os_upgrade(true); | 1638 cmd.set_is_auto_run_on_os_upgrade(true); |
1636 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); | 1639 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); |
1637 } | 1640 } |
1638 } | 1641 } |
1639 | 1642 |
1643 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, | |
1644 const FilePath& setup_path, | |
1645 const Version& new_version, | |
1646 const Product& product, | |
1647 WorkItemList* work_item_list) { | |
1648 const HKEY root_key = installer_state.root_key(); | |
1649 string16 cmd_key(product.distribution()->GetVersionKey()); | |
1650 cmd_key.append(1, FilePath::kSeparators[0]) | |
1651 .append(google_update::kRegCommandsKey) | |
1652 .append(1, FilePath::kSeparators[0]) | |
1653 .append(kCmdQueryEULAAcceptance); | |
1654 if (installer_state.operation() == InstallerState::UNINSTALL) { | |
1655 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> | |
1656 set_log_message("Removing query EULA acceptance command"); | |
1657 } else { | |
1658 CommandLine cmd_line(installer_state | |
1659 .GetInstallerDirectory(new_version) | |
1660 .Append(setup_path.BaseName())); | |
1661 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); | |
grt (UTC plus 2)
2013/01/24 21:04:55
does it make sense to add --system-level if it's a
huangs
2013/01/25 01:13:23
Ah, right. Done.
| |
1662 AppCommand cmd(cmd_line.GetCommandLineString()); | |
1663 cmd.set_is_web_accessible(true); | |
1664 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); | |
1665 } | |
1666 } | |
1667 | |
1640 } // namespace installer | 1668 } // namespace installer |
OLD | NEW |