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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 AddOemInstallWorkItems(original_state, installer_state, install_list); | 473 AddOemInstallWorkItems(original_state, installer_state, install_list); |
474 | 474 |
475 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); | 475 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); |
476 | 476 |
477 AddUsageStatsWorkItems(original_state, installer_state, install_list); | 477 AddUsageStatsWorkItems(original_state, installer_state, install_list); |
478 | 478 |
479 // TODO(grt): check for other keys/values we should put in the package's | 479 // TODO(grt): check for other keys/values we should put in the package's |
480 // ClientState and/or Clients key. | 480 // ClientState and/or Clients key. |
481 } | 481 } |
482 | 482 |
483 void AddOsUpgradeWorkItems(const InstallationState& original_state, | |
grt (UTC plus 2)
2012/08/21 20:32:55
Since this does work for the browser only, I think
huangs
2012/08/21 22:00:43
Renaming to AddCromeBrowserOsUpgradeWorkItems().
| |
484 const InstallerState& installer_state, | |
485 const FilePath& setup_path, | |
486 const Version& new_version, | |
487 WorkItemList* install_list) { | |
488 const HKEY root_key = installer_state.root_key(); | |
489 | |
490 // In Chrome Browser, add registry entries so that whenOS upgrade occurs, | |
grt (UTC plus 2)
2012/08/21 20:32:55
"whenOS" -> "when an OS"
huangs
2012/08/21 22:00:43
Done.
| |
491 // Google Update would call setup.exe with --on-os-upgrade switch, which | |
grt (UTC plus 2)
2012/08/21 20:32:55
"would" -> "will"
huangs
2012/08/21 22:00:43
Done.
| |
492 // leads to OnOsUpgrade() being called. | |
493 if (installer_state.state_type() == BrowserDistribution::CHROME_BROWSER) { | |
494 const Product* product = installer_state.FindProduct( | |
495 BrowserDistribution::CHROME_BROWSER); | |
496 DCHECK(product != NULL); | |
497 std::wstring browser_key(product->distribution()->GetVersionKey()); | |
498 browser_key.append(1, L'\\').append(google_update::kRegCommandsKey) | |
499 .append(1, L'\\').append(kCmdOnOsUpgrade); | |
500 | |
501 if (installer_state.operation() != InstallerState::UNINSTALL) { | |
502 FilePath installer_path(installer_state | |
503 .GetInstallerDirectory(new_version).Append(setup_path.BaseName())); | |
504 CommandLine command(installer_path); | |
505 command.AppendSwitch(installer::switches::kOnOsUpgrade); | |
grt (UTC plus 2)
2012/08/21 20:32:55
my gut tells me that you want to add kMultiInstall
huangs
2012/08/21 22:00:43
Done.
| |
506 if (installer_state.verbose_logging()) | |
507 command.AppendSwitch(installer::switches::kVerboseLogging); | |
508 | |
509 install_list->set_log_message("adding OS upgrade command"); | |
510 | |
511 install_list->AddCreateRegKeyWorkItem(root_key, browser_key) | |
512 ->set_log_message("creating AppCommand command registry key"); | |
grt (UTC plus 2)
2012/08/21 20:32:55
does this use of set_log_message add useful meanin
huangs
2012/08/21 22:00:43
This was modelled after
http://code.google.com/sea
| |
513 install_list->AddSetRegValueWorkItem(root_key, browser_key, | |
514 google_update::kRegCommandLineField, | |
515 command.GetCommandLineString(), | |
516 true) | |
517 ->set_log_message("setting AppCommand CommandLine registry value"); | |
518 install_list->AddSetRegValueWorkItem( | |
519 root_key, browser_key, google_update::kRegAutoRunOnOSUpgrade, | |
520 (DWORD) 1, true) | |
521 ->set_log_message("setting AutoRunOnOSUpgrade registry value"); | |
522 | |
523 } else { | |
524 install_list->AddDeleteRegKeyWorkItem(root_key, | |
grt (UTC plus 2)
2012/08/21 20:32:55
is this necessary? the whole version key is delet
huangs
2012/08/21 22:00:43
I'm following the general style of the file, where
| |
525 browser_key)->set_log_message( | |
526 "Removing OS upgrade command"); | |
527 } | |
528 } | |
529 } | |
530 | |
483 void AddUsageStatsWorkItems(const InstallationState& original_state, | 531 void AddUsageStatsWorkItems(const InstallationState& original_state, |
484 const InstallerState& installer_state, | 532 const InstallerState& installer_state, |
485 WorkItemList* install_list) { | 533 WorkItemList* install_list) { |
486 DCHECK(installer_state.operation() == InstallerState::MULTI_INSTALL || | 534 DCHECK(installer_state.operation() == InstallerState::MULTI_INSTALL || |
487 installer_state.operation() == InstallerState::MULTI_UPDATE); | 535 installer_state.operation() == InstallerState::MULTI_UPDATE); |
488 | 536 |
489 HKEY root_key = installer_state.root_key(); | 537 HKEY root_key = installer_state.root_key(); |
490 bool value_found = false; | 538 bool value_found = false; |
491 DWORD usagestats = 0; | 539 DWORD usagestats = 0; |
492 const Products& products = installer_state.products(); | 540 const Products& products = installer_state.products(); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
917 } | 965 } |
918 | 966 |
919 // Add any remaining work items that involve special settings for | 967 // Add any remaining work items that involve special settings for |
920 // each product. | 968 // each product. |
921 AddProductSpecificWorkItems(original_state, installer_state, setup_path, | 969 AddProductSpecificWorkItems(original_state, installer_state, setup_path, |
922 new_version, install_list); | 970 new_version, install_list); |
923 | 971 |
924 // Copy over brand, usagestats, and other values. | 972 // Copy over brand, usagestats, and other values. |
925 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); | 973 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); |
926 | 974 |
975 AddOsUpgradeWorkItems(original_state, installer_state, setup_path, | |
976 new_version, install_list); | |
977 | |
927 AddQuickEnableApplicationHostWorkItems(installer_state, original_state, | 978 AddQuickEnableApplicationHostWorkItems(installer_state, original_state, |
928 &setup_path, &new_version, | 979 &setup_path, &new_version, |
929 install_list); | 980 install_list); |
930 | 981 |
931 AddQuickEnableChromeFrameWorkItems(installer_state, original_state, | 982 AddQuickEnableChromeFrameWorkItems(installer_state, original_state, |
932 &setup_path, &new_version, install_list); | 983 &setup_path, &new_version, install_list); |
933 | 984 |
934 // Append the tasks that run after the installation. | 985 // Append the tasks that run after the installation. |
935 AppendPostInstallTasks(installer_state, | 986 AppendPostInstallTasks(installer_state, |
936 setup_path, | 987 setup_path, |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1587 machine_state, | 1638 machine_state, |
1588 setup_path, | 1639 setup_path, |
1589 new_version, | 1640 new_version, |
1590 work_item_list, | 1641 work_item_list, |
1591 false, // have_child_product | 1642 false, // have_child_product |
1592 cmd_line, | 1643 cmd_line, |
1593 kCmdQuickEnableApplicationHost); | 1644 kCmdQuickEnableApplicationHost); |
1594 } | 1645 } |
1595 | 1646 |
1596 } // namespace installer | 1647 } // namespace installer |
OLD | NEW |