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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 WorkItemList* work_item_list) { | 207 WorkItemList* work_item_list) { |
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(installer_state.root_key(), |
218 installer_state.root_key(), full_cmd_key)->set_log_message( | 218 full_cmd_key, |
219 "removing " + base::UTF16ToASCII(command_key) + " command"); | 219 WorkItem::kWow64Default) |
| 220 ->set_log_message("removing " + base::UTF16ToASCII(command_key) + |
| 221 " command"); |
220 } else { | 222 } else { |
221 CommandLine cmd_line(installer_state.target_path().Append(app)); | 223 CommandLine cmd_line(installer_state.target_path().Append(app)); |
222 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); | 224 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); |
223 | 225 |
224 AppCommand cmd(cmd_line.GetCommandLineString()); | 226 AppCommand cmd(cmd_line.GetCommandLineString()); |
225 cmd.set_sends_pings(true); | 227 cmd.set_sends_pings(true); |
226 cmd.set_is_web_accessible(true); | 228 cmd.set_is_web_accessible(true); |
227 cmd.set_is_run_as_user(true); | 229 cmd.set_is_run_as_user(true); |
228 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); | 230 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); |
229 } | 231 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 const base::FilePath& temp_path, | 435 const base::FilePath& temp_path, |
434 WorkItemList* work_item_list) { | 436 WorkItemList* work_item_list) { |
435 DCHECK(installer_state.is_msi()) | 437 DCHECK(installer_state.is_msi()) |
436 << "This must only be called for MSI installations!"; | 438 << "This must only be called for MSI installations!"; |
437 | 439 |
438 // First attempt to delete the old installation's ARP dialog entry. | 440 // First attempt to delete the old installation's ARP dialog entry. |
439 HKEY reg_root = installer_state.root_key(); | 441 HKEY reg_root = installer_state.root_key(); |
440 base::string16 uninstall_reg(product.distribution()->GetUninstallRegPath()); | 442 base::string16 uninstall_reg(product.distribution()->GetUninstallRegPath()); |
441 | 443 |
442 WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem( | 444 WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem( |
443 reg_root, uninstall_reg); | 445 reg_root, uninstall_reg, WorkItem::kWow64Default); |
444 delete_reg_key->set_ignore_failure(true); | 446 delete_reg_key->set_ignore_failure(true); |
445 | 447 |
446 // Then attempt to delete the old installation's start menu shortcut. | 448 // Then attempt to delete the old installation's start menu shortcut. |
447 base::FilePath uninstall_link; | 449 base::FilePath uninstall_link; |
448 if (installer_state.system_install()) { | 450 if (installer_state.system_install()) { |
449 PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link); | 451 PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link); |
450 } else { | 452 } else { |
451 PathService::Get(base::DIR_START_MENU, &uninstall_link); | 453 PathService::Get(base::DIR_START_MENU, &uninstall_link); |
452 } | 454 } |
453 | 455 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 | 604 |
603 return true; | 605 return true; |
604 } | 606 } |
605 | 607 |
606 void AddUninstallDelegateExecuteWorkItems( | 608 void AddUninstallDelegateExecuteWorkItems( |
607 HKEY root, | 609 HKEY root, |
608 const base::string16& delegate_execute_path, | 610 const base::string16& delegate_execute_path, |
609 WorkItemList* list) { | 611 WorkItemList* list) { |
610 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler in " | 612 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler in " |
611 << root; | 613 << root; |
612 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); | 614 list->AddDeleteRegKeyWorkItem(root, |
| 615 delegate_execute_path, |
| 616 WorkItem::kWow64Default); |
613 | 617 |
614 // In the past, the ICommandExecuteImpl interface and a TypeLib were both | 618 // In the past, the ICommandExecuteImpl interface and a TypeLib were both |
615 // registered. Remove these since this operation may be updating a machine | 619 // registered. Remove these since this operation may be updating a machine |
616 // that had the old registrations. | 620 // that had the old registrations. |
617 list->AddDeleteRegKeyWorkItem(root, | 621 list->AddDeleteRegKeyWorkItem(root, |
618 L"Software\\Classes\\Interface\\" | 622 L"Software\\Classes\\Interface\\" |
619 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}"); | 623 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}", |
| 624 WorkItem::kWow64Default); |
620 list->AddDeleteRegKeyWorkItem(root, | 625 list->AddDeleteRegKeyWorkItem(root, |
621 L"Software\\Classes\\TypeLib\\" | 626 L"Software\\Classes\\TypeLib\\" |
622 #if defined(GOOGLE_CHROME_BUILD) | 627 #if defined(GOOGLE_CHROME_BUILD) |
623 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}" | 628 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}", |
624 #else | 629 #else |
625 L"{7779FB70-B399-454A-AA1A-BAA850032B10}" | 630 L"{7779FB70-B399-454A-AA1A-BAA850032B10}", |
626 #endif | 631 #endif |
627 ); | 632 WorkItem::kWow64Default); |
628 } | 633 } |
629 | 634 |
630 // Google Chrome Canary, between 20.0.1101.0 (crrev.com/132190) and 20.0.1106.0 | 635 // 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 | 636 // (exclusively -- crrev.com/132596), registered a DelegateExecute class by |
632 // mistake (with the same GUID as Chrome). The fix stopped registering the bad | 637 // 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 | 638 // 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 | 639 // 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 | 640 // 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 | 641 // 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|). | 642 // 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()); | 691 base::FilePath install_path(installer_state.target_path()); |
687 base::FilePath installer_path( | 692 base::FilePath installer_path( |
688 installer_state.GetInstallerDirectory(new_version)); | 693 installer_state.GetInstallerDirectory(new_version)); |
689 installer_path = installer_path.Append(setup_path.BaseName()); | 694 installer_path = installer_path.Append(setup_path.BaseName()); |
690 | 695 |
691 CommandLine uninstall_arguments(CommandLine::NO_PROGRAM); | 696 CommandLine uninstall_arguments(CommandLine::NO_PROGRAM); |
692 AppendUninstallCommandLineFlags(installer_state, product, | 697 AppendUninstallCommandLineFlags(installer_state, product, |
693 &uninstall_arguments); | 698 &uninstall_arguments); |
694 | 699 |
695 base::string16 update_state_key(browser_dist->GetStateKey()); | 700 base::string16 update_state_key(browser_dist->GetStateKey()); |
696 install_list->AddCreateRegKeyWorkItem(reg_root, update_state_key); | 701 install_list->AddCreateRegKeyWorkItem( |
697 install_list->AddSetRegValueWorkItem(reg_root, update_state_key, | 702 reg_root, update_state_key, WorkItem::kWow64Default); |
698 installer::kUninstallStringField, installer_path.value(), true); | 703 install_list->AddSetRegValueWorkItem(reg_root, |
699 install_list->AddSetRegValueWorkItem(reg_root, update_state_key, | 704 update_state_key, |
| 705 WorkItem::kWow64Default, |
| 706 installer::kUninstallStringField, |
| 707 installer_path.value(), |
| 708 true); |
| 709 install_list->AddSetRegValueWorkItem( |
| 710 reg_root, |
| 711 update_state_key, |
| 712 WorkItem::kWow64Default, |
700 installer::kUninstallArgumentsField, | 713 installer::kUninstallArgumentsField, |
701 uninstall_arguments.GetCommandLineString(), true); | 714 uninstall_arguments.GetCommandLineString(), |
| 715 true); |
702 | 716 |
703 // MSI installations will manage their own uninstall shortcuts. | 717 // MSI installations will manage their own uninstall shortcuts. |
704 if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) { | 718 if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) { |
705 // We need to quote the command line for the Add/Remove Programs dialog. | 719 // We need to quote the command line for the Add/Remove Programs dialog. |
706 CommandLine quoted_uninstall_cmd(installer_path); | 720 CommandLine quoted_uninstall_cmd(installer_path); |
707 DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"'); | 721 DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"'); |
708 quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false); | 722 quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false); |
709 | 723 |
710 base::string16 uninstall_reg = browser_dist->GetUninstallRegPath(); | 724 base::string16 uninstall_reg = browser_dist->GetUninstallRegPath(); |
711 install_list->AddCreateRegKeyWorkItem(reg_root, uninstall_reg); | 725 install_list->AddCreateRegKeyWorkItem( |
712 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 726 reg_root, uninstall_reg, WorkItem::kWow64Default); |
713 installer::kUninstallDisplayNameField, browser_dist->GetDisplayName(), | 727 install_list->AddSetRegValueWorkItem(reg_root, |
| 728 uninstall_reg, |
| 729 WorkItem::kWow64Default, |
| 730 installer::kUninstallDisplayNameField, |
| 731 browser_dist->GetDisplayName(), |
| 732 true); |
| 733 install_list->AddSetRegValueWorkItem( |
| 734 reg_root, |
| 735 uninstall_reg, |
| 736 WorkItem::kWow64Default, |
| 737 installer::kUninstallStringField, |
| 738 quoted_uninstall_cmd.GetCommandLineString(), |
714 true); | 739 true); |
715 install_list->AddSetRegValueWorkItem(reg_root, | 740 install_list->AddSetRegValueWorkItem(reg_root, |
716 uninstall_reg, installer::kUninstallStringField, | |
717 quoted_uninstall_cmd.GetCommandLineString(), true); | |
718 install_list->AddSetRegValueWorkItem(reg_root, | |
719 uninstall_reg, | 741 uninstall_reg, |
| 742 WorkItem::kWow64Default, |
720 L"InstallLocation", | 743 L"InstallLocation", |
721 install_path.value(), | 744 install_path.value(), |
722 true); | 745 true); |
723 | 746 |
724 BrowserDistribution* dist = product.distribution(); | 747 BrowserDistribution* dist = product.distribution(); |
725 base::string16 chrome_icon = ShellUtil::FormatIconLocation( | 748 base::string16 chrome_icon = ShellUtil::FormatIconLocation( |
726 install_path.Append(dist->GetIconFilename()).value(), | 749 install_path.Append(dist->GetIconFilename()).value(), |
727 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME)); | 750 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME)); |
728 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 751 install_list->AddSetRegValueWorkItem(reg_root, |
729 L"DisplayIcon", chrome_icon, true); | 752 uninstall_reg, |
730 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 753 WorkItem::kWow64Default, |
731 L"NoModify", static_cast<DWORD>(1), | 754 L"DisplayIcon", |
| 755 chrome_icon, |
732 true); | 756 true); |
733 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 757 install_list->AddSetRegValueWorkItem(reg_root, |
734 L"NoRepair", static_cast<DWORD>(1), | 758 uninstall_reg, |
| 759 WorkItem::kWow64Default, |
| 760 L"NoModify", |
| 761 static_cast<DWORD>(1), |
| 762 true); |
| 763 install_list->AddSetRegValueWorkItem(reg_root, |
| 764 uninstall_reg, |
| 765 WorkItem::kWow64Default, |
| 766 L"NoRepair", |
| 767 static_cast<DWORD>(1), |
735 true); | 768 true); |
736 | 769 |
737 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 770 install_list->AddSetRegValueWorkItem(reg_root, |
| 771 uninstall_reg, |
| 772 WorkItem::kWow64Default, |
738 L"Publisher", | 773 L"Publisher", |
739 browser_dist->GetPublisherName(), | 774 browser_dist->GetPublisherName(), |
740 true); | 775 true); |
741 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 776 install_list->AddSetRegValueWorkItem(reg_root, |
| 777 uninstall_reg, |
| 778 WorkItem::kWow64Default, |
742 L"Version", | 779 L"Version", |
743 ASCIIToWide(new_version.GetString()), | 780 ASCIIToWide(new_version.GetString()), |
744 true); | 781 true); |
745 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 782 install_list->AddSetRegValueWorkItem(reg_root, |
| 783 uninstall_reg, |
| 784 WorkItem::kWow64Default, |
746 L"DisplayVersion", | 785 L"DisplayVersion", |
747 ASCIIToWide(new_version.GetString()), | 786 ASCIIToWide(new_version.GetString()), |
748 true); | 787 true); |
749 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 788 install_list->AddSetRegValueWorkItem(reg_root, |
| 789 uninstall_reg, |
| 790 WorkItem::kWow64Default, |
750 L"InstallDate", | 791 L"InstallDate", |
751 InstallUtil::GetCurrentDate(), | 792 InstallUtil::GetCurrentDate(), |
752 false); | 793 false); |
753 | 794 |
754 const std::vector<uint16>& version_components = new_version.components(); | 795 const std::vector<uint16>& version_components = new_version.components(); |
755 if (version_components.size() == 4) { | 796 if (version_components.size() == 4) { |
756 // Our version should be in major.minor.build.rev. | 797 // Our version should be in major.minor.build.rev. |
757 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 798 install_list->AddSetRegValueWorkItem( |
758 L"VersionMajor", static_cast<DWORD>(version_components[2]), true); | 799 reg_root, |
759 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 800 uninstall_reg, |
760 L"VersionMinor", static_cast<DWORD>(version_components[3]), true); | 801 WorkItem::kWow64Default, |
| 802 L"VersionMajor", |
| 803 static_cast<DWORD>(version_components[2]), |
| 804 true); |
| 805 install_list->AddSetRegValueWorkItem( |
| 806 reg_root, |
| 807 uninstall_reg, |
| 808 WorkItem::kWow64Default, |
| 809 L"VersionMinor", |
| 810 static_cast<DWORD>(version_components[3]), |
| 811 true); |
761 } | 812 } |
762 } | 813 } |
763 } | 814 } |
764 | 815 |
765 // Create Version key for a product (if not already present) and sets the new | 816 // Create Version key for a product (if not already present) and sets the new |
766 // product version as the last step. | 817 // product version as the last step. |
767 void AddVersionKeyWorkItems(HKEY root, | 818 void AddVersionKeyWorkItems(HKEY root, |
768 BrowserDistribution* dist, | 819 BrowserDistribution* dist, |
769 const Version& new_version, | 820 const Version& new_version, |
770 bool add_language_identifier, | 821 bool add_language_identifier, |
771 WorkItemList* list) { | 822 WorkItemList* list) { |
772 // Create Version key for each distribution (if not already present) and set | 823 // Create Version key for each distribution (if not already present) and set |
773 // the new product version as the last step. | 824 // the new product version as the last step. |
774 base::string16 version_key(dist->GetVersionKey()); | 825 base::string16 version_key(dist->GetVersionKey()); |
775 list->AddCreateRegKeyWorkItem(root, version_key); | 826 list->AddCreateRegKeyWorkItem(root, version_key, WorkItem::kWow64Default); |
776 | 827 |
777 base::string16 product_name(dist->GetDisplayName()); | 828 base::string16 product_name(dist->GetDisplayName()); |
778 list->AddSetRegValueWorkItem(root, version_key, google_update::kRegNameField, | 829 list->AddSetRegValueWorkItem(root, |
779 product_name, true); // overwrite name also | 830 version_key, |
780 list->AddSetRegValueWorkItem(root, version_key, | 831 WorkItem::kWow64Default, |
| 832 google_update::kRegNameField, |
| 833 product_name, |
| 834 true); // overwrite name also |
| 835 list->AddSetRegValueWorkItem(root, |
| 836 version_key, |
| 837 WorkItem::kWow64Default, |
781 google_update::kRegOopcrashesField, | 838 google_update::kRegOopcrashesField, |
782 static_cast<DWORD>(1), | 839 static_cast<DWORD>(1), |
783 false); // set during first install | 840 false); // set during first install |
784 if (add_language_identifier) { | 841 if (add_language_identifier) { |
785 // Write the language identifier of the current translation. Omaha's set of | 842 // 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 | 843 // languages is a superset of Chrome's set of translations with this one |
787 // exception: what Chrome calls "en-us", Omaha calls "en". sigh. | 844 // exception: what Chrome calls "en-us", Omaha calls "en". sigh. |
788 base::string16 language(GetCurrentTranslation()); | 845 base::string16 language(GetCurrentTranslation()); |
789 if (LowerCaseEqualsASCII(language, "en-us")) | 846 if (LowerCaseEqualsASCII(language, "en-us")) |
790 language.resize(2); | 847 language.resize(2); |
791 list->AddSetRegValueWorkItem(root, version_key, | 848 list->AddSetRegValueWorkItem(root, |
792 google_update::kRegLangField, language, | 849 version_key, |
| 850 WorkItem::kWow64Default, |
| 851 google_update::kRegLangField, |
| 852 language, |
793 false); // do not overwrite language | 853 false); // do not overwrite language |
794 } | 854 } |
795 list->AddSetRegValueWorkItem(root, version_key, | 855 list->AddSetRegValueWorkItem(root, |
| 856 version_key, |
| 857 WorkItem::kWow64Default, |
796 google_update::kRegVersionField, | 858 google_update::kRegVersionField, |
797 ASCIIToWide(new_version.GetString()), | 859 ASCIIToWide(new_version.GetString()), |
798 true); // overwrite version | 860 true); // overwrite version |
799 } | 861 } |
800 | 862 |
801 // Mirror oeminstall the first time anything is installed multi. There is no | 863 // 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 | 864 // 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 | 865 // changes. Note that the value is removed by Google Update after EULA |
804 // acceptance is processed. | 866 // acceptance is processed. |
805 void AddOemInstallWorkItems(const InstallationState& original_state, | 867 void AddOemInstallWorkItems(const InstallationState& original_state, |
(...skipping 21 matching lines...) Expand all Loading... |
827 return; | 889 return; |
828 } | 890 } |
829 const ProductState* source_product = | 891 const ProductState* source_product = |
830 original_state.GetNonVersionedProductState(system_install, source_type); | 892 original_state.GetNonVersionedProductState(system_install, source_type); |
831 | 893 |
832 base::string16 oem_install; | 894 base::string16 oem_install; |
833 if (source_product->GetOemInstall(&oem_install)) { | 895 if (source_product->GetOemInstall(&oem_install)) { |
834 VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from " | 896 VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from " |
835 << BrowserDistribution::GetSpecificDistribution(source_type)-> | 897 << BrowserDistribution::GetSpecificDistribution(source_type)-> |
836 GetDisplayName(); | 898 GetDisplayName(); |
837 install_list->AddCreateRegKeyWorkItem(root_key, multi_key); | 899 install_list->AddCreateRegKeyWorkItem( |
| 900 root_key, multi_key, WorkItem::kWow64Default); |
838 // Always overwrite an old value. | 901 // Always overwrite an old value. |
839 install_list->AddSetRegValueWorkItem(root_key, multi_key, | 902 install_list->AddSetRegValueWorkItem(root_key, |
| 903 multi_key, |
| 904 WorkItem::kWow64Default, |
840 google_update::kRegOemInstallField, | 905 google_update::kRegOemInstallField, |
841 oem_install, true); | 906 oem_install, |
| 907 true); |
842 } else { | 908 } else { |
843 // Clear any old value. | 909 // Clear any old value. |
844 install_list->AddDeleteRegValueWorkItem( | 910 install_list->AddDeleteRegValueWorkItem( |
845 root_key, multi_key, google_update::kRegOemInstallField); | 911 root_key, |
| 912 multi_key, |
| 913 WorkItem::kWow64Default, |
| 914 google_update::kRegOemInstallField); |
846 } | 915 } |
847 } | 916 } |
848 } | 917 } |
849 | 918 |
850 // Mirror eulaaccepted the first time anything is installed multi. There is no | 919 // Mirror eulaaccepted the first time anything is installed multi. There is no |
851 // need to update the value on future install/update runs since | 920 // need to update the value on future install/update runs since |
852 // GoogleUpdateSettings::SetEULAConsent will modify the value for both the | 921 // GoogleUpdateSettings::SetEULAConsent will modify the value for both the |
853 // relevant product and for the binaries. | 922 // relevant product and for the binaries. |
854 void AddEulaAcceptedWorkItems(const InstallationState& original_state, | 923 void AddEulaAcceptedWorkItems(const InstallationState& original_state, |
855 const InstallerState& installer_state, | 924 const InstallerState& installer_state, |
(...skipping 26 matching lines...) Expand all Loading... |
882 have_eula_accepted = true; | 951 have_eula_accepted = true; |
883 eula_accepted = dword_value; | 952 eula_accepted = dword_value; |
884 product_type = this_type; | 953 product_type = this_type; |
885 } | 954 } |
886 } | 955 } |
887 | 956 |
888 if (have_eula_accepted) { | 957 if (have_eula_accepted) { |
889 VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from " | 958 VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from " |
890 << BrowserDistribution::GetSpecificDistribution(product_type)-> | 959 << BrowserDistribution::GetSpecificDistribution(product_type)-> |
891 GetDisplayName(); | 960 GetDisplayName(); |
892 install_list->AddCreateRegKeyWorkItem(root_key, multi_key); | 961 install_list->AddCreateRegKeyWorkItem( |
893 install_list->AddSetRegValueWorkItem( | 962 root_key, multi_key, WorkItem::kWow64Default); |
894 root_key, multi_key, google_update::kRegEULAAceptedField, | 963 install_list->AddSetRegValueWorkItem(root_key, |
895 eula_accepted, true); | 964 multi_key, |
| 965 WorkItem::kWow64Default, |
| 966 google_update::kRegEULAAceptedField, |
| 967 eula_accepted, |
| 968 true); |
896 } else { | 969 } else { |
897 // Clear any old value. | 970 // Clear any old value. |
898 install_list->AddDeleteRegValueWorkItem( | 971 install_list->AddDeleteRegValueWorkItem( |
899 root_key, multi_key, google_update::kRegEULAAceptedField); | 972 root_key, |
| 973 multi_key, |
| 974 WorkItem::kWow64Default, |
| 975 google_update::kRegEULAAceptedField); |
900 } | 976 } |
901 } | 977 } |
902 } | 978 } |
903 | 979 |
904 // Adds work items that make registry adjustments for Google Update. | 980 // Adds work items that make registry adjustments for Google Update. |
905 void AddGoogleUpdateWorkItems(const InstallationState& original_state, | 981 void AddGoogleUpdateWorkItems(const InstallationState& original_state, |
906 const InstallerState& installer_state, | 982 const InstallerState& installer_state, |
907 WorkItemList* install_list) { | 983 WorkItemList* install_list) { |
908 // Is a multi-install product being installed or over-installed? | 984 // Is a multi-install product being installed or over-installed? |
909 if (installer_state.operation() != InstallerState::MULTI_INSTALL && | 985 if (installer_state.operation() != InstallerState::MULTI_INSTALL && |
910 installer_state.operation() != InstallerState::MULTI_UPDATE) { | 986 installer_state.operation() != InstallerState::MULTI_UPDATE) { |
911 VLOG(1) << "AddGoogleUpdateWorkItems noop: " << installer_state.operation(); | 987 VLOG(1) << "AddGoogleUpdateWorkItems noop: " << installer_state.operation(); |
912 return; | 988 return; |
913 } | 989 } |
914 | 990 |
915 const bool system_install = installer_state.system_install(); | 991 const bool system_install = installer_state.system_install(); |
916 const HKEY root_key = installer_state.root_key(); | 992 const HKEY root_key = installer_state.root_key(); |
917 base::string16 multi_key( | 993 base::string16 multi_key( |
918 installer_state.multi_package_binaries_distribution()->GetStateKey()); | 994 installer_state.multi_package_binaries_distribution()->GetStateKey()); |
919 | 995 |
920 // For system-level installs, make sure the ClientStateMedium key for the | 996 // For system-level installs, make sure the ClientStateMedium key for the |
921 // binaries exists. | 997 // binaries exists. |
922 if (system_install) { | 998 if (system_install) { |
923 install_list->AddCreateRegKeyWorkItem( | 999 install_list->AddCreateRegKeyWorkItem( |
924 root_key, | 1000 root_key, |
925 installer_state.multi_package_binaries_distribution()-> | 1001 installer_state.multi_package_binaries_distribution() |
926 GetStateMediumKey().c_str()); | 1002 ->GetStateMediumKey().c_str(), |
| 1003 WorkItem::kWow64Default); |
927 } | 1004 } |
928 | 1005 |
929 // Creating the ClientState key for binaries, if we're migrating to multi then | 1006 // Creating the ClientState key for binaries, if we're migrating to multi then |
930 // copy over Chrome's brand code if it has one. | 1007 // copy over Chrome's brand code if it has one. |
931 if (installer_state.state_type() != BrowserDistribution::CHROME_BINARIES) { | 1008 if (installer_state.state_type() != BrowserDistribution::CHROME_BINARIES) { |
932 const ProductState* chrome_product_state = | 1009 const ProductState* chrome_product_state = |
933 original_state.GetNonVersionedProductState( | 1010 original_state.GetNonVersionedProductState( |
934 system_install, BrowserDistribution::CHROME_BROWSER); | 1011 system_install, BrowserDistribution::CHROME_BROWSER); |
935 | 1012 |
936 const base::string16& brand(chrome_product_state->brand()); | 1013 const base::string16& brand(chrome_product_state->brand()); |
937 if (!brand.empty()) { | 1014 if (!brand.empty()) { |
938 install_list->AddCreateRegKeyWorkItem(root_key, multi_key); | 1015 install_list->AddCreateRegKeyWorkItem( |
| 1016 root_key, multi_key, WorkItem::kWow64Default); |
939 // Write Chrome's brand code to the multi key. Never overwrite the value | 1017 // Write Chrome's brand code to the multi key. Never overwrite the value |
940 // if one is already present (although this shouldn't happen). | 1018 // if one is already present (although this shouldn't happen). |
941 install_list->AddSetRegValueWorkItem(root_key, | 1019 install_list->AddSetRegValueWorkItem(root_key, |
942 multi_key, | 1020 multi_key, |
| 1021 WorkItem::kWow64Default, |
943 google_update::kRegBrandField, | 1022 google_update::kRegBrandField, |
944 brand, | 1023 brand, |
945 false); | 1024 false); |
946 } | 1025 } |
947 } | 1026 } |
948 | 1027 |
949 AddOemInstallWorkItems(original_state, installer_state, install_list); | 1028 AddOemInstallWorkItems(original_state, installer_state, install_list); |
950 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); | 1029 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); |
951 AddUsageStatsWorkItems(original_state, installer_state, install_list); | 1030 AddUsageStatsWorkItems(original_state, installer_state, install_list); |
952 | 1031 |
(...skipping 22 matching lines...) Expand all Loading... |
975 original_state.GetNonVersionedProductState( | 1054 original_state.GetNonVersionedProductState( |
976 installer_state.system_install(), dist->GetType()); | 1055 installer_state.system_install(), dist->GetType()); |
977 value_found = product_state->GetUsageStats(&usagestats); | 1056 value_found = product_state->GetUsageStats(&usagestats); |
978 } | 1057 } |
979 | 1058 |
980 // If a value was found, write it in the appropriate location for the | 1059 // If a value was found, write it in the appropriate location for the |
981 // binaries and remove all values from the products. | 1060 // binaries and remove all values from the products. |
982 if (value_found) { | 1061 if (value_found) { |
983 base::string16 state_key( | 1062 base::string16 state_key( |
984 installer_state.multi_package_binaries_distribution()->GetStateKey()); | 1063 installer_state.multi_package_binaries_distribution()->GetStateKey()); |
985 install_list->AddCreateRegKeyWorkItem(root_key, state_key); | 1064 install_list->AddCreateRegKeyWorkItem( |
| 1065 root_key, state_key, WorkItem::kWow64Default); |
986 // Overwrite any existing value so that overinstalls (where Omaha writes a | 1066 // 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. | 1067 // new value into a product's state key) pick up the correct value. |
988 install_list->AddSetRegValueWorkItem(root_key, state_key, | 1068 install_list->AddSetRegValueWorkItem(root_key, |
| 1069 state_key, |
| 1070 WorkItem::kWow64Default, |
989 google_update::kRegUsageStatsField, | 1071 google_update::kRegUsageStatsField, |
990 usagestats, true); | 1072 usagestats, |
| 1073 true); |
991 | 1074 |
992 for (Products::const_iterator scan = products.begin(), end = products.end(); | 1075 for (Products::const_iterator scan = products.begin(), end = products.end(); |
993 scan != end; ++scan) { | 1076 scan != end; ++scan) { |
994 if ((*scan)->is_chrome_binaries()) | 1077 if ((*scan)->is_chrome_binaries()) |
995 continue; | 1078 continue; |
996 BrowserDistribution* dist = (*scan)->distribution(); | 1079 BrowserDistribution* dist = (*scan)->distribution(); |
997 if (installer_state.system_install()) { | 1080 if (installer_state.system_install()) { |
998 install_list->AddDeleteRegValueWorkItem( | 1081 install_list->AddDeleteRegValueWorkItem( |
999 root_key, dist->GetStateMediumKey(), | 1082 root_key, |
| 1083 dist->GetStateMediumKey(), |
| 1084 WorkItem::kWow64Default, |
1000 google_update::kRegUsageStatsField); | 1085 google_update::kRegUsageStatsField); |
1001 // Previous versions of Chrome also wrote a value in HKCU even for | 1086 // Previous versions of Chrome also wrote a value in HKCU even for |
1002 // system-level installs, so clean that up. | 1087 // system-level installs, so clean that up. |
1003 install_list->AddDeleteRegValueWorkItem( | 1088 install_list->AddDeleteRegValueWorkItem( |
1004 HKEY_CURRENT_USER, dist->GetStateKey(), | 1089 HKEY_CURRENT_USER, |
| 1090 dist->GetStateKey(), |
| 1091 WorkItem::kWow64Default, |
1005 google_update::kRegUsageStatsField); | 1092 google_update::kRegUsageStatsField); |
1006 } | 1093 } |
1007 install_list->AddDeleteRegValueWorkItem( | 1094 install_list->AddDeleteRegValueWorkItem( |
1008 root_key, dist->GetStateKey(), google_update::kRegUsageStatsField); | 1095 root_key, |
| 1096 dist->GetStateKey(), |
| 1097 WorkItem::kWow64Default, |
| 1098 google_update::kRegUsageStatsField); |
1009 } | 1099 } |
1010 } | 1100 } |
1011 } | 1101 } |
1012 | 1102 |
1013 bool AppendPostInstallTasks(const InstallerState& installer_state, | 1103 bool AppendPostInstallTasks(const InstallerState& installer_state, |
1014 const base::FilePath& setup_path, | 1104 const base::FilePath& setup_path, |
1015 const Version* current_version, | 1105 const Version* current_version, |
1016 const Version& new_version, | 1106 const Version& new_version, |
1017 const base::FilePath& temp_path, | 1107 const base::FilePath& temp_path, |
1018 WorkItemList* post_install_task_list) { | 1108 WorkItemList* post_install_task_list) { |
(...skipping 29 matching lines...) Expand all Loading... |
1048 | 1138 |
1049 if (installer_state.verbose_logging()) | 1139 if (installer_state.verbose_logging()) |
1050 rename.AppendSwitch(switches::kVerboseLogging); | 1140 rename.AppendSwitch(switches::kVerboseLogging); |
1051 | 1141 |
1052 base::string16 version_key; | 1142 base::string16 version_key; |
1053 for (size_t i = 0; i < products.size(); ++i) { | 1143 for (size_t i = 0; i < products.size(); ++i) { |
1054 BrowserDistribution* dist = products[i]->distribution(); | 1144 BrowserDistribution* dist = products[i]->distribution(); |
1055 version_key = dist->GetVersionKey(); | 1145 version_key = dist->GetVersionKey(); |
1056 | 1146 |
1057 if (current_version) { | 1147 if (current_version) { |
1058 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, | 1148 in_use_update_work_items->AddSetRegValueWorkItem( |
| 1149 root, |
| 1150 version_key, |
| 1151 WorkItem::kWow64Default, |
1059 google_update::kRegOldVersionField, | 1152 google_update::kRegOldVersionField, |
1060 ASCIIToWide(current_version->GetString()), true); | 1153 ASCIIToWide(current_version->GetString()), |
| 1154 true); |
1061 } | 1155 } |
1062 if (critical_version.IsValid()) { | 1156 if (critical_version.IsValid()) { |
1063 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, | 1157 in_use_update_work_items->AddSetRegValueWorkItem( |
| 1158 root, |
| 1159 version_key, |
| 1160 WorkItem::kWow64Default, |
1064 google_update::kRegCriticalVersionField, | 1161 google_update::kRegCriticalVersionField, |
1065 ASCIIToWide(critical_version.GetString()), true); | 1162 ASCIIToWide(critical_version.GetString()), |
| 1163 true); |
1066 } else { | 1164 } else { |
1067 in_use_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1165 in_use_update_work_items->AddDeleteRegValueWorkItem( |
| 1166 root, |
| 1167 version_key, |
| 1168 WorkItem::kWow64Default, |
1068 google_update::kRegCriticalVersionField); | 1169 google_update::kRegCriticalVersionField); |
1069 } | 1170 } |
1070 | 1171 |
1071 // Adding this registry entry for all products (but the binaries) is | 1172 // 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 | 1173 // 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. | 1174 // 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 | 1175 // The first to run it will perform the operation and clean up the other |
1075 // values. | 1176 // values. |
1076 if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) { | 1177 if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) { |
1077 CommandLine product_rename_cmd(rename); | 1178 CommandLine product_rename_cmd(rename); |
1078 products[i]->AppendRenameFlags(&product_rename_cmd); | 1179 products[i]->AppendRenameFlags(&product_rename_cmd); |
1079 in_use_update_work_items->AddSetRegValueWorkItem( | 1180 in_use_update_work_items->AddSetRegValueWorkItem( |
1080 root, version_key, google_update::kRegRenameCmdField, | 1181 root, |
1081 product_rename_cmd.GetCommandLineString(), true); | 1182 version_key, |
| 1183 WorkItem::kWow64Default, |
| 1184 google_update::kRegRenameCmdField, |
| 1185 product_rename_cmd.GetCommandLineString(), |
| 1186 true); |
1082 } | 1187 } |
1083 } | 1188 } |
1084 | 1189 |
1085 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); | 1190 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); |
1086 } | 1191 } |
1087 | 1192 |
1088 // Append work items that will be executed if this was NOT an in-use update. | 1193 // Append work items that will be executed if this was NOT an in-use update. |
1089 { | 1194 { |
1090 scoped_ptr<WorkItemList> regular_update_work_items( | 1195 scoped_ptr<WorkItemList> regular_update_work_items( |
1091 WorkItem::CreateConditionalWorkItemList( | 1196 WorkItem::CreateConditionalWorkItemList( |
1092 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); | 1197 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); |
1093 regular_update_work_items->set_log_message("RegularUpdateWorkItemList"); | 1198 regular_update_work_items->set_log_message("RegularUpdateWorkItemList"); |
1094 | 1199 |
1095 // Since this was not an in-use-update, delete 'opv', 'cpv', and 'cmd' keys. | 1200 // Since this was not an in-use-update, delete 'opv', 'cpv', and 'cmd' keys. |
1096 for (size_t i = 0; i < products.size(); ++i) { | 1201 for (size_t i = 0; i < products.size(); ++i) { |
1097 BrowserDistribution* dist = products[i]->distribution(); | 1202 BrowserDistribution* dist = products[i]->distribution(); |
1098 base::string16 version_key(dist->GetVersionKey()); | 1203 base::string16 version_key(dist->GetVersionKey()); |
1099 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1204 regular_update_work_items->AddDeleteRegValueWorkItem( |
| 1205 root, |
| 1206 version_key, |
| 1207 WorkItem::kWow64Default, |
1100 google_update::kRegOldVersionField); | 1208 google_update::kRegOldVersionField); |
1101 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1209 regular_update_work_items->AddDeleteRegValueWorkItem( |
| 1210 root, |
| 1211 version_key, |
| 1212 WorkItem::kWow64Default, |
1102 google_update::kRegCriticalVersionField); | 1213 google_update::kRegCriticalVersionField); |
1103 regular_update_work_items->AddDeleteRegValueWorkItem(root, version_key, | 1214 regular_update_work_items->AddDeleteRegValueWorkItem( |
| 1215 root, |
| 1216 version_key, |
| 1217 WorkItem::kWow64Default, |
1104 google_update::kRegRenameCmdField); | 1218 google_update::kRegRenameCmdField); |
1105 } | 1219 } |
1106 | 1220 |
1107 post_install_task_list->AddWorkItem(regular_update_work_items.release()); | 1221 post_install_task_list->AddWorkItem(regular_update_work_items.release()); |
1108 } | 1222 } |
1109 | 1223 |
1110 AddRegisterComDllWorkItemsForPackage(installer_state, current_version, | 1224 AddRegisterComDllWorkItemsForPackage(installer_state, current_version, |
1111 new_version, post_install_task_list); | 1225 new_version, post_install_task_list); |
1112 | 1226 |
1113 // If we're told that we're an MSI install, make sure to set the marker | 1227 // If we're told that we're an MSI install, make sure to set the marker |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 } | 1369 } |
1256 } | 1370 } |
1257 } | 1371 } |
1258 | 1372 |
1259 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, | 1373 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, |
1260 BrowserDistribution* dist, | 1374 BrowserDistribution* dist, |
1261 bool set, | 1375 bool set, |
1262 WorkItemList* work_item_list) { | 1376 WorkItemList* work_item_list) { |
1263 DCHECK(work_item_list); | 1377 DCHECK(work_item_list); |
1264 DWORD msi_value = set ? 1 : 0; | 1378 DWORD msi_value = set ? 1 : 0; |
1265 WorkItem* set_msi_work_item = work_item_list->AddSetRegValueWorkItem( | 1379 WorkItem* set_msi_work_item = |
1266 installer_state.root_key(), dist->GetStateKey(), | 1380 work_item_list->AddSetRegValueWorkItem(installer_state.root_key(), |
1267 google_update::kRegMSIField, msi_value, true); | 1381 dist->GetStateKey(), |
| 1382 WorkItem::kWow64Default, |
| 1383 google_update::kRegMSIField, |
| 1384 msi_value, |
| 1385 true); |
1268 DCHECK(set_msi_work_item); | 1386 DCHECK(set_msi_work_item); |
1269 set_msi_work_item->set_ignore_failure(true); | 1387 set_msi_work_item->set_ignore_failure(true); |
1270 set_msi_work_item->set_log_message("Could not write MSI marker!"); | 1388 set_msi_work_item->set_log_message("Could not write MSI marker!"); |
1271 } | 1389 } |
1272 | 1390 |
1273 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, | 1391 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, |
1274 const base::FilePath& target_path, | 1392 const base::FilePath& target_path, |
1275 const Version& new_version, | 1393 const Version& new_version, |
1276 const Product& product, | 1394 const Product& product, |
1277 WorkItemList* list) { | 1395 WorkItemList* list) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 base::FilePath delegate_execute(target_path); | 1428 base::FilePath delegate_execute(target_path); |
1311 if (new_version.IsValid()) | 1429 if (new_version.IsValid()) |
1312 delegate_execute = delegate_execute.AppendASCII(new_version.GetString()); | 1430 delegate_execute = delegate_execute.AppendASCII(new_version.GetString()); |
1313 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); | 1431 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); |
1314 | 1432 |
1315 // Command-line featuring the quoted path to the exe. | 1433 // Command-line featuring the quoted path to the exe. |
1316 base::string16 command(1, L'"'); | 1434 base::string16 command(1, L'"'); |
1317 command.append(delegate_execute.value()).append(1, L'"'); | 1435 command.append(delegate_execute.value()).append(1, L'"'); |
1318 | 1436 |
1319 // Register the CommandExecuteImpl class in Software\Classes\CLSID\... | 1437 // Register the CommandExecuteImpl class in Software\Classes\CLSID\... |
1320 list->AddCreateRegKeyWorkItem(root, delegate_execute_path); | 1438 list->AddCreateRegKeyWorkItem( |
1321 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", | 1439 root, delegate_execute_path, WorkItem::kWow64Default); |
1322 L"CommandExecuteImpl Class", true); | 1440 list->AddSetRegValueWorkItem(root, |
| 1441 delegate_execute_path, |
| 1442 WorkItem::kWow64Default, |
| 1443 L"", |
| 1444 L"CommandExecuteImpl Class", |
| 1445 true); |
1323 base::string16 subkey(delegate_execute_path); | 1446 base::string16 subkey(delegate_execute_path); |
1324 subkey.append(L"\\LocalServer32"); | 1447 subkey.append(L"\\LocalServer32"); |
1325 list->AddCreateRegKeyWorkItem(root, subkey); | 1448 list->AddCreateRegKeyWorkItem(root, subkey, WorkItem::kWow64Default); |
1326 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); | 1449 list->AddSetRegValueWorkItem( |
1327 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", | 1450 root, subkey, WorkItem::kWow64Default, L"", command, true); |
1328 delegate_execute.value(), true); | 1451 list->AddSetRegValueWorkItem(root, |
| 1452 subkey, |
| 1453 WorkItem::kWow64Default, |
| 1454 L"ServerExecutable", |
| 1455 delegate_execute.value(), |
| 1456 true); |
1329 | 1457 |
1330 subkey.assign(delegate_execute_path).append(L"\\Programmable"); | 1458 subkey.assign(delegate_execute_path).append(L"\\Programmable"); |
1331 list->AddCreateRegKeyWorkItem(root, subkey); | 1459 list->AddCreateRegKeyWorkItem(root, subkey, WorkItem::kWow64Default); |
1332 } | 1460 } |
1333 } | 1461 } |
1334 | 1462 |
1335 void AddActiveSetupWorkItems(const InstallerState& installer_state, | 1463 void AddActiveSetupWorkItems(const InstallerState& installer_state, |
1336 const base::FilePath& setup_path, | 1464 const base::FilePath& setup_path, |
1337 const Version& new_version, | 1465 const Version& new_version, |
1338 const Product& product, | 1466 const Product& product, |
1339 WorkItemList* list) { | 1467 WorkItemList* list) { |
1340 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); | 1468 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); |
1341 BrowserDistribution* dist = product.distribution(); | 1469 BrowserDistribution* dist = product.distribution(); |
1342 | 1470 |
1343 if (!product.is_chrome() || !installer_state.system_install()) { | 1471 if (!product.is_chrome() || !installer_state.system_install()) { |
1344 const char* install_level = | 1472 const char* install_level = |
1345 installer_state.system_install() ? "system" : "user"; | 1473 installer_state.system_install() ? "system" : "user"; |
1346 VLOG(1) << "No Active Setup processing to do for " << install_level | 1474 VLOG(1) << "No Active Setup processing to do for " << install_level |
1347 << "-level " << dist->GetDisplayName(); | 1475 << "-level " << dist->GetDisplayName(); |
1348 return; | 1476 return; |
1349 } | 1477 } |
1350 DCHECK(installer_state.RequiresActiveSetup()); | 1478 DCHECK(installer_state.RequiresActiveSetup()); |
1351 | 1479 |
1352 const HKEY root = HKEY_LOCAL_MACHINE; | 1480 const HKEY root = HKEY_LOCAL_MACHINE; |
1353 const base::string16 active_setup_path(InstallUtil::GetActiveSetupPath(dist)); | 1481 const base::string16 active_setup_path(InstallUtil::GetActiveSetupPath(dist)); |
1354 | 1482 |
1355 VLOG(1) << "Adding registration items for Active Setup."; | 1483 VLOG(1) << "Adding registration items for Active Setup."; |
1356 list->AddCreateRegKeyWorkItem(root, active_setup_path); | 1484 list->AddCreateRegKeyWorkItem( |
1357 list->AddSetRegValueWorkItem(root, active_setup_path, L"", | 1485 root, active_setup_path, WorkItem::kWow64Default); |
1358 dist->GetDisplayName(), true); | 1486 list->AddSetRegValueWorkItem(root, |
| 1487 active_setup_path, |
| 1488 WorkItem::kWow64Default, |
| 1489 L"", |
| 1490 dist->GetDisplayName(), |
| 1491 true); |
1359 | 1492 |
1360 base::FilePath active_setup_exe(installer_state.GetInstallerDirectory( | 1493 base::FilePath active_setup_exe(installer_state.GetInstallerDirectory( |
1361 new_version).Append(kActiveSetupExe)); | 1494 new_version).Append(kActiveSetupExe)); |
1362 CommandLine cmd(active_setup_exe); | 1495 CommandLine cmd(active_setup_exe); |
1363 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); | 1496 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); |
1364 cmd.AppendSwitch(installer::switches::kVerboseLogging); | 1497 cmd.AppendSwitch(installer::switches::kVerboseLogging); |
1365 cmd.AppendSwitch(installer::switches::kSystemLevel); | 1498 cmd.AppendSwitch(installer::switches::kSystemLevel); |
1366 product.AppendProductFlags(&cmd); | 1499 product.AppendProductFlags(&cmd); |
1367 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", | 1500 list->AddSetRegValueWorkItem(root, |
1368 cmd.GetCommandLineString(), true); | 1501 active_setup_path, |
| 1502 WorkItem::kWow64Default, |
| 1503 L"StubPath", |
| 1504 cmd.GetCommandLineString(), |
| 1505 true); |
1369 | 1506 |
1370 // TODO(grt): http://crbug.com/75152 Write a reference to a localized | 1507 // TODO(grt): http://crbug.com/75152 Write a reference to a localized |
1371 // resource. | 1508 // resource. |
1372 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", | 1509 list->AddSetRegValueWorkItem(root, |
1373 dist->GetDisplayName(), true); | 1510 active_setup_path, |
| 1511 WorkItem::kWow64Default, |
| 1512 L"Localized Name", |
| 1513 dist->GetDisplayName(), |
| 1514 true); |
1374 | 1515 |
1375 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", | 1516 list->AddSetRegValueWorkItem(root, |
1376 static_cast<DWORD>(1U), true); | 1517 active_setup_path, |
| 1518 WorkItem::kWow64Default, |
| 1519 L"IsInstalled", |
| 1520 static_cast<DWORD>(1U), |
| 1521 true); |
1377 | 1522 |
1378 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", | 1523 list->AddSetRegValueWorkItem(root, |
1379 kActiveSetupVersion, true); | 1524 active_setup_path, |
| 1525 WorkItem::kWow64Default, |
| 1526 L"Version", |
| 1527 kActiveSetupVersion, |
| 1528 true); |
1380 } | 1529 } |
1381 | 1530 |
1382 void AddDeleteOldIELowRightsPolicyWorkItems( | 1531 void AddDeleteOldIELowRightsPolicyWorkItems( |
1383 const InstallerState& installer_state, | 1532 const InstallerState& installer_state, |
1384 WorkItemList* install_list) { | 1533 WorkItemList* install_list) { |
1385 DCHECK(install_list); | 1534 DCHECK(install_list); |
1386 | 1535 |
1387 base::string16 key_path; | 1536 base::string16 key_path; |
1388 GetOldIELowRightsElevationPolicyKeyPath(&key_path); | 1537 GetOldIELowRightsElevationPolicyKeyPath(&key_path); |
1389 install_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), key_path); | 1538 install_list->AddDeleteRegKeyWorkItem( |
| 1539 installer_state.root_key(), key_path, WorkItem::kWow64Default); |
1390 } | 1540 } |
1391 | 1541 |
1392 void AppendUninstallCommandLineFlags(const InstallerState& installer_state, | 1542 void AppendUninstallCommandLineFlags(const InstallerState& installer_state, |
1393 const Product& product, | 1543 const Product& product, |
1394 CommandLine* uninstall_cmd) { | 1544 CommandLine* uninstall_cmd) { |
1395 DCHECK(uninstall_cmd); | 1545 DCHECK(uninstall_cmd); |
1396 | 1546 |
1397 uninstall_cmd->AppendSwitch(installer::switches::kUninstall); | 1547 uninstall_cmd->AppendSwitch(installer::switches::kUninstall); |
1398 | 1548 |
1399 // Append the product-specific uninstall flags. | 1549 // 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, | 1581 void AddOsUpgradeWorkItems(const InstallerState& installer_state, |
1432 const base::FilePath& setup_path, | 1582 const base::FilePath& setup_path, |
1433 const Version& new_version, | 1583 const Version& new_version, |
1434 const Product& product, | 1584 const Product& product, |
1435 WorkItemList* install_list) { | 1585 WorkItemList* install_list) { |
1436 const HKEY root_key = installer_state.root_key(); | 1586 const HKEY root_key = installer_state.root_key(); |
1437 base::string16 cmd_key( | 1587 base::string16 cmd_key( |
1438 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade)); | 1588 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade)); |
1439 | 1589 |
1440 if (installer_state.operation() == InstallerState::UNINSTALL) { | 1590 if (installer_state.operation() == InstallerState::UNINSTALL) { |
1441 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> | 1591 install_list->AddDeleteRegKeyWorkItem( |
1442 set_log_message("Removing OS upgrade command"); | 1592 root_key, cmd_key, WorkItem::kWow64Default) |
| 1593 ->set_log_message("Removing OS upgrade command"); |
1443 } else { | 1594 } else { |
1444 // Register with Google Update to have setup.exe --on-os-upgrade called on | 1595 // Register with Google Update to have setup.exe --on-os-upgrade called on |
1445 // OS upgrade. | 1596 // OS upgrade. |
1446 CommandLine cmd_line(installer_state | 1597 CommandLine cmd_line(installer_state |
1447 .GetInstallerDirectory(new_version) | 1598 .GetInstallerDirectory(new_version) |
1448 .Append(setup_path.BaseName())); | 1599 .Append(setup_path.BaseName())); |
1449 // Add the main option to indicate OS upgrade flow. | 1600 // Add the main option to indicate OS upgrade flow. |
1450 cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); | 1601 cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); |
1451 // Add product-specific options. | 1602 // Add product-specific options. |
1452 product.AppendProductFlags(&cmd_line); | 1603 product.AppendProductFlags(&cmd_line); |
(...skipping 10 matching lines...) Expand all Loading... |
1463 | 1614 |
1464 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, | 1615 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, |
1465 const base::FilePath& setup_path, | 1616 const base::FilePath& setup_path, |
1466 const Version& new_version, | 1617 const Version& new_version, |
1467 const Product& product, | 1618 const Product& product, |
1468 WorkItemList* work_item_list) { | 1619 WorkItemList* work_item_list) { |
1469 const HKEY root_key = installer_state.root_key(); | 1620 const HKEY root_key = installer_state.root_key(); |
1470 base::string16 cmd_key( | 1621 base::string16 cmd_key( |
1471 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance)); | 1622 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance)); |
1472 if (installer_state.operation() == InstallerState::UNINSTALL) { | 1623 if (installer_state.operation() == InstallerState::UNINSTALL) { |
1473 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> | 1624 work_item_list->AddDeleteRegKeyWorkItem( |
1474 set_log_message("Removing query EULA acceptance command"); | 1625 root_key, cmd_key, WorkItem::kWow64Default) |
| 1626 ->set_log_message("Removing query EULA acceptance command"); |
1475 } else { | 1627 } else { |
1476 CommandLine cmd_line(installer_state | 1628 CommandLine cmd_line(installer_state |
1477 .GetInstallerDirectory(new_version) | 1629 .GetInstallerDirectory(new_version) |
1478 .Append(setup_path.BaseName())); | 1630 .Append(setup_path.BaseName())); |
1479 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); | 1631 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); |
1480 if (installer_state.system_install()) | 1632 if (installer_state.system_install()) |
1481 cmd_line.AppendSwitch(installer::switches::kSystemLevel); | 1633 cmd_line.AppendSwitch(installer::switches::kSystemLevel); |
1482 if (installer_state.verbose_logging()) | 1634 if (installer_state.verbose_logging()) |
1483 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); | 1635 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); |
1484 AppCommand cmd(cmd_line.GetCommandLineString()); | 1636 AppCommand cmd(cmd_line.GetCommandLineString()); |
1485 cmd.set_is_web_accessible(true); | 1637 cmd.set_is_web_accessible(true); |
1486 cmd.set_is_run_as_user(true); | 1638 cmd.set_is_run_as_user(true); |
1487 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); | 1639 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); |
1488 } | 1640 } |
1489 } | 1641 } |
1490 | 1642 |
1491 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, | 1643 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, |
1492 WorkItemList* work_item_list) { | 1644 WorkItemList* work_item_list) { |
1493 DCHECK(work_item_list); | 1645 DCHECK(work_item_list); |
1494 | 1646 |
1495 base::string16 cmd_key( | 1647 base::string16 cmd_key( |
1496 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( | 1648 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( |
1497 BrowserDistribution::CHROME_BINARIES), | 1649 BrowserDistribution::CHROME_BINARIES), |
1498 kCmdQuickEnableCf)); | 1650 kCmdQuickEnableCf)); |
1499 | 1651 |
1500 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1652 // 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 | 1653 // Do this even if multi-install Chrome isn't installed to ensure that it is |
1502 // not left behind in any case. | 1654 // not left behind in any case. |
1503 work_item_list->AddDeleteRegKeyWorkItem( | 1655 work_item_list->AddDeleteRegKeyWorkItem( |
1504 installer_state.root_key(), cmd_key)->set_log_message( | 1656 installer_state.root_key(), cmd_key, WorkItem::kWow64Default) |
1505 "removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + " command"); | 1657 ->set_log_message("removing " + |
1506 | 1658 base::UTF16ToASCII(kCmdQuickEnableCf) + " command"); |
1507 } | 1659 } |
1508 | 1660 |
1509 } // namespace installer | 1661 } // namespace installer |
OLD | NEW |