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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 DCHECK(command_key); | 208 DCHECK(command_key); |
| 209 DCHECK(app); | 209 DCHECK(app); |
| 210 DCHECK(command_with_parameter); | 210 DCHECK(command_with_parameter); |
| 211 DCHECK(work_item_list); | 211 DCHECK(work_item_list); |
| 212 | 212 |
| 213 base::string16 full_cmd_key( | 213 base::string16 full_cmd_key( |
| 214 GetRegCommandKey(product.distribution(), command_key)); | 214 GetRegCommandKey(product.distribution(), command_key)); |
| 215 | 215 |
| 216 if (installer_state.operation() == InstallerState::UNINSTALL) { | 216 if (installer_state.operation() == InstallerState::UNINSTALL) { |
| 217 work_item_list->AddDeleteRegKeyWorkItem( | 217 work_item_list->AddDeleteRegKeyWorkItem( |
| 218 installer_state.root_key(), full_cmd_key)->set_log_message( | 218 installer_state.root_key(), full_cmd_key, |
| 219 "removing " + base::UTF16ToASCII(command_key) + " command"); | 219 WorkItem::WOW64_DEFAULT)->set_log_message( |
| 220 "removing " + base::UTF16ToASCII(command_key) + " command"); | |
| 220 } else { | 221 } else { |
| 221 CommandLine cmd_line(installer_state.target_path().Append(app)); | 222 CommandLine cmd_line(installer_state.target_path().Append(app)); |
| 222 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); | 223 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); |
| 223 | 224 |
| 224 AppCommand cmd(cmd_line.GetCommandLineString()); | 225 AppCommand cmd(cmd_line.GetCommandLineString()); |
| 225 cmd.set_sends_pings(true); | 226 cmd.set_sends_pings(true); |
| 226 cmd.set_is_web_accessible(true); | 227 cmd.set_is_web_accessible(true); |
| 227 cmd.set_is_run_as_user(true); | 228 cmd.set_is_run_as_user(true); |
| 228 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); | 229 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); |
| 229 } | 230 } |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 const base::FilePath& temp_path, | 434 const base::FilePath& temp_path, |
| 434 WorkItemList* work_item_list) { | 435 WorkItemList* work_item_list) { |
| 435 DCHECK(installer_state.is_msi()) | 436 DCHECK(installer_state.is_msi()) |
| 436 << "This must only be called for MSI installations!"; | 437 << "This must only be called for MSI installations!"; |
| 437 | 438 |
| 438 // First attempt to delete the old installation's ARP dialog entry. | 439 // First attempt to delete the old installation's ARP dialog entry. |
| 439 HKEY reg_root = installer_state.root_key(); | 440 HKEY reg_root = installer_state.root_key(); |
| 440 base::string16 uninstall_reg(product.distribution()->GetUninstallRegPath()); | 441 base::string16 uninstall_reg(product.distribution()->GetUninstallRegPath()); |
| 441 | 442 |
| 442 WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem( | 443 WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem( |
| 443 reg_root, uninstall_reg); | 444 reg_root, uninstall_reg, WorkItem::WOW64_DEFAULT); |
| 444 delete_reg_key->set_ignore_failure(true); | 445 delete_reg_key->set_ignore_failure(true); |
| 445 | 446 |
| 446 // Then attempt to delete the old installation's start menu shortcut. | 447 // Then attempt to delete the old installation's start menu shortcut. |
| 447 base::FilePath uninstall_link; | 448 base::FilePath uninstall_link; |
| 448 if (installer_state.system_install()) { | 449 if (installer_state.system_install()) { |
| 449 PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link); | 450 PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link); |
| 450 } else { | 451 } else { |
| 451 PathService::Get(base::DIR_START_MENU, &uninstall_link); | 452 PathService::Get(base::DIR_START_MENU, &uninstall_link); |
| 452 } | 453 } |
| 453 | 454 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 | 603 |
| 603 return true; | 604 return true; |
| 604 } | 605 } |
| 605 | 606 |
| 606 void AddUninstallDelegateExecuteWorkItems( | 607 void AddUninstallDelegateExecuteWorkItems( |
| 607 HKEY root, | 608 HKEY root, |
| 608 const base::string16& delegate_execute_path, | 609 const base::string16& delegate_execute_path, |
| 609 WorkItemList* list) { | 610 WorkItemList* list) { |
| 610 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler in " | 611 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler in " |
| 611 << root; | 612 << root; |
| 612 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); | 613 #if defined(_WIN64) |
| 614 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path, | |
| 615 WorkItem::WOW64_DEFAULT); | |
| 616 #else | |
| 617 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path, | |
| 618 WorkItem::WOW64_DEFAULT); | |
| 619 #endif | |
|
Will Harris
2014/05/16 17:29:07
This looks weird because I haven't decided how I'm
| |
| 613 | 620 |
| 614 // In the past, the ICommandExecuteImpl interface and a TypeLib were both | 621 // In the past, the ICommandExecuteImpl interface and a TypeLib were both |
| 615 // registered. Remove these since this operation may be updating a machine | 622 // registered. Remove these since this operation may be updating a machine |
| 616 // that had the old registrations. | 623 // that had the old registrations. |
| 617 list->AddDeleteRegKeyWorkItem(root, | 624 list->AddDeleteRegKeyWorkItem(root, |
| 618 L"Software\\Classes\\Interface\\" | 625 L"Software\\Classes\\Interface\\" |
| 619 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}"); | 626 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}", |
| 627 WorkItem::WOW64_DEFAULT); | |
| 620 list->AddDeleteRegKeyWorkItem(root, | 628 list->AddDeleteRegKeyWorkItem(root, |
| 621 L"Software\\Classes\\TypeLib\\" | 629 L"Software\\Classes\\TypeLib\\" |
| 622 #if defined(GOOGLE_CHROME_BUILD) | 630 #if defined(GOOGLE_CHROME_BUILD) |
| 623 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}" | 631 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}", |
| 624 #else | 632 #else |
| 625 L"{7779FB70-B399-454A-AA1A-BAA850032B10}" | 633 L"{7779FB70-B399-454A-AA1A-BAA850032B10}", |
| 626 #endif | 634 #endif |
| 627 ); | 635 WorkItem::WOW64_DEFAULT); |
| 628 } | 636 } |
| 629 | 637 |
| 630 // Google Chrome Canary, between 20.0.1101.0 (crrev.com/132190) and 20.0.1106.0 | 638 // Google Chrome Canary, between 20.0.1101.0 (crrev.com/132190) and 20.0.1106.0 |
| 631 // (exclusively -- crrev.com/132596), registered a DelegateExecute class by | 639 // (exclusively -- crrev.com/132596), registered a DelegateExecute class by |
| 632 // mistake (with the same GUID as Chrome). The fix stopped registering the bad | 640 // mistake (with the same GUID as Chrome). The fix stopped registering the bad |
| 633 // value, but didn't delete it. This is a problem for users who had installed | 641 // value, but didn't delete it. This is a problem for users who had installed |
| 634 // Canary before 20.0.1106.0 and now have a system-level Chrome, as the | 642 // Canary before 20.0.1106.0 and now have a system-level Chrome, as the |
| 635 // left-behind Canary registrations in HKCU mask the HKLM registrations for the | 643 // left-behind Canary registrations in HKCU mask the HKLM registrations for the |
| 636 // same GUID. Cleanup those registrations if they still exist and belong to this | 644 // same GUID. Cleanup those registrations if they still exist and belong to this |
| 637 // Canary (i.e., the registered delegate_execute's path is under |target_path|). | 645 // Canary (i.e., the registered delegate_execute's path is under |target_path|). |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 base::FilePath install_path(installer_state.target_path()); | 694 base::FilePath install_path(installer_state.target_path()); |
| 687 base::FilePath installer_path( | 695 base::FilePath installer_path( |
| 688 installer_state.GetInstallerDirectory(new_version)); | 696 installer_state.GetInstallerDirectory(new_version)); |
| 689 installer_path = installer_path.Append(setup_path.BaseName()); | 697 installer_path = installer_path.Append(setup_path.BaseName()); |
| 690 | 698 |
| 691 CommandLine uninstall_arguments(CommandLine::NO_PROGRAM); | 699 CommandLine uninstall_arguments(CommandLine::NO_PROGRAM); |
| 692 AppendUninstallCommandLineFlags(installer_state, product, | 700 AppendUninstallCommandLineFlags(installer_state, product, |
| 693 &uninstall_arguments); | 701 &uninstall_arguments); |
| 694 | 702 |
| 695 base::string16 update_state_key(browser_dist->GetStateKey()); | 703 base::string16 update_state_key(browser_dist->GetStateKey()); |
| 696 install_list->AddCreateRegKeyWorkItem(reg_root, update_state_key); | 704 install_list->AddCreateRegKeyWorkItem( |
| 697 install_list->AddSetRegValueWorkItem(reg_root, update_state_key, | 705 reg_root, update_state_key, WorkItem::WOW64_32KEY); |
| 698 installer::kUninstallStringField, installer_path.value(), true); | 706 install_list->AddSetRegValueWorkItem( |
| 699 install_list->AddSetRegValueWorkItem(reg_root, update_state_key, | 707 reg_root, update_state_key, installer::kUninstallStringField, |
| 700 installer::kUninstallArgumentsField, | 708 installer_path.value(), true, WorkItem::WOW64_32KEY); |
| 701 uninstall_arguments.GetCommandLineString(), true); | 709 install_list->AddSetRegValueWorkItem( |
| 710 reg_root, update_state_key, installer::kUninstallArgumentsField, | |
| 711 uninstall_arguments.GetCommandLineString(), true, | |
| 712 WorkItem::WOW64_32KEY); | |
| 702 | 713 |
| 703 // MSI installations will manage their own uninstall shortcuts. | 714 // MSI installations will manage their own uninstall shortcuts. |
| 704 if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) { | 715 if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) { |
| 705 // We need to quote the command line for the Add/Remove Programs dialog. | 716 // We need to quote the command line for the Add/Remove Programs dialog. |
| 706 CommandLine quoted_uninstall_cmd(installer_path); | 717 CommandLine quoted_uninstall_cmd(installer_path); |
| 707 DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"'); | 718 DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"'); |
| 708 quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false); | 719 quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false); |
| 709 | 720 |
| 710 base::string16 uninstall_reg = browser_dist->GetUninstallRegPath(); | 721 base::string16 uninstall_reg = browser_dist->GetUninstallRegPath(); |
| 711 install_list->AddCreateRegKeyWorkItem(reg_root, uninstall_reg); | 722 install_list->AddCreateRegKeyWorkItem( |
| 712 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 723 reg_root, uninstall_reg, WorkItem::WOW64_DEFAULT); |
| 713 installer::kUninstallDisplayNameField, browser_dist->GetDisplayName(), | 724 install_list->AddSetRegValueWorkItem( |
| 714 true); | 725 reg_root, uninstall_reg, installer::kUninstallDisplayNameField, |
| 715 install_list->AddSetRegValueWorkItem(reg_root, | 726 browser_dist->GetDisplayName(), true, WorkItem::WOW64_DEFAULT); |
| 716 uninstall_reg, installer::kUninstallStringField, | 727 install_list->AddSetRegValueWorkItem( |
| 717 quoted_uninstall_cmd.GetCommandLineString(), true); | 728 reg_root, uninstall_reg, installer::kUninstallStringField, |
| 718 install_list->AddSetRegValueWorkItem(reg_root, | 729 quoted_uninstall_cmd.GetCommandLineString(), true, |
| 719 uninstall_reg, | 730 WorkItem::WOW64_DEFAULT); |
| 720 L"InstallLocation", | 731 install_list->AddSetRegValueWorkItem( |
| 721 install_path.value(), | 732 reg_root, uninstall_reg, L"InstallLocation", |
| 722 true); | 733 install_path.value(), true, WorkItem::WOW64_DEFAULT); |
| 723 | 734 |
| 724 BrowserDistribution* dist = product.distribution(); | 735 BrowserDistribution* dist = product.distribution(); |
| 725 base::string16 chrome_icon = ShellUtil::FormatIconLocation( | 736 base::string16 chrome_icon = ShellUtil::FormatIconLocation( |
| 726 install_path.Append(dist->GetIconFilename()).value(), | 737 install_path.Append(dist->GetIconFilename()).value(), |
| 727 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME)); | 738 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME)); |
| 728 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 739 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 729 L"DisplayIcon", chrome_icon, true); | 740 L"DisplayIcon", chrome_icon, true, WorkItem::WOW64_DEFAULT); |
| 730 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 741 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 731 L"NoModify", static_cast<DWORD>(1), | 742 L"NoModify", static_cast<DWORD>(1), |
| 732 true); | 743 true, WorkItem::WOW64_DEFAULT); |
| 733 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 744 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 734 L"NoRepair", static_cast<DWORD>(1), | 745 L"NoRepair", static_cast<DWORD>(1), |
| 735 true); | 746 true, WorkItem::WOW64_DEFAULT); |
| 736 | 747 |
| 737 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 748 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 738 L"Publisher", | 749 L"Publisher", |
| 739 browser_dist->GetPublisherName(), | 750 browser_dist->GetPublisherName(), |
| 740 true); | 751 true, WorkItem::WOW64_DEFAULT); |
| 741 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 752 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 742 L"Version", | 753 L"Version", |
| 743 ASCIIToWide(new_version.GetString()), | 754 ASCIIToWide(new_version.GetString()), |
| 744 true); | 755 true, WorkItem::WOW64_DEFAULT); |
| 745 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 756 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 746 L"DisplayVersion", | 757 L"DisplayVersion", |
| 747 ASCIIToWide(new_version.GetString()), | 758 ASCIIToWide(new_version.GetString()), |
| 748 true); | 759 true, WorkItem::WOW64_DEFAULT); |
| 749 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 760 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 750 L"InstallDate", | 761 L"InstallDate", |
| 751 InstallUtil::GetCurrentDate(), | 762 InstallUtil::GetCurrentDate(), |
| 752 false); | 763 false, WorkItem::WOW64_DEFAULT); |
| 753 | 764 |
| 754 const std::vector<uint16>& version_components = new_version.components(); | 765 const std::vector<uint16>& version_components = new_version.components(); |
| 755 if (version_components.size() == 4) { | 766 if (version_components.size() == 4) { |
| 756 // Our version should be in major.minor.build.rev. | 767 // Our version should be in major.minor.build.rev. |
| 757 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 768 install_list->AddSetRegValueWorkItem( |
| 758 L"VersionMajor", static_cast<DWORD>(version_components[2]), true); | 769 reg_root, uninstall_reg, L"VersionMajor", |
| 759 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 770 static_cast<DWORD>(version_components[2]), |
| 760 L"VersionMinor", static_cast<DWORD>(version_components[3]), true); | 771 true, WorkItem::WOW64_DEFAULT); |
| 772 install_list->AddSetRegValueWorkItem( | |
| 773 reg_root, uninstall_reg, L"VersionMinor", | |
| 774 static_cast<DWORD>(version_components[3]), | |
| 775 true, WorkItem::WOW64_DEFAULT); | |
| 761 } | 776 } |
| 762 } | 777 } |
| 763 } | 778 } |
| 764 | 779 |
| 765 // Create Version key for a product (if not already present) and sets the new | 780 // Create Version key for a product (if not already present) and sets the new |
| 766 // product version as the last step. | 781 // product version as the last step. |
| 767 void AddVersionKeyWorkItems(HKEY root, | 782 void AddVersionKeyWorkItems(HKEY root, |
| 768 BrowserDistribution* dist, | 783 BrowserDistribution* dist, |
| 769 const Version& new_version, | 784 const Version& new_version, |
| 770 bool add_language_identifier, | 785 bool add_language_identifier, |
| 771 WorkItemList* list) { | 786 WorkItemList* list) { |
| 772 // Create Version key for each distribution (if not already present) and set | 787 // Create Version key for each distribution (if not already present) and set |
| 773 // the new product version as the last step. | 788 // the new product version as the last step. |
| 774 base::string16 version_key(dist->GetVersionKey()); | 789 base::string16 version_key(dist->GetVersionKey()); |
| 775 list->AddCreateRegKeyWorkItem(root, version_key); | 790 list->AddCreateRegKeyWorkItem(root, version_key, WorkItem::WOW64_32KEY); |
| 776 | 791 |
| 777 base::string16 product_name(dist->GetDisplayName()); | 792 base::string16 product_name(dist->GetDisplayName()); |
| 778 list->AddSetRegValueWorkItem(root, version_key, google_update::kRegNameField, | 793 list->AddSetRegValueWorkItem(root, version_key, google_update::kRegNameField, |
| 779 product_name, true); // overwrite name also | 794 product_name, true, WorkItem::WOW64_32KEY); // overwrite name also |
| 780 list->AddSetRegValueWorkItem(root, version_key, | 795 list->AddSetRegValueWorkItem(root, version_key, |
| 781 google_update::kRegOopcrashesField, | 796 google_update::kRegOopcrashesField, static_cast<DWORD>(1), false, |
| 782 static_cast<DWORD>(1), | 797 WorkItem::WOW64_32KEY); // set during first install |
| 783 false); // set during first install | |
| 784 if (add_language_identifier) { | 798 if (add_language_identifier) { |
| 785 // Write the language identifier of the current translation. Omaha's set of | 799 // Write the language identifier of the current translation. Omaha's set of |
| 786 // languages is a superset of Chrome's set of translations with this one | 800 // languages is a superset of Chrome's set of translations with this one |
| 787 // exception: what Chrome calls "en-us", Omaha calls "en". sigh. | 801 // exception: what Chrome calls "en-us", Omaha calls "en". sigh. |
| 788 base::string16 language(GetCurrentTranslation()); | 802 base::string16 language(GetCurrentTranslation()); |
| 789 if (LowerCaseEqualsASCII(language, "en-us")) | 803 if (LowerCaseEqualsASCII(language, "en-us")) |
| 790 language.resize(2); | 804 language.resize(2); |
| 791 list->AddSetRegValueWorkItem(root, version_key, | 805 list->AddSetRegValueWorkItem( |
| 792 google_update::kRegLangField, language, | 806 root, version_key, google_update::kRegLangField, language, false, |
| 793 false); // do not overwrite language | 807 WorkItem::WOW64_32KEY); // do not overwrite language |
| 794 } | 808 } |
| 795 list->AddSetRegValueWorkItem(root, version_key, | 809 list->AddSetRegValueWorkItem(root, version_key, |
| 796 google_update::kRegVersionField, | 810 google_update::kRegVersionField, |
| 797 ASCIIToWide(new_version.GetString()), | 811 ASCIIToWide(new_version.GetString()), true, |
| 798 true); // overwrite version | 812 WorkItem::WOW64_32KEY); // overwrite version |
| 799 } | 813 } |
| 800 | 814 |
| 801 // Mirror oeminstall the first time anything is installed multi. There is no | 815 // Mirror oeminstall the first time anything is installed multi. There is no |
| 802 // need to update the value on future install/update runs since this value never | 816 // need to update the value on future install/update runs since this value never |
| 803 // changes. Note that the value is removed by Google Update after EULA | 817 // changes. Note that the value is removed by Google Update after EULA |
| 804 // acceptance is processed. | 818 // acceptance is processed. |
| 805 void AddOemInstallWorkItems(const InstallationState& original_state, | 819 void AddOemInstallWorkItems(const InstallationState& original_state, |
| 806 const InstallerState& installer_state, | 820 const InstallerState& installer_state, |
| 807 WorkItemList* install_list) { | 821 WorkItemList* install_list) { |
| 808 DCHECK(installer_state.is_multi_install()); | 822 DCHECK(installer_state.is_multi_install()); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 827 return; | 841 return; |
| 828 } | 842 } |
| 829 const ProductState* source_product = | 843 const ProductState* source_product = |
| 830 original_state.GetNonVersionedProductState(system_install, source_type); | 844 original_state.GetNonVersionedProductState(system_install, source_type); |
| 831 | 845 |
| 832 base::string16 oem_install; | 846 base::string16 oem_install; |
| 833 if (source_product->GetOemInstall(&oem_install)) { | 847 if (source_product->GetOemInstall(&oem_install)) { |
| 834 VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from " | 848 VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from " |
| 835 << BrowserDistribution::GetSpecificDistribution(source_type)-> | 849 << BrowserDistribution::GetSpecificDistribution(source_type)-> |
| 836 GetDisplayName(); | 850 GetDisplayName(); |
| 837 install_list->AddCreateRegKeyWorkItem(root_key, multi_key); | 851 install_list->AddCreateRegKeyWorkItem( |
| 852 root_key, multi_key, WorkItem::WOW64_32KEY); | |
| 838 // Always overwrite an old value. | 853 // Always overwrite an old value. |
| 839 install_list->AddSetRegValueWorkItem(root_key, multi_key, | 854 install_list->AddSetRegValueWorkItem( |
| 840 google_update::kRegOemInstallField, | 855 root_key, multi_key, google_update::kRegOemInstallField, oem_install, |
| 841 oem_install, true); | 856 true, WorkItem::WOW64_32KEY); |
| 842 } else { | 857 } else { |
| 843 // Clear any old value. | 858 // Clear any old value. |
| 844 install_list->AddDeleteRegValueWorkItem( | 859 install_list->AddDeleteRegValueWorkItem( |
| 845 root_key, multi_key, google_update::kRegOemInstallField); | 860 root_key, multi_key, google_update::kRegOemInstallField, |
| 861 WorkItem::WOW64_32KEY); | |
| 846 } | 862 } |
| 847 } | 863 } |
| 848 } | 864 } |
| 849 | 865 |
| 850 // Mirror eulaaccepted the first time anything is installed multi. There is no | 866 // Mirror eulaaccepted the first time anything is installed multi. There is no |
| 851 // need to update the value on future install/update runs since | 867 // need to update the value on future install/update runs since |
| 852 // GoogleUpdateSettings::SetEULAConsent will modify the value for both the | 868 // GoogleUpdateSettings::SetEULAConsent will modify the value for both the |
| 853 // relevant product and for the binaries. | 869 // relevant product and for the binaries. |
| 854 void AddEulaAcceptedWorkItems(const InstallationState& original_state, | 870 void AddEulaAcceptedWorkItems(const InstallationState& original_state, |
| 855 const InstallerState& installer_state, | 871 const InstallerState& installer_state, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 882 have_eula_accepted = true; | 898 have_eula_accepted = true; |
| 883 eula_accepted = dword_value; | 899 eula_accepted = dword_value; |
| 884 product_type = this_type; | 900 product_type = this_type; |
| 885 } | 901 } |
| 886 } | 902 } |
| 887 | 903 |
| 888 if (have_eula_accepted) { | 904 if (have_eula_accepted) { |
| 889 VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from " | 905 VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from " |
| 890 << BrowserDistribution::GetSpecificDistribution(product_type)-> | 906 << BrowserDistribution::GetSpecificDistribution(product_type)-> |
| 891 GetDisplayName(); | 907 GetDisplayName(); |
| 892 install_list->AddCreateRegKeyWorkItem(root_key, multi_key); | 908 install_list->AddCreateRegKeyWorkItem( |
| 909 root_key, multi_key, WorkItem::WOW64_32KEY); | |
| 893 install_list->AddSetRegValueWorkItem( | 910 install_list->AddSetRegValueWorkItem( |
| 894 root_key, multi_key, google_update::kRegEULAAceptedField, | 911 root_key, multi_key, google_update::kRegEULAAceptedField, |
| 895 eula_accepted, true); | 912 eula_accepted, true, WorkItem::WOW64_32KEY); |
| 896 } else { | 913 } else { |
| 897 // Clear any old value. | 914 // Clear any old value. |
| 898 install_list->AddDeleteRegValueWorkItem( | 915 install_list->AddDeleteRegValueWorkItem( |
| 899 root_key, multi_key, google_update::kRegEULAAceptedField); | 916 root_key, multi_key, google_update::kRegEULAAceptedField, |
| 917 WorkItem::WOW64_32KEY); | |
| 900 } | 918 } |
| 901 } | 919 } |
| 902 } | 920 } |
| 903 | 921 |
| 904 // Adds work items that make registry adjustments for Google Update. | 922 // Adds work items that make registry adjustments for Google Update. |
| 905 void AddGoogleUpdateWorkItems(const InstallationState& original_state, | 923 void AddGoogleUpdateWorkItems(const InstallationState& original_state, |
| 906 const InstallerState& installer_state, | 924 const InstallerState& installer_state, |
| 907 WorkItemList* install_list) { | 925 WorkItemList* install_list) { |
| 908 // Is a multi-install product being installed or over-installed? | 926 // Is a multi-install product being installed or over-installed? |
| 909 if (installer_state.operation() != InstallerState::MULTI_INSTALL && | 927 if (installer_state.operation() != InstallerState::MULTI_INSTALL && |
| 910 installer_state.operation() != InstallerState::MULTI_UPDATE) { | 928 installer_state.operation() != InstallerState::MULTI_UPDATE) { |
| 911 VLOG(1) << "AddGoogleUpdateWorkItems noop: " << installer_state.operation(); | 929 VLOG(1) << "AddGoogleUpdateWorkItems noop: " << installer_state.operation(); |
| 912 return; | 930 return; |
| 913 } | 931 } |
| 914 | 932 |
| 915 const bool system_install = installer_state.system_install(); | 933 const bool system_install = installer_state.system_install(); |
| 916 const HKEY root_key = installer_state.root_key(); | 934 const HKEY root_key = installer_state.root_key(); |
| 917 base::string16 multi_key( | 935 base::string16 multi_key( |
| 918 installer_state.multi_package_binaries_distribution()->GetStateKey()); | 936 installer_state.multi_package_binaries_distribution()->GetStateKey()); |
| 919 | 937 |
| 920 // For system-level installs, make sure the ClientStateMedium key for the | 938 // For system-level installs, make sure the ClientStateMedium key for the |
| 921 // binaries exists. | 939 // binaries exists. |
| 922 if (system_install) { | 940 if (system_install) { |
| 923 install_list->AddCreateRegKeyWorkItem( | 941 install_list->AddCreateRegKeyWorkItem( |
| 924 root_key, | 942 root_key, |
| 925 installer_state.multi_package_binaries_distribution()-> | 943 installer_state.multi_package_binaries_distribution()-> |
| 926 GetStateMediumKey().c_str()); | 944 GetStateMediumKey().c_str(), WorkItem::WOW64_32KEY); |
| 927 } | 945 } |
| 928 | 946 |
| 929 // Creating the ClientState key for binaries, if we're migrating to multi then | 947 // Creating the ClientState key for binaries, if we're migrating to multi then |
| 930 // copy over Chrome's brand code if it has one. | 948 // copy over Chrome's brand code if it has one. |
| 931 if (installer_state.state_type() != BrowserDistribution::CHROME_BINARIES) { | 949 if (installer_state.state_type() != BrowserDistribution::CHROME_BINARIES) { |
| 932 const ProductState* chrome_product_state = | 950 const ProductState* chrome_product_state = |
| 933 original_state.GetNonVersionedProductState( | 951 original_state.GetNonVersionedProductState( |
| 934 system_install, BrowserDistribution::CHROME_BROWSER); | 952 system_install, BrowserDistribution::CHROME_BROWSER); |
| 935 | 953 |
| 936 const base::string16& brand(chrome_product_state->brand()); | 954 const base::string16& brand(chrome_product_state->brand()); |
| 937 if (!brand.empty()) { | 955 if (!brand.empty()) { |
| 938 install_list->AddCreateRegKeyWorkItem(root_key, multi_key); | 956 install_list->AddCreateRegKeyWorkItem(root_key, multi_key, |
| 957 WorkItem::WOW64_32KEY); | |
| 939 // Write Chrome's brand code to the multi key. Never overwrite the value | 958 // Write Chrome's brand code to the multi key. Never overwrite the value |
| 940 // if one is already present (although this shouldn't happen). | 959 // if one is already present (although this shouldn't happen). |
| 941 install_list->AddSetRegValueWorkItem(root_key, | 960 install_list->AddSetRegValueWorkItem(root_key, |
| 942 multi_key, | 961 multi_key, |
| 943 google_update::kRegBrandField, | 962 google_update::kRegBrandField, |
| 944 brand, | 963 brand, |
| 945 false); | 964 false, |
| 965 WorkItem::WOW64_32KEY); | |
| 946 } | 966 } |
| 947 } | 967 } |
| 948 | 968 |
| 949 AddOemInstallWorkItems(original_state, installer_state, install_list); | 969 AddOemInstallWorkItems(original_state, installer_state, install_list); |
| 950 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); | 970 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); |
| 951 AddUsageStatsWorkItems(original_state, installer_state, install_list); | 971 AddUsageStatsWorkItems(original_state, installer_state, install_list); |
| 952 | 972 |
| 953 // TODO(grt): check for other keys/values we should put in the package's | 973 // TODO(grt): check for other keys/values we should put in the package's |
| 954 // ClientState and/or Clients key. | 974 // ClientState and/or Clients key. |
| 955 } | 975 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 975 original_state.GetNonVersionedProductState( | 995 original_state.GetNonVersionedProductState( |
| 976 installer_state.system_install(), dist->GetType()); | 996 installer_state.system_install(), dist->GetType()); |
| 977 value_found = product_state->GetUsageStats(&usagestats); | 997 value_found = product_state->GetUsageStats(&usagestats); |
| 978 } | 998 } |
| 979 | 999 |
| 980 // If a value was found, write it in the appropriate location for the | 1000 // If a value was found, write it in the appropriate location for the |
| 981 // binaries and remove all values from the products. | 1001 // binaries and remove all values from the products. |
| 982 if (value_found) { | 1002 if (value_found) { |
| 983 base::string16 state_key( | 1003 base::string16 state_key( |
| 984 installer_state.multi_package_binaries_distribution()->GetStateKey()); | 1004 installer_state.multi_package_binaries_distribution()->GetStateKey()); |
| 985 install_list->AddCreateRegKeyWorkItem(root_key, state_key); | 1005 install_list->AddCreateRegKeyWorkItem( |
| 1006 root_key, state_key, WorkItem::WOW64_32KEY); | |
| 986 // Overwrite any existing value so that overinstalls (where Omaha writes a | 1007 // Overwrite any existing value so that overinstalls (where Omaha writes a |
| 987 // new value into a product's state key) pick up the correct value. | 1008 // new value into a product's state key) pick up the correct value. |
| 988 install_list->AddSetRegValueWorkItem(root_key, state_key, | 1009 install_list->AddSetRegValueWorkItem(root_key, state_key, |
| 989 google_update::kRegUsageStatsField, | 1010 google_update::kRegUsageStatsField, |
| 990 usagestats, true); | 1011 usagestats, true, |
| 1012 WorkItem::WOW64_32KEY); | |
| 991 | 1013 |
| 992 for (Products::const_iterator scan = products.begin(), end = products.end(); | 1014 for (Products::const_iterator scan = products.begin(), end = products.end(); |
| 993 scan != end; ++scan) { | 1015 scan != end; ++scan) { |
| 994 if ((*scan)->is_chrome_binaries()) | 1016 if ((*scan)->is_chrome_binaries()) |
| 995 continue; | 1017 continue; |
| 996 BrowserDistribution* dist = (*scan)->distribution(); | 1018 BrowserDistribution* dist = (*scan)->distribution(); |
| 997 if (installer_state.system_install()) { | 1019 if (installer_state.system_install()) { |
| 998 install_list->AddDeleteRegValueWorkItem( | 1020 install_list->AddDeleteRegValueWorkItem( |
| 999 root_key, dist->GetStateMediumKey(), | 1021 root_key, dist->GetStateMediumKey(), |
| 1000 google_update::kRegUsageStatsField); | 1022 google_update::kRegUsageStatsField, |
| 1023 WorkItem::WOW64_32KEY); | |
| 1001 // Previous versions of Chrome also wrote a value in HKCU even for | 1024 // Previous versions of Chrome also wrote a value in HKCU even for |
| 1002 // system-level installs, so clean that up. | 1025 // system-level installs, so clean that up. |
| 1003 install_list->AddDeleteRegValueWorkItem( | 1026 install_list->AddDeleteRegValueWorkItem( |
| 1004 HKEY_CURRENT_USER, dist->GetStateKey(), | 1027 HKEY_CURRENT_USER, dist->GetStateKey(), |
| 1005 google_update::kRegUsageStatsField); | 1028 google_update::kRegUsageStatsField, |
| 1029 WorkItem::WOW64_32KEY); | |
| 1006 } | 1030 } |
| 1007 install_list->AddDeleteRegValueWorkItem( | 1031 install_list->AddDeleteRegValueWorkItem( |
| 1008 root_key, dist->GetStateKey(), google_update::kRegUsageStatsField); | 1032 root_key, dist->GetStateKey(), google_update::kRegUsageStatsField, |
| 1033 WorkItem::WOW64_32KEY); | |
| 1009 } | 1034 } |
| 1010 } | 1035 } |
| 1011 } | 1036 } |
| 1012 | 1037 |
| 1013 bool AppendPostInstallTasks(const InstallerState& installer_state, | 1038 bool AppendPostInstallTasks(const InstallerState& installer_state, |
| 1014 const base::FilePath& setup_path, | 1039 const base::FilePath& setup_path, |
| 1015 const Version* current_version, | 1040 const Version* current_version, |
| 1016 const Version& new_version, | 1041 const Version& new_version, |
| 1017 const base::FilePath& temp_path, | 1042 const base::FilePath& temp_path, |
| 1018 WorkItemList* post_install_task_list) { | 1043 WorkItemList* post_install_task_list) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1050 rename.AppendSwitch(switches::kVerboseLogging); | 1075 rename.AppendSwitch(switches::kVerboseLogging); |
| 1051 | 1076 |
| 1052 base::string16 version_key; | 1077 base::string16 version_key; |
| 1053 for (size_t i = 0; i < products.size(); ++i) { | 1078 for (size_t i = 0; i < products.size(); ++i) { |
| 1054 BrowserDistribution* dist = products[i]->distribution(); | 1079 BrowserDistribution* dist = products[i]->distribution(); |
| 1055 version_key = dist->GetVersionKey(); | 1080 version_key = dist->GetVersionKey(); |
| 1056 | 1081 |
| 1057 if (current_version) { | 1082 if (current_version) { |
| 1058 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, | 1083 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, |
| 1059 google_update::kRegOldVersionField, | 1084 google_update::kRegOldVersionField, |
| 1060 ASCIIToWide(current_version->GetString()), true); | 1085 ASCIIToWide(current_version->GetString()), true, |
| 1086 WorkItem::WOW64_32KEY); | |
| 1061 } | 1087 } |
| 1062 if (critical_version.IsValid()) { | 1088 if (critical_version.IsValid()) { |
| 1063 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, | 1089 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, |
| 1064 google_update::kRegCriticalVersionField, | 1090 google_update::kRegCriticalVersionField, |
| 1065 ASCIIToWide(critical_version.GetString()), true); | 1091 ASCIIToWide(critical_version.GetString()), true, |
| 1092 WorkItem::WOW64_32KEY); | |
| 1066 } else { | 1093 } else { |
| 1067 in_use_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1094 in_use_update_work_items->AddDeleteRegValueWorkItem(root, version_key, |
| 1068 google_update::kRegCriticalVersionField); | 1095 google_update::kRegCriticalVersionField, WorkItem::WOW64_32KEY); |
| 1069 } | 1096 } |
| 1070 | 1097 |
| 1071 // Adding this registry entry for all products (but the binaries) is | 1098 // Adding this registry entry for all products (but the binaries) is |
| 1072 // overkill. However, as it stands, we don't have a way to know which | 1099 // overkill. However, as it stands, we don't have a way to know which |
| 1073 // product will check the key and run the command, so we add it for all. | 1100 // product will check the key and run the command, so we add it for all. |
| 1074 // The first to run it will perform the operation and clean up the other | 1101 // The first to run it will perform the operation and clean up the other |
| 1075 // values. | 1102 // values. |
| 1076 if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) { | 1103 if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) { |
| 1077 CommandLine product_rename_cmd(rename); | 1104 CommandLine product_rename_cmd(rename); |
| 1078 products[i]->AppendRenameFlags(&product_rename_cmd); | 1105 products[i]->AppendRenameFlags(&product_rename_cmd); |
| 1079 in_use_update_work_items->AddSetRegValueWorkItem( | 1106 in_use_update_work_items->AddSetRegValueWorkItem( |
| 1080 root, version_key, google_update::kRegRenameCmdField, | 1107 root, version_key, google_update::kRegRenameCmdField, |
| 1081 product_rename_cmd.GetCommandLineString(), true); | 1108 product_rename_cmd.GetCommandLineString(), true, |
| 1109 WorkItem::WOW64_32KEY); | |
| 1082 } | 1110 } |
| 1083 } | 1111 } |
| 1084 | 1112 |
| 1085 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); | 1113 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); |
| 1086 } | 1114 } |
| 1087 | 1115 |
| 1088 // Append work items that will be executed if this was NOT an in-use update. | 1116 // Append work items that will be executed if this was NOT an in-use update. |
| 1089 { | 1117 { |
| 1090 scoped_ptr<WorkItemList> regular_update_work_items( | 1118 scoped_ptr<WorkItemList> regular_update_work_items( |
| 1091 WorkItem::CreateConditionalWorkItemList( | 1119 WorkItem::CreateConditionalWorkItemList( |
| 1092 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); | 1120 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); |
| 1093 regular_update_work_items->set_log_message("RegularUpdateWorkItemList"); | 1121 regular_update_work_items->set_log_message("RegularUpdateWorkItemList"); |
| 1094 | 1122 |
| 1095 // Since this was not an in-use-update, delete 'opv', 'cpv', and 'cmd' keys. | 1123 // Since this was not an in-use-update, delete 'opv', 'cpv', and 'cmd' keys. |
| 1096 for (size_t i = 0; i < products.size(); ++i) { | 1124 for (size_t i = 0; i < products.size(); ++i) { |
| 1097 BrowserDistribution* dist = products[i]->distribution(); | 1125 BrowserDistribution* dist = products[i]->distribution(); |
| 1098 base::string16 version_key(dist->GetVersionKey()); | 1126 base::string16 version_key(dist->GetVersionKey()); |
| 1099 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1127 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, |
| 1100 google_update::kRegOldVersionField); | 1128 google_update::kRegOldVersionField, WorkItem::WOW64_32KEY); |
| 1101 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1129 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, |
| 1102 google_update::kRegCriticalVersionField); | 1130 google_update::kRegCriticalVersionField, WorkItem::WOW64_32KEY); |
| 1103 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1131 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, |
| 1104 google_update::kRegRenameCmdField); | 1132 google_update::kRegRenameCmdField, WorkItem::WOW64_32KEY); |
| 1105 } | 1133 } |
| 1106 | 1134 |
| 1107 post_install_task_list->AddWorkItem(regular_update_work_items.release()); | 1135 post_install_task_list->AddWorkItem(regular_update_work_items.release()); |
| 1108 } | 1136 } |
| 1109 | 1137 |
| 1110 AddRegisterComDllWorkItemsForPackage(installer_state, current_version, | 1138 AddRegisterComDllWorkItemsForPackage(installer_state, current_version, |
| 1111 new_version, post_install_task_list); | 1139 new_version, post_install_task_list); |
| 1112 | 1140 |
| 1113 // If we're told that we're an MSI install, make sure to set the marker | 1141 // If we're told that we're an MSI install, make sure to set the marker |
| 1114 // in the client state key so that future updates do the right thing. | 1142 // in the client state key so that future updates do the right thing. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1257 } | 1285 } |
| 1258 | 1286 |
| 1259 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, | 1287 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, |
| 1260 BrowserDistribution* dist, | 1288 BrowserDistribution* dist, |
| 1261 bool set, | 1289 bool set, |
| 1262 WorkItemList* work_item_list) { | 1290 WorkItemList* work_item_list) { |
| 1263 DCHECK(work_item_list); | 1291 DCHECK(work_item_list); |
| 1264 DWORD msi_value = set ? 1 : 0; | 1292 DWORD msi_value = set ? 1 : 0; |
| 1265 WorkItem* set_msi_work_item = work_item_list->AddSetRegValueWorkItem( | 1293 WorkItem* set_msi_work_item = work_item_list->AddSetRegValueWorkItem( |
| 1266 installer_state.root_key(), dist->GetStateKey(), | 1294 installer_state.root_key(), dist->GetStateKey(), |
| 1267 google_update::kRegMSIField, msi_value, true); | 1295 google_update::kRegMSIField, msi_value, true, WorkItem::WOW64_32KEY); |
| 1268 DCHECK(set_msi_work_item); | 1296 DCHECK(set_msi_work_item); |
| 1269 set_msi_work_item->set_ignore_failure(true); | 1297 set_msi_work_item->set_ignore_failure(true); |
| 1270 set_msi_work_item->set_log_message("Could not write MSI marker!"); | 1298 set_msi_work_item->set_log_message("Could not write MSI marker!"); |
| 1271 } | 1299 } |
| 1272 | 1300 |
| 1273 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, | 1301 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, |
| 1274 const base::FilePath& target_path, | 1302 const base::FilePath& target_path, |
| 1275 const Version& new_version, | 1303 const Version& new_version, |
| 1276 const Product& product, | 1304 const Product& product, |
| 1277 WorkItemList* list) { | 1305 WorkItemList* list) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 base::FilePath delegate_execute(target_path); | 1338 base::FilePath delegate_execute(target_path); |
| 1311 if (new_version.IsValid()) | 1339 if (new_version.IsValid()) |
| 1312 delegate_execute = delegate_execute.AppendASCII(new_version.GetString()); | 1340 delegate_execute = delegate_execute.AppendASCII(new_version.GetString()); |
| 1313 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); | 1341 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); |
| 1314 | 1342 |
| 1315 // Command-line featuring the quoted path to the exe. | 1343 // Command-line featuring the quoted path to the exe. |
| 1316 base::string16 command(1, L'"'); | 1344 base::string16 command(1, L'"'); |
| 1317 command.append(delegate_execute.value()).append(1, L'"'); | 1345 command.append(delegate_execute.value()).append(1, L'"'); |
| 1318 | 1346 |
| 1319 // Register the CommandExecuteImpl class in Software\Classes\CLSID\... | 1347 // Register the CommandExecuteImpl class in Software\Classes\CLSID\... |
| 1320 list->AddCreateRegKeyWorkItem(root, delegate_execute_path); | 1348 list->AddCreateRegKeyWorkItem(root, delegate_execute_path, |
| 1349 WorkItem::WOW64_32KEY); | |
| 1321 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", | 1350 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", |
| 1322 L"CommandExecuteImpl Class", true); | 1351 L"CommandExecuteImpl Class", true, WorkItem::WOW64_32KEY); |
| 1323 base::string16 subkey(delegate_execute_path); | 1352 base::string16 subkey(delegate_execute_path); |
| 1324 subkey.append(L"\\LocalServer32"); | 1353 subkey.append(L"\\LocalServer32"); |
| 1325 list->AddCreateRegKeyWorkItem(root, subkey); | 1354 list->AddCreateRegKeyWorkItem(root, subkey, WorkItem::WOW64_32KEY); |
| 1326 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); | 1355 list->AddSetRegValueWorkItem( |
| 1356 root, subkey, L"", command, true, WorkItem::WOW64_32KEY); | |
| 1327 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", | 1357 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", |
| 1328 delegate_execute.value(), true); | 1358 delegate_execute.value(), true, WorkItem::WOW64_32KEY); |
| 1329 | 1359 |
| 1330 subkey.assign(delegate_execute_path).append(L"\\Programmable"); | 1360 subkey.assign(delegate_execute_path).append(L"\\Programmable"); |
| 1331 list->AddCreateRegKeyWorkItem(root, subkey); | 1361 list->AddCreateRegKeyWorkItem(root, subkey, WorkItem::WOW64_32KEY); |
| 1332 } | 1362 } |
| 1333 } | 1363 } |
| 1334 | 1364 |
| 1335 void AddActiveSetupWorkItems(const InstallerState& installer_state, | 1365 void AddActiveSetupWorkItems(const InstallerState& installer_state, |
| 1336 const base::FilePath& setup_path, | 1366 const base::FilePath& setup_path, |
| 1337 const Version& new_version, | 1367 const Version& new_version, |
| 1338 const Product& product, | 1368 const Product& product, |
| 1339 WorkItemList* list) { | 1369 WorkItemList* list) { |
| 1340 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); | 1370 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); |
| 1341 BrowserDistribution* dist = product.distribution(); | 1371 BrowserDistribution* dist = product.distribution(); |
| 1342 | 1372 |
| 1343 if (!product.is_chrome() || !installer_state.system_install()) { | 1373 if (!product.is_chrome() || !installer_state.system_install()) { |
| 1344 const char* install_level = | 1374 const char* install_level = |
| 1345 installer_state.system_install() ? "system" : "user"; | 1375 installer_state.system_install() ? "system" : "user"; |
| 1346 VLOG(1) << "No Active Setup processing to do for " << install_level | 1376 VLOG(1) << "No Active Setup processing to do for " << install_level |
| 1347 << "-level " << dist->GetDisplayName(); | 1377 << "-level " << dist->GetDisplayName(); |
| 1348 return; | 1378 return; |
| 1349 } | 1379 } |
| 1350 DCHECK(installer_state.RequiresActiveSetup()); | 1380 DCHECK(installer_state.RequiresActiveSetup()); |
| 1351 | 1381 |
| 1352 const HKEY root = HKEY_LOCAL_MACHINE; | 1382 const HKEY root = HKEY_LOCAL_MACHINE; |
| 1353 const base::string16 active_setup_path(InstallUtil::GetActiveSetupPath(dist)); | 1383 const base::string16 active_setup_path(InstallUtil::GetActiveSetupPath(dist)); |
| 1354 | 1384 |
| 1355 VLOG(1) << "Adding registration items for Active Setup."; | 1385 VLOG(1) << "Adding registration items for Active Setup."; |
| 1356 list->AddCreateRegKeyWorkItem(root, active_setup_path); | 1386 list->AddCreateRegKeyWorkItem(root, active_setup_path, |
| 1387 WorkItem::WOW64_DEFAULT); | |
| 1357 list->AddSetRegValueWorkItem(root, active_setup_path, L"", | 1388 list->AddSetRegValueWorkItem(root, active_setup_path, L"", |
| 1358 dist->GetDisplayName(), true); | 1389 dist->GetDisplayName(), true, WorkItem::WOW64_DEFAULT); |
| 1359 | 1390 |
| 1360 base::FilePath active_setup_exe(installer_state.GetInstallerDirectory( | 1391 base::FilePath active_setup_exe(installer_state.GetInstallerDirectory( |
| 1361 new_version).Append(kActiveSetupExe)); | 1392 new_version).Append(kActiveSetupExe)); |
| 1362 CommandLine cmd(active_setup_exe); | 1393 CommandLine cmd(active_setup_exe); |
| 1363 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); | 1394 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); |
| 1364 cmd.AppendSwitch(installer::switches::kVerboseLogging); | 1395 cmd.AppendSwitch(installer::switches::kVerboseLogging); |
| 1365 cmd.AppendSwitch(installer::switches::kSystemLevel); | 1396 cmd.AppendSwitch(installer::switches::kSystemLevel); |
| 1366 product.AppendProductFlags(&cmd); | 1397 product.AppendProductFlags(&cmd); |
| 1367 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", | 1398 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", |
| 1368 cmd.GetCommandLineString(), true); | 1399 cmd.GetCommandLineString(), true, WorkItem::WOW64_DEFAULT); |
| 1369 | 1400 |
| 1370 // TODO(grt): http://crbug.com/75152 Write a reference to a localized | 1401 // TODO(grt): http://crbug.com/75152 Write a reference to a localized |
| 1371 // resource. | 1402 // resource. |
| 1372 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", | 1403 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", |
| 1373 dist->GetDisplayName(), true); | 1404 dist->GetDisplayName(), true, WorkItem::WOW64_DEFAULT); |
| 1374 | 1405 |
| 1375 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", | 1406 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", |
| 1376 static_cast<DWORD>(1U), true); | 1407 static_cast<DWORD>(1U), true, WorkItem::WOW64_DEFAULT); |
| 1377 | 1408 |
| 1378 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", | 1409 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", |
| 1379 kActiveSetupVersion, true); | 1410 kActiveSetupVersion, true, WorkItem::WOW64_DEFAULT); |
| 1380 } | 1411 } |
| 1381 | 1412 |
| 1382 void AddDeleteOldIELowRightsPolicyWorkItems( | 1413 void AddDeleteOldIELowRightsPolicyWorkItems( |
| 1383 const InstallerState& installer_state, | 1414 const InstallerState& installer_state, |
| 1384 WorkItemList* install_list) { | 1415 WorkItemList* install_list) { |
| 1385 DCHECK(install_list); | 1416 DCHECK(install_list); |
| 1386 | 1417 |
| 1387 base::string16 key_path; | 1418 base::string16 key_path; |
| 1388 GetOldIELowRightsElevationPolicyKeyPath(&key_path); | 1419 GetOldIELowRightsElevationPolicyKeyPath(&key_path); |
| 1389 install_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), key_path); | 1420 install_list->AddDeleteRegKeyWorkItem( |
| 1421 installer_state.root_key(), key_path, WorkItem::WOW64_DEFAULT); | |
| 1390 } | 1422 } |
| 1391 | 1423 |
| 1392 void AppendUninstallCommandLineFlags(const InstallerState& installer_state, | 1424 void AppendUninstallCommandLineFlags(const InstallerState& installer_state, |
| 1393 const Product& product, | 1425 const Product& product, |
| 1394 CommandLine* uninstall_cmd) { | 1426 CommandLine* uninstall_cmd) { |
| 1395 DCHECK(uninstall_cmd); | 1427 DCHECK(uninstall_cmd); |
| 1396 | 1428 |
| 1397 uninstall_cmd->AppendSwitch(installer::switches::kUninstall); | 1429 uninstall_cmd->AppendSwitch(installer::switches::kUninstall); |
| 1398 | 1430 |
| 1399 // Append the product-specific uninstall flags. | 1431 // Append the product-specific uninstall flags. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1431 void AddOsUpgradeWorkItems(const InstallerState& installer_state, | 1463 void AddOsUpgradeWorkItems(const InstallerState& installer_state, |
| 1432 const base::FilePath& setup_path, | 1464 const base::FilePath& setup_path, |
| 1433 const Version& new_version, | 1465 const Version& new_version, |
| 1434 const Product& product, | 1466 const Product& product, |
| 1435 WorkItemList* install_list) { | 1467 WorkItemList* install_list) { |
| 1436 const HKEY root_key = installer_state.root_key(); | 1468 const HKEY root_key = installer_state.root_key(); |
| 1437 base::string16 cmd_key( | 1469 base::string16 cmd_key( |
| 1438 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade)); | 1470 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade)); |
| 1439 | 1471 |
| 1440 if (installer_state.operation() == InstallerState::UNINSTALL) { | 1472 if (installer_state.operation() == InstallerState::UNINSTALL) { |
| 1441 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> | 1473 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, |
| 1442 set_log_message("Removing OS upgrade command"); | 1474 WorkItem::WOW64_DEFAULT)-> |
| 1475 set_log_message("Removing OS upgrade command"); | |
| 1443 } else { | 1476 } else { |
| 1444 // Register with Google Update to have setup.exe --on-os-upgrade called on | 1477 // Register with Google Update to have setup.exe --on-os-upgrade called on |
| 1445 // OS upgrade. | 1478 // OS upgrade. |
| 1446 CommandLine cmd_line(installer_state | 1479 CommandLine cmd_line(installer_state |
| 1447 .GetInstallerDirectory(new_version) | 1480 .GetInstallerDirectory(new_version) |
| 1448 .Append(setup_path.BaseName())); | 1481 .Append(setup_path.BaseName())); |
| 1449 // Add the main option to indicate OS upgrade flow. | 1482 // Add the main option to indicate OS upgrade flow. |
| 1450 cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); | 1483 cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); |
| 1451 // Add product-specific options. | 1484 // Add product-specific options. |
| 1452 product.AppendProductFlags(&cmd_line); | 1485 product.AppendProductFlags(&cmd_line); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1463 | 1496 |
| 1464 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, | 1497 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, |
| 1465 const base::FilePath& setup_path, | 1498 const base::FilePath& setup_path, |
| 1466 const Version& new_version, | 1499 const Version& new_version, |
| 1467 const Product& product, | 1500 const Product& product, |
| 1468 WorkItemList* work_item_list) { | 1501 WorkItemList* work_item_list) { |
| 1469 const HKEY root_key = installer_state.root_key(); | 1502 const HKEY root_key = installer_state.root_key(); |
| 1470 base::string16 cmd_key( | 1503 base::string16 cmd_key( |
| 1471 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance)); | 1504 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance)); |
| 1472 if (installer_state.operation() == InstallerState::UNINSTALL) { | 1505 if (installer_state.operation() == InstallerState::UNINSTALL) { |
| 1473 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> | 1506 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, |
| 1474 set_log_message("Removing query EULA acceptance command"); | 1507 WorkItem::WOW64_32KEY)-> |
| 1508 set_log_message("Removing query EULA acceptance command"); | |
| 1475 } else { | 1509 } else { |
| 1476 CommandLine cmd_line(installer_state | 1510 CommandLine cmd_line(installer_state |
| 1477 .GetInstallerDirectory(new_version) | 1511 .GetInstallerDirectory(new_version) |
| 1478 .Append(setup_path.BaseName())); | 1512 .Append(setup_path.BaseName())); |
| 1479 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); | 1513 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); |
| 1480 if (installer_state.system_install()) | 1514 if (installer_state.system_install()) |
| 1481 cmd_line.AppendSwitch(installer::switches::kSystemLevel); | 1515 cmd_line.AppendSwitch(installer::switches::kSystemLevel); |
| 1482 if (installer_state.verbose_logging()) | 1516 if (installer_state.verbose_logging()) |
| 1483 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); | 1517 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); |
| 1484 AppCommand cmd(cmd_line.GetCommandLineString()); | 1518 AppCommand cmd(cmd_line.GetCommandLineString()); |
| 1485 cmd.set_is_web_accessible(true); | 1519 cmd.set_is_web_accessible(true); |
| 1486 cmd.set_is_run_as_user(true); | 1520 cmd.set_is_run_as_user(true); |
| 1487 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); | 1521 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); |
| 1488 } | 1522 } |
| 1489 } | 1523 } |
| 1490 | 1524 |
| 1491 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, | 1525 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, |
| 1492 WorkItemList* work_item_list) { | 1526 WorkItemList* work_item_list) { |
| 1493 DCHECK(work_item_list); | 1527 DCHECK(work_item_list); |
| 1494 | 1528 |
| 1495 base::string16 cmd_key( | 1529 base::string16 cmd_key( |
| 1496 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( | 1530 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( |
| 1497 BrowserDistribution::CHROME_BINARIES), | 1531 BrowserDistribution::CHROME_BINARIES), |
| 1498 kCmdQuickEnableCf)); | 1532 kCmdQuickEnableCf)); |
| 1499 | 1533 |
| 1500 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1534 // Unconditionally remove the legacy Quick Enable command from the binaries. |
| 1501 // Do this even if multi-install Chrome isn't installed to ensure that it is | 1535 // Do this even if multi-install Chrome isn't installed to ensure that it is |
| 1502 // not left behind in any case. | 1536 // not left behind in any case. |
| 1503 work_item_list->AddDeleteRegKeyWorkItem( | 1537 work_item_list->AddDeleteRegKeyWorkItem( |
| 1504 installer_state.root_key(), cmd_key)->set_log_message( | 1538 installer_state.root_key(), cmd_key, WorkItem::WOW64_32KEY) |
| 1505 "removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + " command"); | 1539 ->set_log_message( |
| 1540 "removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + " command"); | |
| 1506 | 1541 |
| 1507 } | 1542 } |
| 1508 | 1543 |
| 1509 } // namespace installer | 1544 } // namespace installer |
| OLD | NEW |