Chromium Code Reviews| 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, | |
|
huangs
2013/01/23 04:37:56
(Unrelated) code cleanup: unused parameter.
| |
| 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); |
|
huangs
2013/01/23 04:37:56
(Unrelated) code cleanup: unused parameter.
| |
| 256 AddQueryEULAAcceptanceWorkItems(installer_state, p, list); | |
| 257 } | 257 } |
| 258 if (p.is_chrome()) { | 258 if (p.is_chrome()) { |
| 259 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, | 259 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
| 260 list); | 260 list); |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 // This is called when an MSI installation is run. It may be that a user is | 265 // 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. | 266 // attempting to install the MSI on top of a non-MSI managed installation. |
| (...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1630 cmd_line.AppendSwitch(installer::switches::kSystemLevel); | 1630 cmd_line.AppendSwitch(installer::switches::kSystemLevel); |
| 1631 // Log everything for now. | 1631 // Log everything for now. |
| 1632 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); | 1632 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); |
| 1633 | 1633 |
| 1634 AppCommand cmd(cmd_line.GetCommandLineString()); | 1634 AppCommand cmd(cmd_line.GetCommandLineString()); |
| 1635 cmd.set_is_auto_run_on_os_upgrade(true); | 1635 cmd.set_is_auto_run_on_os_upgrade(true); |
| 1636 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); | 1636 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); |
| 1637 } | 1637 } |
| 1638 } | 1638 } |
| 1639 | 1639 |
| 1640 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, | |
| 1641 const Product& product, | |
| 1642 WorkItemList* work_item_list) { | |
| 1643 const HKEY root_key = installer_state.root_key(); | |
| 1644 string16 cmd_key(product.distribution()->GetVersionKey()); | |
|
grt (UTC plus 2)
2013/01/23 19:02:29
this is adding the command to the app host. somet
huangs
2013/01/24 00:08:08
It's invoking whatever Chrome that's available.
| |
| 1645 cmd_key.append(1, FilePath::kSeparators[0]) | |
| 1646 .append(google_update::kRegCommandsKey) | |
| 1647 .append(1, FilePath::kSeparators[0]) | |
| 1648 .append(kCmdQueryEULAAcceptance); | |
| 1649 if (installer_state.operation() == InstallerState::UNINSTALL) { | |
| 1650 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> | |
| 1651 set_log_message("Removing query EULA acceptance command"); | |
| 1652 } else { | |
| 1653 CommandLine cmd_line( | |
| 1654 installer_state.target_path().Append(installer::kChromeAppHostExe)); | |
|
grt (UTC plus 2)
2013/01/23 19:02:29
kChromeAppHostExe -> kChromeExe?
huangs
2013/01/24 00:08:08
Done.
| |
| 1655 cmd_line.AppendSwitch(::switches::kQueryEULAAcceptance); | |
| 1656 AppCommand cmd(cmd_line.GetCommandLineString()); | |
| 1657 // cmd.set_sends_pings(true); // QUESTION(huangs): Do we need this????? | |
|
huangs
2013/01/23 04:37:56
Please note question.
| |
| 1658 cmd.set_is_web_accessible(true); | |
| 1659 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); | |
| 1660 } | |
| 1661 } | |
| 1662 | |
| 1640 } // namespace installer | 1663 } // namespace installer |
| OLD | NEW |