Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome/installer/setup/install_worker.cc

Issue 297233010: Revert 273108 "Omaha configuration parameters now use Wow6432Nod..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2017/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/mini_installer/mini_installer.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(installer_state.root_key(), 217 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(),
218 full_cmd_key, 218 full_cmd_key,
219 KEY_WOW64_32KEY) 219 WorkItem::kWow64Default)
220 ->set_log_message("removing " + base::UTF16ToASCII(command_key) + 220 ->set_log_message("removing " + base::UTF16ToASCII(command_key) +
221 " command"); 221 " command");
222 } else { 222 } else {
223 CommandLine cmd_line(installer_state.target_path().Append(app)); 223 CommandLine cmd_line(installer_state.target_path().Append(app));
224 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); 224 cmd_line.AppendSwitchASCII(command_with_parameter, "%1");
225 225
226 AppCommand cmd(cmd_line.GetCommandLineString()); 226 AppCommand cmd(cmd_line.GetCommandLineString());
227 cmd.set_sends_pings(true); 227 cmd.set_sends_pings(true);
228 cmd.set_is_web_accessible(true); 228 cmd.set_is_web_accessible(true);
229 cmd.set_is_run_as_user(true); 229 cmd.set_is_run_as_user(true);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 const base::FilePath& temp_path, 435 const base::FilePath& temp_path,
436 WorkItemList* work_item_list) { 436 WorkItemList* work_item_list) {
437 DCHECK(installer_state.is_msi()) 437 DCHECK(installer_state.is_msi())
438 << "This must only be called for MSI installations!"; 438 << "This must only be called for MSI installations!";
439 439
440 // First attempt to delete the old installation's ARP dialog entry. 440 // First attempt to delete the old installation's ARP dialog entry.
441 HKEY reg_root = installer_state.root_key(); 441 HKEY reg_root = installer_state.root_key();
442 base::string16 uninstall_reg(product.distribution()->GetUninstallRegPath()); 442 base::string16 uninstall_reg(product.distribution()->GetUninstallRegPath());
443 443
444 WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem( 444 WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem(
445 reg_root, uninstall_reg, KEY_WOW64_32KEY); 445 reg_root, uninstall_reg, WorkItem::kWow64Default);
446 delete_reg_key->set_ignore_failure(true); 446 delete_reg_key->set_ignore_failure(true);
447 447
448 // Then attempt to delete the old installation's start menu shortcut. 448 // Then attempt to delete the old installation's start menu shortcut.
449 base::FilePath uninstall_link; 449 base::FilePath uninstall_link;
450 if (installer_state.system_install()) { 450 if (installer_state.system_install()) {
451 PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link); 451 PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link);
452 } else { 452 } else {
453 PathService::Get(base::DIR_START_MENU, &uninstall_link); 453 PathService::Get(base::DIR_START_MENU, &uninstall_link);
454 } 454 }
455 455
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 604
605 return true; 605 return true;
606 } 606 }
607 607
608 void AddUninstallDelegateExecuteWorkItems( 608 void AddUninstallDelegateExecuteWorkItems(
609 HKEY root, 609 HKEY root,
610 const base::string16& delegate_execute_path, 610 const base::string16& delegate_execute_path,
611 WorkItemList* list) { 611 WorkItemList* list) {
612 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler in " 612 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler in "
613 << root; 613 << root;
614 // Delete both 64 and 32 keys to handle 32->64 or 64->32 migration. 614 list->AddDeleteRegKeyWorkItem(root,
615 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path, KEY_WOW64_32KEY); 615 delegate_execute_path,
616 616 WorkItem::kWow64Default);
617 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path, KEY_WOW64_64KEY);
618 617
619 // In the past, the ICommandExecuteImpl interface and a TypeLib were both 618 // In the past, the ICommandExecuteImpl interface and a TypeLib were both
620 // registered. Remove these since this operation may be updating a machine 619 // registered. Remove these since this operation may be updating a machine
621 // that had the old registrations. 620 // that had the old registrations.
622 list->AddDeleteRegKeyWorkItem(root, 621 list->AddDeleteRegKeyWorkItem(root,
623 L"Software\\Classes\\Interface\\" 622 L"Software\\Classes\\Interface\\"
624 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}", 623 L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}",
625 KEY_WOW64_32KEY); 624 WorkItem::kWow64Default);
626 list->AddDeleteRegKeyWorkItem(root, 625 list->AddDeleteRegKeyWorkItem(root,
627 L"Software\\Classes\\TypeLib\\" 626 L"Software\\Classes\\TypeLib\\"
628 #if defined(GOOGLE_CHROME_BUILD) 627 #if defined(GOOGLE_CHROME_BUILD)
629 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}", 628 L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}",
630 #else 629 #else
631 L"{7779FB70-B399-454A-AA1A-BAA850032B10}", 630 L"{7779FB70-B399-454A-AA1A-BAA850032B10}",
632 #endif 631 #endif
633 KEY_WOW64_32KEY); 632 WorkItem::kWow64Default);
634 } 633 }
635 634
636 // 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
637 // (exclusively -- crrev.com/132596), registered a DelegateExecute class by 636 // (exclusively -- crrev.com/132596), registered a DelegateExecute class by
638 // 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
639 // 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
640 // 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
641 // 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
642 // 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
643 // 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 base::FilePath installer_path( 692 base::FilePath installer_path(
694 installer_state.GetInstallerDirectory(new_version)); 693 installer_state.GetInstallerDirectory(new_version));
695 installer_path = installer_path.Append(setup_path.BaseName()); 694 installer_path = installer_path.Append(setup_path.BaseName());
696 695
697 CommandLine uninstall_arguments(CommandLine::NO_PROGRAM); 696 CommandLine uninstall_arguments(CommandLine::NO_PROGRAM);
698 AppendUninstallCommandLineFlags(installer_state, product, 697 AppendUninstallCommandLineFlags(installer_state, product,
699 &uninstall_arguments); 698 &uninstall_arguments);
700 699
701 base::string16 update_state_key(browser_dist->GetStateKey()); 700 base::string16 update_state_key(browser_dist->GetStateKey());
702 install_list->AddCreateRegKeyWorkItem( 701 install_list->AddCreateRegKeyWorkItem(
703 reg_root, update_state_key, KEY_WOW64_32KEY); 702 reg_root, update_state_key, WorkItem::kWow64Default);
704 install_list->AddSetRegValueWorkItem(reg_root, 703 install_list->AddSetRegValueWorkItem(reg_root,
705 update_state_key, 704 update_state_key,
706 KEY_WOW64_32KEY, 705 WorkItem::kWow64Default,
707 installer::kUninstallStringField, 706 installer::kUninstallStringField,
708 installer_path.value(), 707 installer_path.value(),
709 true); 708 true);
710 install_list->AddSetRegValueWorkItem( 709 install_list->AddSetRegValueWorkItem(
711 reg_root, 710 reg_root,
712 update_state_key, 711 update_state_key,
713 KEY_WOW64_32KEY, 712 WorkItem::kWow64Default,
714 installer::kUninstallArgumentsField, 713 installer::kUninstallArgumentsField,
715 uninstall_arguments.GetCommandLineString(), 714 uninstall_arguments.GetCommandLineString(),
716 true); 715 true);
717 716
718 // MSI installations will manage their own uninstall shortcuts. 717 // MSI installations will manage their own uninstall shortcuts.
719 if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) { 718 if (!installer_state.is_msi() && product.ShouldCreateUninstallEntry()) {
720 // 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.
721 CommandLine quoted_uninstall_cmd(installer_path); 720 CommandLine quoted_uninstall_cmd(installer_path);
722 DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"'); 721 DCHECK_EQ(quoted_uninstall_cmd.GetCommandLineString()[0], '"');
723 quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false); 722 quoted_uninstall_cmd.AppendArguments(uninstall_arguments, false);
724 723
725 base::string16 uninstall_reg = browser_dist->GetUninstallRegPath(); 724 base::string16 uninstall_reg = browser_dist->GetUninstallRegPath();
726 install_list->AddCreateRegKeyWorkItem( 725 install_list->AddCreateRegKeyWorkItem(
727 reg_root, uninstall_reg, KEY_WOW64_32KEY); 726 reg_root, uninstall_reg, WorkItem::kWow64Default);
728 install_list->AddSetRegValueWorkItem(reg_root, 727 install_list->AddSetRegValueWorkItem(reg_root,
729 uninstall_reg, 728 uninstall_reg,
730 KEY_WOW64_32KEY, 729 WorkItem::kWow64Default,
731 installer::kUninstallDisplayNameField, 730 installer::kUninstallDisplayNameField,
732 browser_dist->GetDisplayName(), 731 browser_dist->GetDisplayName(),
733 true); 732 true);
734 install_list->AddSetRegValueWorkItem( 733 install_list->AddSetRegValueWorkItem(
735 reg_root, 734 reg_root,
736 uninstall_reg, 735 uninstall_reg,
737 KEY_WOW64_32KEY, 736 WorkItem::kWow64Default,
738 installer::kUninstallStringField, 737 installer::kUninstallStringField,
739 quoted_uninstall_cmd.GetCommandLineString(), 738 quoted_uninstall_cmd.GetCommandLineString(),
740 true); 739 true);
741 install_list->AddSetRegValueWorkItem(reg_root, 740 install_list->AddSetRegValueWorkItem(reg_root,
742 uninstall_reg, 741 uninstall_reg,
743 KEY_WOW64_32KEY, 742 WorkItem::kWow64Default,
744 L"InstallLocation", 743 L"InstallLocation",
745 install_path.value(), 744 install_path.value(),
746 true); 745 true);
747 746
748 BrowserDistribution* dist = product.distribution(); 747 BrowserDistribution* dist = product.distribution();
749 base::string16 chrome_icon = ShellUtil::FormatIconLocation( 748 base::string16 chrome_icon = ShellUtil::FormatIconLocation(
750 install_path.Append(dist->GetIconFilename()).value(), 749 install_path.Append(dist->GetIconFilename()).value(),
751 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME)); 750 dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME));
752 install_list->AddSetRegValueWorkItem(reg_root, 751 install_list->AddSetRegValueWorkItem(reg_root,
753 uninstall_reg, 752 uninstall_reg,
754 KEY_WOW64_32KEY, 753 WorkItem::kWow64Default,
755 L"DisplayIcon", 754 L"DisplayIcon",
756 chrome_icon, 755 chrome_icon,
757 true); 756 true);
758 install_list->AddSetRegValueWorkItem(reg_root, 757 install_list->AddSetRegValueWorkItem(reg_root,
759 uninstall_reg, 758 uninstall_reg,
760 KEY_WOW64_32KEY, 759 WorkItem::kWow64Default,
761 L"NoModify", 760 L"NoModify",
762 static_cast<DWORD>(1), 761 static_cast<DWORD>(1),
763 true); 762 true);
764 install_list->AddSetRegValueWorkItem(reg_root, 763 install_list->AddSetRegValueWorkItem(reg_root,
765 uninstall_reg, 764 uninstall_reg,
766 KEY_WOW64_32KEY, 765 WorkItem::kWow64Default,
767 L"NoRepair", 766 L"NoRepair",
768 static_cast<DWORD>(1), 767 static_cast<DWORD>(1),
769 true); 768 true);
770 769
771 install_list->AddSetRegValueWorkItem(reg_root, 770 install_list->AddSetRegValueWorkItem(reg_root,
772 uninstall_reg, 771 uninstall_reg,
773 KEY_WOW64_32KEY, 772 WorkItem::kWow64Default,
774 L"Publisher", 773 L"Publisher",
775 browser_dist->GetPublisherName(), 774 browser_dist->GetPublisherName(),
776 true); 775 true);
777 install_list->AddSetRegValueWorkItem(reg_root, 776 install_list->AddSetRegValueWorkItem(reg_root,
778 uninstall_reg, 777 uninstall_reg,
779 KEY_WOW64_32KEY, 778 WorkItem::kWow64Default,
780 L"Version", 779 L"Version",
781 ASCIIToWide(new_version.GetString()), 780 ASCIIToWide(new_version.GetString()),
782 true); 781 true);
783 install_list->AddSetRegValueWorkItem(reg_root, 782 install_list->AddSetRegValueWorkItem(reg_root,
784 uninstall_reg, 783 uninstall_reg,
785 KEY_WOW64_32KEY, 784 WorkItem::kWow64Default,
786 L"DisplayVersion", 785 L"DisplayVersion",
787 ASCIIToWide(new_version.GetString()), 786 ASCIIToWide(new_version.GetString()),
788 true); 787 true);
789 // TODO(wfh): Ensure that this value is preserved in the 64-bit hive when
790 // 64-bit installs place the uninstall information into the 64-bit registry.
791 install_list->AddSetRegValueWorkItem(reg_root, 788 install_list->AddSetRegValueWorkItem(reg_root,
792 uninstall_reg, 789 uninstall_reg,
793 KEY_WOW64_32KEY, 790 WorkItem::kWow64Default,
794 L"InstallDate", 791 L"InstallDate",
795 InstallUtil::GetCurrentDate(), 792 InstallUtil::GetCurrentDate(),
796 false); 793 false);
797 794
798 const std::vector<uint16>& version_components = new_version.components(); 795 const std::vector<uint16>& version_components = new_version.components();
799 if (version_components.size() == 4) { 796 if (version_components.size() == 4) {
800 // Our version should be in major.minor.build.rev. 797 // Our version should be in major.minor.build.rev.
801 install_list->AddSetRegValueWorkItem( 798 install_list->AddSetRegValueWorkItem(
802 reg_root, 799 reg_root,
803 uninstall_reg, 800 uninstall_reg,
804 KEY_WOW64_32KEY, 801 WorkItem::kWow64Default,
805 L"VersionMajor", 802 L"VersionMajor",
806 static_cast<DWORD>(version_components[2]), 803 static_cast<DWORD>(version_components[2]),
807 true); 804 true);
808 install_list->AddSetRegValueWorkItem( 805 install_list->AddSetRegValueWorkItem(
809 reg_root, 806 reg_root,
810 uninstall_reg, 807 uninstall_reg,
811 KEY_WOW64_32KEY, 808 WorkItem::kWow64Default,
812 L"VersionMinor", 809 L"VersionMinor",
813 static_cast<DWORD>(version_components[3]), 810 static_cast<DWORD>(version_components[3]),
814 true); 811 true);
815 } 812 }
816 } 813 }
817 } 814 }
818 815
819 // 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
820 // product version as the last step. 817 // product version as the last step.
821 void AddVersionKeyWorkItems(HKEY root, 818 void AddVersionKeyWorkItems(HKEY root,
822 BrowserDistribution* dist, 819 BrowserDistribution* dist,
823 const Version& new_version, 820 const Version& new_version,
824 bool add_language_identifier, 821 bool add_language_identifier,
825 WorkItemList* list) { 822 WorkItemList* list) {
826 // 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
827 // the new product version as the last step. 824 // the new product version as the last step.
828 base::string16 version_key(dist->GetVersionKey()); 825 base::string16 version_key(dist->GetVersionKey());
829 list->AddCreateRegKeyWorkItem(root, version_key, KEY_WOW64_32KEY); 826 list->AddCreateRegKeyWorkItem(root, version_key, WorkItem::kWow64Default);
830 827
831 base::string16 product_name(dist->GetDisplayName()); 828 base::string16 product_name(dist->GetDisplayName());
832 list->AddSetRegValueWorkItem(root, 829 list->AddSetRegValueWorkItem(root,
833 version_key, 830 version_key,
834 KEY_WOW64_32KEY, 831 WorkItem::kWow64Default,
835 google_update::kRegNameField, 832 google_update::kRegNameField,
836 product_name, 833 product_name,
837 true); // overwrite name also 834 true); // overwrite name also
838 list->AddSetRegValueWorkItem(root, 835 list->AddSetRegValueWorkItem(root,
839 version_key, 836 version_key,
840 KEY_WOW64_32KEY, 837 WorkItem::kWow64Default,
841 google_update::kRegOopcrashesField, 838 google_update::kRegOopcrashesField,
842 static_cast<DWORD>(1), 839 static_cast<DWORD>(1),
843 false); // set during first install 840 false); // set during first install
844 if (add_language_identifier) { 841 if (add_language_identifier) {
845 // 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
846 // 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
847 // exception: what Chrome calls "en-us", Omaha calls "en". sigh. 844 // exception: what Chrome calls "en-us", Omaha calls "en". sigh.
848 base::string16 language(GetCurrentTranslation()); 845 base::string16 language(GetCurrentTranslation());
849 if (LowerCaseEqualsASCII(language, "en-us")) 846 if (LowerCaseEqualsASCII(language, "en-us"))
850 language.resize(2); 847 language.resize(2);
851 list->AddSetRegValueWorkItem(root, 848 list->AddSetRegValueWorkItem(root,
852 version_key, 849 version_key,
853 KEY_WOW64_32KEY, 850 WorkItem::kWow64Default,
854 google_update::kRegLangField, 851 google_update::kRegLangField,
855 language, 852 language,
856 false); // do not overwrite language 853 false); // do not overwrite language
857 } 854 }
858 list->AddSetRegValueWorkItem(root, 855 list->AddSetRegValueWorkItem(root,
859 version_key, 856 version_key,
860 KEY_WOW64_32KEY, 857 WorkItem::kWow64Default,
861 google_update::kRegVersionField, 858 google_update::kRegVersionField,
862 ASCIIToWide(new_version.GetString()), 859 ASCIIToWide(new_version.GetString()),
863 true); // overwrite version 860 true); // overwrite version
864 } 861 }
865 862
866 // 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
867 // 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
868 // 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
869 // acceptance is processed. 866 // acceptance is processed.
870 void AddOemInstallWorkItems(const InstallationState& original_state, 867 void AddOemInstallWorkItems(const InstallationState& original_state,
(...skipping 22 matching lines...) Expand all
893 } 890 }
894 const ProductState* source_product = 891 const ProductState* source_product =
895 original_state.GetNonVersionedProductState(system_install, source_type); 892 original_state.GetNonVersionedProductState(system_install, source_type);
896 893
897 base::string16 oem_install; 894 base::string16 oem_install;
898 if (source_product->GetOemInstall(&oem_install)) { 895 if (source_product->GetOemInstall(&oem_install)) {
899 VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from " 896 VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from "
900 << BrowserDistribution::GetSpecificDistribution(source_type)-> 897 << BrowserDistribution::GetSpecificDistribution(source_type)->
901 GetDisplayName(); 898 GetDisplayName();
902 install_list->AddCreateRegKeyWorkItem( 899 install_list->AddCreateRegKeyWorkItem(
903 root_key, multi_key, KEY_WOW64_32KEY); 900 root_key, multi_key, WorkItem::kWow64Default);
904 // Always overwrite an old value. 901 // Always overwrite an old value.
905 install_list->AddSetRegValueWorkItem(root_key, 902 install_list->AddSetRegValueWorkItem(root_key,
906 multi_key, 903 multi_key,
907 KEY_WOW64_32KEY, 904 WorkItem::kWow64Default,
908 google_update::kRegOemInstallField, 905 google_update::kRegOemInstallField,
909 oem_install, 906 oem_install,
910 true); 907 true);
911 } else { 908 } else {
912 // Clear any old value. 909 // Clear any old value.
913 install_list->AddDeleteRegValueWorkItem( 910 install_list->AddDeleteRegValueWorkItem(
914 root_key, 911 root_key,
915 multi_key, 912 multi_key,
916 KEY_WOW64_32KEY, 913 WorkItem::kWow64Default,
917 google_update::kRegOemInstallField); 914 google_update::kRegOemInstallField);
918 } 915 }
919 } 916 }
920 } 917 }
921 918
922 // 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
923 // need to update the value on future install/update runs since 920 // need to update the value on future install/update runs since
924 // GoogleUpdateSettings::SetEULAConsent will modify the value for both the 921 // GoogleUpdateSettings::SetEULAConsent will modify the value for both the
925 // relevant product and for the binaries. 922 // relevant product and for the binaries.
926 void AddEulaAcceptedWorkItems(const InstallationState& original_state, 923 void AddEulaAcceptedWorkItems(const InstallationState& original_state,
(...skipping 28 matching lines...) Expand all
955 eula_accepted = dword_value; 952 eula_accepted = dword_value;
956 product_type = this_type; 953 product_type = this_type;
957 } 954 }
958 } 955 }
959 956
960 if (have_eula_accepted) { 957 if (have_eula_accepted) {
961 VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from " 958 VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from "
962 << BrowserDistribution::GetSpecificDistribution(product_type)-> 959 << BrowserDistribution::GetSpecificDistribution(product_type)->
963 GetDisplayName(); 960 GetDisplayName();
964 install_list->AddCreateRegKeyWorkItem( 961 install_list->AddCreateRegKeyWorkItem(
965 root_key, multi_key, KEY_WOW64_32KEY); 962 root_key, multi_key, WorkItem::kWow64Default);
966 install_list->AddSetRegValueWorkItem(root_key, 963 install_list->AddSetRegValueWorkItem(root_key,
967 multi_key, 964 multi_key,
968 KEY_WOW64_32KEY, 965 WorkItem::kWow64Default,
969 google_update::kRegEULAAceptedField, 966 google_update::kRegEULAAceptedField,
970 eula_accepted, 967 eula_accepted,
971 true); 968 true);
972 } else { 969 } else {
973 // Clear any old value. 970 // Clear any old value.
974 install_list->AddDeleteRegValueWorkItem( 971 install_list->AddDeleteRegValueWorkItem(
975 root_key, 972 root_key,
976 multi_key, 973 multi_key,
977 KEY_WOW64_32KEY, 974 WorkItem::kWow64Default,
978 google_update::kRegEULAAceptedField); 975 google_update::kRegEULAAceptedField);
979 } 976 }
980 } 977 }
981 } 978 }
982 979
983 // Adds work items that make registry adjustments for Google Update. 980 // Adds work items that make registry adjustments for Google Update.
984 void AddGoogleUpdateWorkItems(const InstallationState& original_state, 981 void AddGoogleUpdateWorkItems(const InstallationState& original_state,
985 const InstallerState& installer_state, 982 const InstallerState& installer_state,
986 WorkItemList* install_list) { 983 WorkItemList* install_list) {
987 // Is a multi-install product being installed or over-installed? 984 // Is a multi-install product being installed or over-installed?
988 if (installer_state.operation() != InstallerState::MULTI_INSTALL && 985 if (installer_state.operation() != InstallerState::MULTI_INSTALL &&
989 installer_state.operation() != InstallerState::MULTI_UPDATE) { 986 installer_state.operation() != InstallerState::MULTI_UPDATE) {
990 VLOG(1) << "AddGoogleUpdateWorkItems noop: " << installer_state.operation(); 987 VLOG(1) << "AddGoogleUpdateWorkItems noop: " << installer_state.operation();
991 return; 988 return;
992 } 989 }
993 990
994 const bool system_install = installer_state.system_install(); 991 const bool system_install = installer_state.system_install();
995 const HKEY root_key = installer_state.root_key(); 992 const HKEY root_key = installer_state.root_key();
996 base::string16 multi_key( 993 base::string16 multi_key(
997 installer_state.multi_package_binaries_distribution()->GetStateKey()); 994 installer_state.multi_package_binaries_distribution()->GetStateKey());
998 995
999 // For system-level installs, make sure the ClientStateMedium key for the 996 // For system-level installs, make sure the ClientStateMedium key for the
1000 // binaries exists. 997 // binaries exists.
1001 if (system_install) { 998 if (system_install) {
1002 install_list->AddCreateRegKeyWorkItem( 999 install_list->AddCreateRegKeyWorkItem(
1003 root_key, 1000 root_key,
1004 installer_state.multi_package_binaries_distribution() 1001 installer_state.multi_package_binaries_distribution()
1005 ->GetStateMediumKey() 1002 ->GetStateMediumKey().c_str(),
1006 .c_str(), 1003 WorkItem::kWow64Default);
1007 KEY_WOW64_32KEY);
1008 } 1004 }
1009 1005
1010 // 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
1011 // copy over Chrome's brand code if it has one. 1007 // copy over Chrome's brand code if it has one.
1012 if (installer_state.state_type() != BrowserDistribution::CHROME_BINARIES) { 1008 if (installer_state.state_type() != BrowserDistribution::CHROME_BINARIES) {
1013 const ProductState* chrome_product_state = 1009 const ProductState* chrome_product_state =
1014 original_state.GetNonVersionedProductState( 1010 original_state.GetNonVersionedProductState(
1015 system_install, BrowserDistribution::CHROME_BROWSER); 1011 system_install, BrowserDistribution::CHROME_BROWSER);
1016 1012
1017 const base::string16& brand(chrome_product_state->brand()); 1013 const base::string16& brand(chrome_product_state->brand());
1018 if (!brand.empty()) { 1014 if (!brand.empty()) {
1019 install_list->AddCreateRegKeyWorkItem( 1015 install_list->AddCreateRegKeyWorkItem(
1020 root_key, multi_key, KEY_WOW64_32KEY); 1016 root_key, multi_key, WorkItem::kWow64Default);
1021 // 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
1022 // if one is already present (although this shouldn't happen). 1018 // if one is already present (although this shouldn't happen).
1023 install_list->AddSetRegValueWorkItem(root_key, 1019 install_list->AddSetRegValueWorkItem(root_key,
1024 multi_key, 1020 multi_key,
1025 KEY_WOW64_32KEY, 1021 WorkItem::kWow64Default,
1026 google_update::kRegBrandField, 1022 google_update::kRegBrandField,
1027 brand, 1023 brand,
1028 false); 1024 false);
1029 } 1025 }
1030 } 1026 }
1031 1027
1032 AddOemInstallWorkItems(original_state, installer_state, install_list); 1028 AddOemInstallWorkItems(original_state, installer_state, install_list);
1033 AddEulaAcceptedWorkItems(original_state, installer_state, install_list); 1029 AddEulaAcceptedWorkItems(original_state, installer_state, install_list);
1034 AddUsageStatsWorkItems(original_state, installer_state, install_list); 1030 AddUsageStatsWorkItems(original_state, installer_state, install_list);
1035 1031
(...skipping 22 matching lines...) Expand all
1058 original_state.GetNonVersionedProductState( 1054 original_state.GetNonVersionedProductState(
1059 installer_state.system_install(), dist->GetType()); 1055 installer_state.system_install(), dist->GetType());
1060 value_found = product_state->GetUsageStats(&usagestats); 1056 value_found = product_state->GetUsageStats(&usagestats);
1061 } 1057 }
1062 1058
1063 // 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
1064 // binaries and remove all values from the products. 1060 // binaries and remove all values from the products.
1065 if (value_found) { 1061 if (value_found) {
1066 base::string16 state_key( 1062 base::string16 state_key(
1067 installer_state.multi_package_binaries_distribution()->GetStateKey()); 1063 installer_state.multi_package_binaries_distribution()->GetStateKey());
1068 install_list->AddCreateRegKeyWorkItem(root_key, state_key, KEY_WOW64_32KEY); 1064 install_list->AddCreateRegKeyWorkItem(
1065 root_key, state_key, WorkItem::kWow64Default);
1069 // Overwrite any existing value so that overinstalls (where Omaha writes a 1066 // Overwrite any existing value so that overinstalls (where Omaha writes a
1070 // 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.
1071 install_list->AddSetRegValueWorkItem(root_key, 1068 install_list->AddSetRegValueWorkItem(root_key,
1072 state_key, 1069 state_key,
1073 KEY_WOW64_32KEY, 1070 WorkItem::kWow64Default,
1074 google_update::kRegUsageStatsField, 1071 google_update::kRegUsageStatsField,
1075 usagestats, 1072 usagestats,
1076 true); 1073 true);
1077 1074
1078 for (Products::const_iterator scan = products.begin(), end = products.end(); 1075 for (Products::const_iterator scan = products.begin(), end = products.end();
1079 scan != end; ++scan) { 1076 scan != end; ++scan) {
1080 if ((*scan)->is_chrome_binaries()) 1077 if ((*scan)->is_chrome_binaries())
1081 continue; 1078 continue;
1082 BrowserDistribution* dist = (*scan)->distribution(); 1079 BrowserDistribution* dist = (*scan)->distribution();
1083 if (installer_state.system_install()) { 1080 if (installer_state.system_install()) {
1084 install_list->AddDeleteRegValueWorkItem( 1081 install_list->AddDeleteRegValueWorkItem(
1085 root_key, 1082 root_key,
1086 dist->GetStateMediumKey(), 1083 dist->GetStateMediumKey(),
1087 KEY_WOW64_32KEY, 1084 WorkItem::kWow64Default,
1088 google_update::kRegUsageStatsField); 1085 google_update::kRegUsageStatsField);
1089 // 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
1090 // system-level installs, so clean that up. 1087 // system-level installs, so clean that up.
1091 install_list->AddDeleteRegValueWorkItem( 1088 install_list->AddDeleteRegValueWorkItem(
1092 HKEY_CURRENT_USER, 1089 HKEY_CURRENT_USER,
1093 dist->GetStateKey(), 1090 dist->GetStateKey(),
1094 KEY_WOW64_32KEY, 1091 WorkItem::kWow64Default,
1095 google_update::kRegUsageStatsField); 1092 google_update::kRegUsageStatsField);
1096 } 1093 }
1097 install_list->AddDeleteRegValueWorkItem( 1094 install_list->AddDeleteRegValueWorkItem(
1098 root_key, 1095 root_key,
1099 dist->GetStateKey(), 1096 dist->GetStateKey(),
1100 KEY_WOW64_32KEY, 1097 WorkItem::kWow64Default,
1101 google_update::kRegUsageStatsField); 1098 google_update::kRegUsageStatsField);
1102 } 1099 }
1103 } 1100 }
1104 } 1101 }
1105 1102
1106 bool AppendPostInstallTasks(const InstallerState& installer_state, 1103 bool AppendPostInstallTasks(const InstallerState& installer_state,
1107 const base::FilePath& setup_path, 1104 const base::FilePath& setup_path,
1108 const Version* current_version, 1105 const Version* current_version,
1109 const Version& new_version, 1106 const Version& new_version,
1110 const base::FilePath& temp_path, 1107 const base::FilePath& temp_path,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 1141
1145 base::string16 version_key; 1142 base::string16 version_key;
1146 for (size_t i = 0; i < products.size(); ++i) { 1143 for (size_t i = 0; i < products.size(); ++i) {
1147 BrowserDistribution* dist = products[i]->distribution(); 1144 BrowserDistribution* dist = products[i]->distribution();
1148 version_key = dist->GetVersionKey(); 1145 version_key = dist->GetVersionKey();
1149 1146
1150 if (current_version) { 1147 if (current_version) {
1151 in_use_update_work_items->AddSetRegValueWorkItem( 1148 in_use_update_work_items->AddSetRegValueWorkItem(
1152 root, 1149 root,
1153 version_key, 1150 version_key,
1154 KEY_WOW64_32KEY, 1151 WorkItem::kWow64Default,
1155 google_update::kRegOldVersionField, 1152 google_update::kRegOldVersionField,
1156 ASCIIToWide(current_version->GetString()), 1153 ASCIIToWide(current_version->GetString()),
1157 true); 1154 true);
1158 } 1155 }
1159 if (critical_version.IsValid()) { 1156 if (critical_version.IsValid()) {
1160 in_use_update_work_items->AddSetRegValueWorkItem( 1157 in_use_update_work_items->AddSetRegValueWorkItem(
1161 root, 1158 root,
1162 version_key, 1159 version_key,
1163 KEY_WOW64_32KEY, 1160 WorkItem::kWow64Default,
1164 google_update::kRegCriticalVersionField, 1161 google_update::kRegCriticalVersionField,
1165 ASCIIToWide(critical_version.GetString()), 1162 ASCIIToWide(critical_version.GetString()),
1166 true); 1163 true);
1167 } else { 1164 } else {
1168 in_use_update_work_items->AddDeleteRegValueWorkItem( 1165 in_use_update_work_items->AddDeleteRegValueWorkItem(
1169 root, 1166 root,
1170 version_key, 1167 version_key,
1171 KEY_WOW64_32KEY, 1168 WorkItem::kWow64Default,
1172 google_update::kRegCriticalVersionField); 1169 google_update::kRegCriticalVersionField);
1173 } 1170 }
1174 1171
1175 // Adding this registry entry for all products (but the binaries) is 1172 // Adding this registry entry for all products (but the binaries) is
1176 // 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
1177 // 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.
1178 // 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
1179 // values. 1176 // values.
1180 if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) { 1177 if (dist->GetType() != BrowserDistribution::CHROME_BINARIES) {
1181 CommandLine product_rename_cmd(rename); 1178 CommandLine product_rename_cmd(rename);
1182 products[i]->AppendRenameFlags(&product_rename_cmd); 1179 products[i]->AppendRenameFlags(&product_rename_cmd);
1183 in_use_update_work_items->AddSetRegValueWorkItem( 1180 in_use_update_work_items->AddSetRegValueWorkItem(
1184 root, 1181 root,
1185 version_key, 1182 version_key,
1186 KEY_WOW64_32KEY, 1183 WorkItem::kWow64Default,
1187 google_update::kRegRenameCmdField, 1184 google_update::kRegRenameCmdField,
1188 product_rename_cmd.GetCommandLineString(), 1185 product_rename_cmd.GetCommandLineString(),
1189 true); 1186 true);
1190 } 1187 }
1191 } 1188 }
1192 1189
1193 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); 1190 post_install_task_list->AddWorkItem(in_use_update_work_items.release());
1194 } 1191 }
1195 1192
1196 // 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.
1197 { 1194 {
1198 scoped_ptr<WorkItemList> regular_update_work_items( 1195 scoped_ptr<WorkItemList> regular_update_work_items(
1199 WorkItem::CreateConditionalWorkItemList( 1196 WorkItem::CreateConditionalWorkItemList(
1200 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); 1197 new Not(new ConditionRunIfFileExists(new_chrome_exe))));
1201 regular_update_work_items->set_log_message("RegularUpdateWorkItemList"); 1198 regular_update_work_items->set_log_message("RegularUpdateWorkItemList");
1202 1199
1203 // 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.
1204 for (size_t i = 0; i < products.size(); ++i) { 1201 for (size_t i = 0; i < products.size(); ++i) {
1205 BrowserDistribution* dist = products[i]->distribution(); 1202 BrowserDistribution* dist = products[i]->distribution();
1206 base::string16 version_key(dist->GetVersionKey()); 1203 base::string16 version_key(dist->GetVersionKey());
1207 regular_update_work_items->AddDeleteRegValueWorkItem( 1204 regular_update_work_items->AddDeleteRegValueWorkItem(
1208 root, 1205 root,
1209 version_key, 1206 version_key,
1210 KEY_WOW64_32KEY, 1207 WorkItem::kWow64Default,
1211 google_update::kRegOldVersionField); 1208 google_update::kRegOldVersionField);
1212 regular_update_work_items->AddDeleteRegValueWorkItem( 1209 regular_update_work_items->AddDeleteRegValueWorkItem(
1213 root, 1210 root,
1214 version_key, 1211 version_key,
1215 KEY_WOW64_32KEY, 1212 WorkItem::kWow64Default,
1216 google_update::kRegCriticalVersionField); 1213 google_update::kRegCriticalVersionField);
1217 regular_update_work_items->AddDeleteRegValueWorkItem( 1214 regular_update_work_items->AddDeleteRegValueWorkItem(
1218 root, 1215 root,
1219 version_key, 1216 version_key,
1220 KEY_WOW64_32KEY, 1217 WorkItem::kWow64Default,
1221 google_update::kRegRenameCmdField); 1218 google_update::kRegRenameCmdField);
1222 } 1219 }
1223 1220
1224 post_install_task_list->AddWorkItem(regular_update_work_items.release()); 1221 post_install_task_list->AddWorkItem(regular_update_work_items.release());
1225 } 1222 }
1226 1223
1227 AddRegisterComDllWorkItemsForPackage(installer_state, current_version, 1224 AddRegisterComDllWorkItemsForPackage(installer_state, current_version,
1228 new_version, post_install_task_list); 1225 new_version, post_install_task_list);
1229 1226
1230 // 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 1372
1376 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, 1373 void AddSetMsiMarkerWorkItem(const InstallerState& installer_state,
1377 BrowserDistribution* dist, 1374 BrowserDistribution* dist,
1378 bool set, 1375 bool set,
1379 WorkItemList* work_item_list) { 1376 WorkItemList* work_item_list) {
1380 DCHECK(work_item_list); 1377 DCHECK(work_item_list);
1381 DWORD msi_value = set ? 1 : 0; 1378 DWORD msi_value = set ? 1 : 0;
1382 WorkItem* set_msi_work_item = 1379 WorkItem* set_msi_work_item =
1383 work_item_list->AddSetRegValueWorkItem(installer_state.root_key(), 1380 work_item_list->AddSetRegValueWorkItem(installer_state.root_key(),
1384 dist->GetStateKey(), 1381 dist->GetStateKey(),
1385 KEY_WOW64_32KEY, 1382 WorkItem::kWow64Default,
1386 google_update::kRegMSIField, 1383 google_update::kRegMSIField,
1387 msi_value, 1384 msi_value,
1388 true); 1385 true);
1389 DCHECK(set_msi_work_item); 1386 DCHECK(set_msi_work_item);
1390 set_msi_work_item->set_ignore_failure(true); 1387 set_msi_work_item->set_ignore_failure(true);
1391 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!");
1392 } 1389 }
1393 1390
1394 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, 1391 void AddDelegateExecuteWorkItems(const InstallerState& installer_state,
1395 const base::FilePath& target_path, 1392 const base::FilePath& target_path,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 void AddOsUpgradeWorkItems(const InstallerState& installer_state, 1581 void AddOsUpgradeWorkItems(const InstallerState& installer_state,
1585 const base::FilePath& setup_path, 1582 const base::FilePath& setup_path,
1586 const Version& new_version, 1583 const Version& new_version,
1587 const Product& product, 1584 const Product& product,
1588 WorkItemList* install_list) { 1585 WorkItemList* install_list) {
1589 const HKEY root_key = installer_state.root_key(); 1586 const HKEY root_key = installer_state.root_key();
1590 base::string16 cmd_key( 1587 base::string16 cmd_key(
1591 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade)); 1588 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade));
1592 1589
1593 if (installer_state.operation() == InstallerState::UNINSTALL) { 1590 if (installer_state.operation() == InstallerState::UNINSTALL) {
1594 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, KEY_WOW64_32KEY) 1591 install_list->AddDeleteRegKeyWorkItem(
1592 root_key, cmd_key, WorkItem::kWow64Default)
1595 ->set_log_message("Removing OS upgrade command"); 1593 ->set_log_message("Removing OS upgrade command");
1596 } else { 1594 } else {
1597 // 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
1598 // OS upgrade. 1596 // OS upgrade.
1599 CommandLine cmd_line(installer_state 1597 CommandLine cmd_line(installer_state
1600 .GetInstallerDirectory(new_version) 1598 .GetInstallerDirectory(new_version)
1601 .Append(setup_path.BaseName())); 1599 .Append(setup_path.BaseName()));
1602 // Add the main option to indicate OS upgrade flow. 1600 // Add the main option to indicate OS upgrade flow.
1603 cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade); 1601 cmd_line.AppendSwitch(installer::switches::kOnOsUpgrade);
1604 // Add product-specific options. 1602 // Add product-specific options.
(...skipping 11 matching lines...) Expand all
1616 1614
1617 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, 1615 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state,
1618 const base::FilePath& setup_path, 1616 const base::FilePath& setup_path,
1619 const Version& new_version, 1617 const Version& new_version,
1620 const Product& product, 1618 const Product& product,
1621 WorkItemList* work_item_list) { 1619 WorkItemList* work_item_list) {
1622 const HKEY root_key = installer_state.root_key(); 1620 const HKEY root_key = installer_state.root_key();
1623 base::string16 cmd_key( 1621 base::string16 cmd_key(
1624 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance)); 1622 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance));
1625 if (installer_state.operation() == InstallerState::UNINSTALL) { 1623 if (installer_state.operation() == InstallerState::UNINSTALL) {
1626 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, KEY_WOW64_32KEY) 1624 work_item_list->AddDeleteRegKeyWorkItem(
1627 ->set_log_message("Removing query EULA acceptance command"); 1625 root_key, cmd_key, WorkItem::kWow64Default)
1626 ->set_log_message("Removing query EULA acceptance command");
1628 } else { 1627 } else {
1629 CommandLine cmd_line(installer_state 1628 CommandLine cmd_line(installer_state
1630 .GetInstallerDirectory(new_version) 1629 .GetInstallerDirectory(new_version)
1631 .Append(setup_path.BaseName())); 1630 .Append(setup_path.BaseName()));
1632 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance); 1631 cmd_line.AppendSwitch(switches::kQueryEULAAcceptance);
1633 if (installer_state.system_install()) 1632 if (installer_state.system_install())
1634 cmd_line.AppendSwitch(installer::switches::kSystemLevel); 1633 cmd_line.AppendSwitch(installer::switches::kSystemLevel);
1635 if (installer_state.verbose_logging()) 1634 if (installer_state.verbose_logging())
1636 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); 1635 cmd_line.AppendSwitch(installer::switches::kVerboseLogging);
1637 AppCommand cmd(cmd_line.GetCommandLineString()); 1636 AppCommand cmd(cmd_line.GetCommandLineString());
1638 cmd.set_is_web_accessible(true); 1637 cmd.set_is_web_accessible(true);
1639 cmd.set_is_run_as_user(true); 1638 cmd.set_is_run_as_user(true);
1640 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); 1639 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list);
1641 } 1640 }
1642 } 1641 }
1643 1642
1644 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, 1643 void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state,
1645 WorkItemList* work_item_list) { 1644 WorkItemList* work_item_list) {
1646 DCHECK(work_item_list); 1645 DCHECK(work_item_list);
1647 1646
1648 base::string16 cmd_key( 1647 base::string16 cmd_key(
1649 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution( 1648 GetRegCommandKey(BrowserDistribution::GetSpecificDistribution(
1650 BrowserDistribution::CHROME_BINARIES), 1649 BrowserDistribution::CHROME_BINARIES),
1651 kCmdQuickEnableCf)); 1650 kCmdQuickEnableCf));
1652 1651
1653 // Unconditionally remove the legacy Quick Enable command from the binaries. 1652 // Unconditionally remove the legacy Quick Enable command from the binaries.
1654 // 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
1655 // not left behind in any case. 1654 // not left behind in any case.
1656 work_item_list->AddDeleteRegKeyWorkItem( 1655 work_item_list->AddDeleteRegKeyWorkItem(
1657 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) 1656 installer_state.root_key(), cmd_key, WorkItem::kWow64Default)
1658 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + 1657 ->set_log_message("removing " +
1659 " command"); 1658 base::UTF16ToASCII(kCmdQuickEnableCf) + " command");
1660 } 1659 }
1661 1660
1662 } // namespace installer 1661 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/mini_installer/mini_installer.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698