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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 for (size_t i = 0; i < products.size(); ++i) { | 312 for (size_t i = 0; i < products.size(); ++i) { |
313 const Product& p = *products[i]; | 313 const Product& p = *products[i]; |
314 if (p.is_chrome_frame()) { | 314 if (p.is_chrome_frame()) { |
315 AddChromeFrameWorkItems(original_state, installer_state, setup_path, | 315 AddChromeFrameWorkItems(original_state, installer_state, setup_path, |
316 new_version, p, list); | 316 new_version, p, list); |
317 } | 317 } |
318 if (p.is_chrome_app_host()) { | 318 if (p.is_chrome_app_host()) { |
319 AddInstallAppCommandWorkItems(installer_state, original_state, | 319 AddInstallAppCommandWorkItems(installer_state, original_state, |
320 &setup_path, &new_version, p, list); | 320 &setup_path, &new_version, p, list); |
321 } | 321 } |
322 if (p.is_chrome()) { | |
323 // In Chrome Browser, add registry entries so that when an OS upgrade | |
324 // occurs, Google Update will call setup.exe with --on-os-upgrade switch, | |
325 // which leads to ChromeBrowserOnOsUpgrade() being called. | |
326 CommandLine cmd_line(CommandLine::NO_PROGRAM); | |
327 RenderChromeBrowserOsUpgradeCommand(installer_state, setup_path, | |
328 new_version, &cmd_line); | |
329 AddOsUpgradeWorkItems(original_state, installer_state, p, cmd_line, list); | |
330 } | |
322 } | 331 } |
323 } | 332 } |
324 | 333 |
325 // Mirror oeminstall the first time anything is installed multi. There is no | 334 // Mirror oeminstall the first time anything is installed multi. There is no |
326 // need to update the value on future install/update runs since this value never | 335 // need to update the value on future install/update runs since this value never |
327 // changes. Note that the value is removed by Google Update after EULA | 336 // changes. Note that the value is removed by Google Update after EULA |
328 // acceptance is processed. | 337 // acceptance is processed. |
329 void AddOemInstallWorkItems(const InstallationState& original_state, | 338 void AddOemInstallWorkItems(const InstallationState& original_state, |
330 const InstallerState& installer_state, | 339 const InstallerState& installer_state, |
331 WorkItemList* install_list) { | 340 WorkItemList* install_list) { |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1586 AddGenericQuickEnableWorkItems(installer_state, | 1595 AddGenericQuickEnableWorkItems(installer_state, |
1587 machine_state, | 1596 machine_state, |
1588 setup_path, | 1597 setup_path, |
1589 new_version, | 1598 new_version, |
1590 work_item_list, | 1599 work_item_list, |
1591 false, // have_child_product | 1600 false, // have_child_product |
1592 cmd_line, | 1601 cmd_line, |
1593 kCmdQuickEnableApplicationHost); | 1602 kCmdQuickEnableApplicationHost); |
1594 } | 1603 } |
1595 | 1604 |
1605 void RenderChromeBrowserOsUpgradeCommand( | |
gab
2012/08/28 16:08:19
s/Render/Get
gab
2012/08/28 16:08:19
Remove "ChromeBrowser" from function name
grt (UTC plus 2)
2012/08/28 19:35:39
suggestion: you can make this product-independent
huangs
2012/08/29 17:02:54
Took grt@'s approach.
| |
1606 const InstallerState& installer_state, | |
1607 const FilePath& setup_path, | |
1608 const Version& new_version, | |
1609 CommandLine* cmd_line) { | |
1610 FilePath installer_path(installer_state | |
1611 .GetInstallerDirectory(new_version).Append(setup_path.BaseName())); | |
1612 cmd_line->SetProgram(installer_path); | |
1613 cmd_line->AppendSwitch(installer::switches::kOnOsUpgrade); | |
1614 cmd_line->AppendSwitch(installer::switches::kChrome); | |
gab
2012/08/28 16:08:19
nit: unindent 2 spaces
huangs
2012/08/29 17:02:54
Done.
| |
1615 if (installer_state.system_install()) | |
1616 cmd_line->AppendSwitch(installer::switches::kSystemLevel); | |
1617 if (installer_state.is_multi_install()) | |
1618 cmd_line->AppendSwitch(installer::switches::kMultiInstall); | |
1619 if (installer_state.verbose_logging()) | |
1620 cmd_line->AppendSwitch(installer::switches::kVerboseLogging); | |
1621 } | |
1622 | |
1623 void AddOsUpgradeWorkItems(const InstallationState& original_state, | |
1624 const InstallerState& installer_state, | |
1625 const Product& product, | |
1626 const CommandLine& cmd_line, | |
1627 WorkItemList* install_list) { | |
1628 const HKEY root_key = installer_state.root_key(); | |
1629 std::wstring cmd_key(product.distribution()->GetVersionKey()); | |
gab
2012/08/28 16:08:19
std::wstring -> string16
huangs
2012/08/29 17:02:54
Done. Also replacing everywhere else in file.
On
| |
1630 cmd_key.append(1, L'\\').append(google_update::kRegCommandsKey) | |
gab
2012/08/28 16:08:19
use
.push_back(FilePath::kSeparators[0])
instead o
huangs
2012/08/29 17:02:54
Okay, but .push_back() returns void, and cannot be
| |
1631 .append(1, L'\\').append(kCmdOnOsUpgrade); | |
1632 if (installer_state.operation() != InstallerState::UNINSTALL) { | |
1633 install_list->set_log_message("Adding OS upgrade command"); | |
1634 AppCommand cmd(cmd_line.GetCommandLineString(), false, false, true); | |
1635 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); | |
1636 } else { | |
1637 install_list->set_log_message("Removing OS upgrade command"); | |
1638 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key); | |
1639 } | |
1640 } | |
1641 | |
1596 } // namespace installer | 1642 } // namespace installer |
OLD | NEW |