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

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

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