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

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

Issue 282363003: Add WOW64 support to the installer registry work items (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: add wow64 logic to installer_util. mini_installer tests. 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
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 defines the methods useful for uninstalling Chrome. 5 // This file defines the methods useful for uninstalling Chrome.
6 6
7 #include "chrome/installer/setup/uninstall.h" 7 #include "chrome/installer/setup/uninstall.h"
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
(...skipping 28 matching lines...) Expand all
39 #include "chrome/installer/util/google_update_constants.h" 39 #include "chrome/installer/util/google_update_constants.h"
40 #include "chrome/installer/util/google_update_settings.h" 40 #include "chrome/installer/util/google_update_settings.h"
41 #include "chrome/installer/util/helper.h" 41 #include "chrome/installer/util/helper.h"
42 #include "chrome/installer/util/install_util.h" 42 #include "chrome/installer/util/install_util.h"
43 #include "chrome/installer/util/installation_state.h" 43 #include "chrome/installer/util/installation_state.h"
44 #include "chrome/installer/util/installer_state.h" 44 #include "chrome/installer/util/installer_state.h"
45 #include "chrome/installer/util/logging_installer.h" 45 #include "chrome/installer/util/logging_installer.h"
46 #include "chrome/installer/util/self_cleaning_temp_dir.h" 46 #include "chrome/installer/util/self_cleaning_temp_dir.h"
47 #include "chrome/installer/util/shell_util.h" 47 #include "chrome/installer/util/shell_util.h"
48 #include "chrome/installer/util/util_constants.h" 48 #include "chrome/installer/util/util_constants.h"
49 #include "chrome/installer/util/work_item.h"
49 #include "content/public/common/result_codes.h" 50 #include "content/public/common/result_codes.h"
50 #include "rlz/lib/rlz_lib.h" 51 #include "rlz/lib/rlz_lib.h"
51 52
52 using base::win::RegKey; 53 using base::win::RegKey;
53 54
54 namespace installer { 55 namespace installer {
55 56
56 namespace { 57 namespace {
57 58
58 // Avoid leaving behind a Temp dir. If one exists, ask SelfCleaningTempDir to 59 // Avoid leaving behind a Temp dir. If one exists, ask SelfCleaningTempDir to
(...skipping 28 matching lines...) Expand all
87 for (size_t i = 0; i < dist_types.size(); ++i) { 88 for (size_t i = 0; i < dist_types.size(); ++i) {
88 BrowserDistribution::Type dist_type = dist_types[i]; 89 BrowserDistribution::Type dist_type = dist_types[i];
89 const ProductState* product_state = 90 const ProductState* product_state =
90 original_state.GetProductState(system_level, dist_type); 91 original_state.GetProductState(system_level, dist_type);
91 // Only modify other products if they're installed and multi. 92 // Only modify other products if they're installed and multi.
92 if (product_state != NULL && 93 if (product_state != NULL &&
93 product_state->is_multi_install() && 94 product_state->is_multi_install() &&
94 !product_state->channel().Equals(channel_info)) { 95 !product_state->channel().Equals(channel_info)) {
95 BrowserDistribution* other_dist = 96 BrowserDistribution* other_dist =
96 BrowserDistribution::GetSpecificDistribution(dist_type); 97 BrowserDistribution::GetSpecificDistribution(dist_type);
97 update_list->AddSetRegValueWorkItem(reg_root, other_dist->GetStateKey(), 98 update_list->AddSetRegValueWorkItem(reg_root,
98 google_update::kRegApField, channel_info.value(), true); 99 other_dist->GetStateKey(),
100 google_update::kRegApField,
101 channel_info.value(),
102 true,
103 WorkItem::kWow64Default);
99 } else { 104 } else {
100 LOG_IF(ERROR, 105 LOG_IF(ERROR,
101 product_state != NULL && product_state->is_multi_install()) 106 product_state != NULL && product_state->is_multi_install())
102 << "Channel value for " 107 << "Channel value for "
103 << BrowserDistribution::GetSpecificDistribution( 108 << BrowserDistribution::GetSpecificDistribution(
104 dist_type)->GetDisplayName() 109 dist_type)->GetDisplayName()
105 << " is somehow already set to the desired new value of " 110 << " is somehow already set to the desired new value of "
106 << channel_info.value(); 111 << channel_info.value();
107 } 112 }
108 } 113 }
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 if (installer_state.system_install() || 679 if (installer_state.system_install() ||
675 !browser_entry_suffix.empty() || 680 !browser_entry_suffix.empty() ||
676 !base::win::RegKey(HKEY_LOCAL_MACHINE, (classes_path + prog_id).c_str(), 681 !base::win::RegKey(HKEY_LOCAL_MACHINE, (classes_path + prog_id).c_str(),
677 KEY_QUERY_VALUE).Valid()) { 682 KEY_QUERY_VALUE).Valid()) {
678 InstallUtil::ValueEquals prog_id_pred(prog_id); 683 InstallUtil::ValueEquals prog_id_pred(prog_id);
679 for (const wchar_t* const* filetype = 684 for (const wchar_t* const* filetype =
680 &ShellUtil::kPotentialFileAssociations[0]; *filetype != NULL; 685 &ShellUtil::kPotentialFileAssociations[0]; *filetype != NULL;
681 ++filetype) { 686 ++filetype) {
682 if (InstallUtil::DeleteRegistryValueIf( 687 if (InstallUtil::DeleteRegistryValueIf(
683 root, (classes_path + *filetype).c_str(), NULL, 688 root, (classes_path + *filetype).c_str(), NULL,
684 prog_id_pred) == InstallUtil::DELETED) { 689 prog_id_pred, WorkItem::kWow64Default) == InstallUtil::DELETED) {
685 cleared_assocs.push_back(*filetype); 690 cleared_assocs.push_back(*filetype);
686 } 691 }
687 } 692 }
688 } 693 }
689 694
690 // For all filetype associations in HKLM that have just been removed, attempt 695 // For all filetype associations in HKLM that have just been removed, attempt
691 // to restore some reasonable value. We have no definitive way of knowing 696 // to restore some reasonable value. We have no definitive way of knowing
692 // what handlers are the most appropriate, so we use a fixed mapping based on 697 // what handlers are the most appropriate, so we use a fixed mapping based on
693 // the default values for a fresh install of Windows. 698 // the default values for a fresh install of Windows.
694 if (root == HKEY_LOCAL_MACHINE) { 699 if (root == HKEY_LOCAL_MACHINE) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 if (!product.is_chrome() || !installer_state.system_install()) { 753 if (!product.is_chrome() || !installer_state.system_install()) {
749 const char* install_level = 754 const char* install_level =
750 installer_state.system_install() ? "system" : "user"; 755 installer_state.system_install() ? "system" : "user";
751 VLOG(1) << "No Active Setup processing to do for " << install_level 756 VLOG(1) << "No Active Setup processing to do for " << install_level
752 << "-level " << distribution->GetDisplayName(); 757 << "-level " << distribution->GetDisplayName();
753 return; 758 return;
754 } 759 }
755 760
756 const base::string16 active_setup_path( 761 const base::string16 active_setup_path(
757 InstallUtil::GetActiveSetupPath(distribution)); 762 InstallUtil::GetActiveSetupPath(distribution));
758 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, active_setup_path); 763 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, active_setup_path,
764 WorkItem::kWow64Default);
759 765
760 // Windows leaves keys behind in HKCU\\Software\\(Wow6432Node\\)?Microsoft\\ 766 // Windows leaves keys behind in HKCU\\Software\\(Wow6432Node\\)?Microsoft\\
761 // Active Setup\\Installed Components\\{guid} 767 // Active Setup\\Installed Components\\{guid}
762 // for every user that logged in since system-level Chrome was installed. 768 // for every user that logged in since system-level Chrome was installed.
763 // This is a problem because Windows compares the value of the Version subkey 769 // This is a problem because Windows compares the value of the Version subkey
764 // in there with the value of the Version subkey in the matching HKLM entries 770 // in there with the value of the Version subkey in the matching HKLM entries
765 // before running Chrome's Active Setup so if Chrome was to be reinstalled 771 // before running Chrome's Active Setup so if Chrome was to be reinstalled
766 // with a lesser version (e.g. switching back to a more stable channel), the 772 // with a lesser version (e.g. switching back to a more stable channel), the
767 // affected users would not have Chrome's Active Setup called until Chrome 773 // affected users would not have Chrome's Active Setup called until Chrome
768 // eventually updated passed that user's registered Version. 774 // eventually updated passed that user's registered Version.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 } 900 }
895 901
896 base::FilePath chrome_exe(installer_state.target_path().Append(kChromeExe)); 902 base::FilePath chrome_exe(installer_state.target_path().Append(kChromeExe));
897 903
898 // Delete Software\Classes\ChromeHTML. 904 // Delete Software\Classes\ChromeHTML.
899 const base::string16 prog_id( 905 const base::string16 prog_id(
900 dist->GetBrowserProgIdPrefix() + browser_entry_suffix); 906 dist->GetBrowserProgIdPrefix() + browser_entry_suffix);
901 base::string16 reg_prog_id(ShellUtil::kRegClasses); 907 base::string16 reg_prog_id(ShellUtil::kRegClasses);
902 reg_prog_id.push_back(base::FilePath::kSeparators[0]); 908 reg_prog_id.push_back(base::FilePath::kSeparators[0]);
903 reg_prog_id.append(prog_id); 909 reg_prog_id.append(prog_id);
904 InstallUtil::DeleteRegistryKey(root, reg_prog_id); 910 InstallUtil::DeleteRegistryKey(root, reg_prog_id, WorkItem::kWow64Default);
905 911
906 // Delete Software\Classes\Chrome. 912 // Delete Software\Classes\Chrome.
907 base::string16 reg_app_id(ShellUtil::kRegClasses); 913 base::string16 reg_app_id(ShellUtil::kRegClasses);
908 reg_app_id.push_back(base::FilePath::kSeparators[0]); 914 reg_app_id.push_back(base::FilePath::kSeparators[0]);
909 // Append the requested suffix manually here (as ShellUtil::GetBrowserModelId 915 // Append the requested suffix manually here (as ShellUtil::GetBrowserModelId
910 // would otherwise try to figure out the currently installed suffix). 916 // would otherwise try to figure out the currently installed suffix).
911 reg_app_id.append(dist->GetBaseAppId() + browser_entry_suffix); 917 reg_app_id.append(dist->GetBaseAppId() + browser_entry_suffix);
912 InstallUtil::DeleteRegistryKey(root, reg_app_id); 918 InstallUtil::DeleteRegistryKey(root, reg_app_id, WorkItem::kWow64Default);
913 919
914 // Delete all Start Menu Internet registrations that refer to this Chrome. 920 // Delete all Start Menu Internet registrations that refer to this Chrome.
915 { 921 {
916 using base::win::RegistryKeyIterator; 922 using base::win::RegistryKeyIterator;
917 InstallUtil::ProgramCompare open_command_pred(chrome_exe); 923 InstallUtil::ProgramCompare open_command_pred(chrome_exe);
918 base::string16 client_name; 924 base::string16 client_name;
919 base::string16 client_key; 925 base::string16 client_key;
920 base::string16 open_key; 926 base::string16 open_key;
921 for (RegistryKeyIterator iter(root, ShellUtil::kRegStartMenuInternet); 927 for (RegistryKeyIterator iter(root, ShellUtil::kRegStartMenuInternet);
922 iter.Valid(); ++iter) { 928 iter.Valid(); ++iter) {
923 client_name.assign(iter.Name()); 929 client_name.assign(iter.Name());
924 client_key.assign(ShellUtil::kRegStartMenuInternet) 930 client_key.assign(ShellUtil::kRegStartMenuInternet)
925 .append(1, L'\\') 931 .append(1, L'\\')
926 .append(client_name); 932 .append(client_name);
927 open_key.assign(client_key).append(ShellUtil::kRegShellOpen); 933 open_key.assign(client_key).append(ShellUtil::kRegShellOpen);
928 if (InstallUtil::DeleteRegistryKeyIf(root, client_key, open_key, NULL, 934 if (InstallUtil::DeleteRegistryKeyIf(root, client_key, open_key, NULL,
929 open_command_pred) != InstallUtil::NOT_FOUND) { 935 open_command_pred, WorkItem::kWow64Default)
936 != InstallUtil::NOT_FOUND) {
930 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it 937 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it
931 // references this Chrome (i.e., if it was made the default browser). 938 // references this Chrome (i.e., if it was made the default browser).
932 InstallUtil::DeleteRegistryValueIf( 939 InstallUtil::DeleteRegistryValueIf(
933 root, ShellUtil::kRegStartMenuInternet, NULL, 940 root, ShellUtil::kRegStartMenuInternet, NULL,
934 InstallUtil::ValueEquals(client_name)); 941 InstallUtil::ValueEquals(client_name), WorkItem::kWow64Default);
935 // Also delete the value for the default user if we're operating in 942 // Also delete the value for the default user if we're operating in
936 // HKLM. 943 // HKLM.
937 if (root == HKEY_LOCAL_MACHINE) { 944 if (root == HKEY_LOCAL_MACHINE) {
938 InstallUtil::DeleteRegistryValueIf( 945 InstallUtil::DeleteRegistryValueIf(
939 HKEY_USERS, 946 HKEY_USERS,
940 base::string16(L".DEFAULT\\").append( 947 base::string16(L".DEFAULT\\").append(
941 ShellUtil::kRegStartMenuInternet).c_str(), 948 ShellUtil::kRegStartMenuInternet).c_str(),
942 NULL, InstallUtil::ValueEquals(client_name)); 949 NULL, InstallUtil::ValueEquals(client_name),
950 WorkItem::kWow64Default);
943 } 951 }
944 } 952 }
945 } 953 }
946 } 954 }
947 955
948 // Delete Software\RegisteredApplications\Chromium 956 // Delete Software\RegisteredApplications\Chromium
949 InstallUtil::DeleteRegistryValue( 957 InstallUtil::DeleteRegistryValue(
950 root, ShellUtil::kRegRegisteredApplications, 958 root, ShellUtil::kRegRegisteredApplications,
951 dist->GetBaseAppName() + browser_entry_suffix); 959 dist->GetBaseAppName() + browser_entry_suffix);
952 960
953 // Delete the App Paths and Applications keys that let Explorer find Chrome: 961 // Delete the App Paths and Applications keys that let Explorer find Chrome:
954 // http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121 962 // http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121
955 base::string16 app_key(ShellUtil::kRegClasses); 963 base::string16 app_key(ShellUtil::kRegClasses);
956 app_key.push_back(base::FilePath::kSeparators[0]); 964 app_key.push_back(base::FilePath::kSeparators[0]);
957 app_key.append(L"Applications"); 965 app_key.append(L"Applications");
958 app_key.push_back(base::FilePath::kSeparators[0]); 966 app_key.push_back(base::FilePath::kSeparators[0]);
959 app_key.append(installer::kChromeExe); 967 app_key.append(installer::kChromeExe);
960 InstallUtil::DeleteRegistryKey(root, app_key); 968 InstallUtil::DeleteRegistryKey(root, app_key, WorkItem::kWow64Default);
961 969
962 base::string16 app_path_key(ShellUtil::kAppPathsRegistryKey); 970 base::string16 app_path_key(ShellUtil::kAppPathsRegistryKey);
963 app_path_key.push_back(base::FilePath::kSeparators[0]); 971 app_path_key.push_back(base::FilePath::kSeparators[0]);
964 app_path_key.append(installer::kChromeExe); 972 app_path_key.append(installer::kChromeExe);
965 InstallUtil::DeleteRegistryKey(root, app_path_key); 973 InstallUtil::DeleteRegistryKey(root, app_path_key, WorkItem::kWow64Default);
966 974
967 // Cleanup OpenWithList and OpenWithProgids: 975 // Cleanup OpenWithList and OpenWithProgids:
968 // http://msdn.microsoft.com/en-us/library/bb166549 976 // http://msdn.microsoft.com/en-us/library/bb166549
969 base::string16 file_assoc_key; 977 base::string16 file_assoc_key;
970 base::string16 open_with_list_key; 978 base::string16 open_with_list_key;
971 base::string16 open_with_progids_key; 979 base::string16 open_with_progids_key;
972 for (int i = 0; ShellUtil::kPotentialFileAssociations[i] != NULL; ++i) { 980 for (int i = 0; ShellUtil::kPotentialFileAssociations[i] != NULL; ++i) {
973 file_assoc_key.assign(ShellUtil::kRegClasses); 981 file_assoc_key.assign(ShellUtil::kRegClasses);
974 file_assoc_key.push_back(base::FilePath::kSeparators[0]); 982 file_assoc_key.push_back(base::FilePath::kSeparators[0]);
975 file_assoc_key.append(ShellUtil::kPotentialFileAssociations[i]); 983 file_assoc_key.append(ShellUtil::kPotentialFileAssociations[i]);
976 file_assoc_key.push_back(base::FilePath::kSeparators[0]); 984 file_assoc_key.push_back(base::FilePath::kSeparators[0]);
977 985
978 open_with_list_key.assign(file_assoc_key); 986 open_with_list_key.assign(file_assoc_key);
979 open_with_list_key.append(L"OpenWithList"); 987 open_with_list_key.append(L"OpenWithList");
980 open_with_list_key.push_back(base::FilePath::kSeparators[0]); 988 open_with_list_key.push_back(base::FilePath::kSeparators[0]);
981 open_with_list_key.append(installer::kChromeExe); 989 open_with_list_key.append(installer::kChromeExe);
982 InstallUtil::DeleteRegistryKey(root, open_with_list_key); 990 InstallUtil::DeleteRegistryKey(
991 root, open_with_list_key, WorkItem::kWow64Default);
983 992
984 open_with_progids_key.assign(file_assoc_key); 993 open_with_progids_key.assign(file_assoc_key);
985 open_with_progids_key.append(ShellUtil::kRegOpenWithProgids); 994 open_with_progids_key.append(ShellUtil::kRegOpenWithProgids);
986 InstallUtil::DeleteRegistryValue(root, open_with_progids_key, prog_id); 995 InstallUtil::DeleteRegistryValue(root, open_with_progids_key, prog_id);
987 } 996 }
988 997
989 // Cleanup in case Chrome had been made the default browser. 998 // Cleanup in case Chrome had been made the default browser.
990 999
991 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it 1000 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it
992 // references this Chrome. Do this explicitly here for the case where HKCU is 1001 // references this Chrome. Do this explicitly here for the case where HKCU is
993 // being processed; the iteration above will have no hits since registration 1002 // being processed; the iteration above will have no hits since registration
994 // lives in HKLM. 1003 // lives in HKLM.
995 InstallUtil::DeleteRegistryValueIf( 1004 InstallUtil::DeleteRegistryValueIf(
996 root, ShellUtil::kRegStartMenuInternet, NULL, 1005 root, ShellUtil::kRegStartMenuInternet, NULL,
997 InstallUtil::ValueEquals(dist->GetBaseAppName() + browser_entry_suffix)); 1006 InstallUtil::ValueEquals(dist->GetBaseAppName() + browser_entry_suffix),
1007 WorkItem::kWow64Default);
998 1008
999 // Delete each protocol association if it references this Chrome. 1009 // Delete each protocol association if it references this Chrome.
1000 InstallUtil::ProgramCompare open_command_pred(chrome_exe); 1010 InstallUtil::ProgramCompare open_command_pred(chrome_exe);
1001 base::string16 parent_key(ShellUtil::kRegClasses); 1011 base::string16 parent_key(ShellUtil::kRegClasses);
1002 parent_key.push_back(base::FilePath::kSeparators[0]); 1012 parent_key.push_back(base::FilePath::kSeparators[0]);
1003 const base::string16::size_type base_length = parent_key.size(); 1013 const base::string16::size_type base_length = parent_key.size();
1004 base::string16 child_key; 1014 base::string16 child_key;
1005 for (const wchar_t* const* proto = 1015 for (const wchar_t* const* proto =
1006 &ShellUtil::kPotentialProtocolAssociations[0]; 1016 &ShellUtil::kPotentialProtocolAssociations[0];
1007 *proto != NULL; 1017 *proto != NULL;
1008 ++proto) { 1018 ++proto) {
1009 parent_key.resize(base_length); 1019 parent_key.resize(base_length);
1010 parent_key.append(*proto); 1020 parent_key.append(*proto);
1011 child_key.assign(parent_key).append(ShellUtil::kRegShellOpen); 1021 child_key.assign(parent_key).append(ShellUtil::kRegShellOpen);
1012 InstallUtil::DeleteRegistryKeyIf(root, parent_key, child_key, NULL, 1022 InstallUtil::DeleteRegistryKeyIf(root, parent_key, child_key, NULL,
1013 open_command_pred); 1023 open_command_pred,
1024 WorkItem::kWow64Default);
1014 } 1025 }
1015 1026
1016 RemoveFiletypeRegistration(installer_state, root, browser_entry_suffix); 1027 RemoveFiletypeRegistration(installer_state, root, browser_entry_suffix);
1017 1028
1018 *exit_code = installer::UNINSTALL_SUCCESSFUL; 1029 *exit_code = installer::UNINSTALL_SUCCESSFUL;
1019 return true; 1030 return true;
1020 } 1031 }
1021 1032
1022 void RemoveChromeLegacyRegistryKeys(BrowserDistribution* dist, 1033 void RemoveChromeLegacyRegistryKeys(BrowserDistribution* dist,
1023 const base::string16& chrome_exe) { 1034 const base::string16& chrome_exe) {
(...skipping 11 matching lines...) Expand all
1035 for (size_t i = 0; i < arraysize(roots); ++i) { 1046 for (size_t i = 0; i < arraysize(roots); ++i) {
1036 base::string16 suffix; 1047 base::string16 suffix;
1037 if (roots[i] == HKEY_LOCAL_MACHINE) 1048 if (roots[i] == HKEY_LOCAL_MACHINE)
1038 suffix = ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe); 1049 suffix = ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe);
1039 1050
1040 // Delete Software\Classes\ChromeExt, 1051 // Delete Software\Classes\ChromeExt,
1041 base::string16 ext_prog_id(ShellUtil::kRegClasses); 1052 base::string16 ext_prog_id(ShellUtil::kRegClasses);
1042 ext_prog_id.push_back(base::FilePath::kSeparators[0]); 1053 ext_prog_id.push_back(base::FilePath::kSeparators[0]);
1043 ext_prog_id.append(kChromeExtProgId); 1054 ext_prog_id.append(kChromeExtProgId);
1044 ext_prog_id.append(suffix); 1055 ext_prog_id.append(suffix);
1045 InstallUtil::DeleteRegistryKey(roots[i], ext_prog_id); 1056 InstallUtil::DeleteRegistryKey(roots[i], ext_prog_id,
1057 WorkItem::kWow64Default);
1046 1058
1047 // Delete Software\Classes\.crx, 1059 // Delete Software\Classes\.crx,
1048 base::string16 ext_association(ShellUtil::kRegClasses); 1060 base::string16 ext_association(ShellUtil::kRegClasses);
1049 ext_association.append(L"\\"); 1061 ext_association.append(L"\\");
1050 ext_association.append(L".crx"); 1062 ext_association.append(L".crx");
1051 InstallUtil::DeleteRegistryKey(roots[i], ext_association); 1063 InstallUtil::DeleteRegistryKey(roots[i], ext_association,
1064 WorkItem::kWow64Default);
1052 } 1065 }
1053 } 1066 }
1054 1067
1055 void UninstallFirewallRules(BrowserDistribution* dist, 1068 void UninstallFirewallRules(BrowserDistribution* dist,
1056 const base::FilePath& chrome_exe) { 1069 const base::FilePath& chrome_exe) {
1057 scoped_ptr<FirewallManager> manager = 1070 scoped_ptr<FirewallManager> manager =
1058 FirewallManager::Create(dist, chrome_exe); 1071 FirewallManager::Create(dist, chrome_exe);
1059 if (manager) 1072 if (manager)
1060 manager->RemoveFirewallRules(); 1073 manager->RemoveFirewallRules();
1061 } 1074 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 } 1134 }
1122 1135
1123 if (is_chrome) { 1136 if (is_chrome) {
1124 // Chrome is not in use so lets uninstall Chrome by deleting various files 1137 // Chrome is not in use so lets uninstall Chrome by deleting various files
1125 // and registry entries. Here we will just make best effort and keep going 1138 // and registry entries. Here we will just make best effort and keep going
1126 // in case of errors. 1139 // in case of errors.
1127 ClearRlzProductState(); 1140 ClearRlzProductState();
1128 // Delete the key that delegate_execute might make. 1141 // Delete the key that delegate_execute might make.
1129 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 1142 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
1130 InstallUtil::DeleteRegistryKey(HKEY_CURRENT_USER, 1143 InstallUtil::DeleteRegistryKey(HKEY_CURRENT_USER,
1131 chrome::kMetroRegistryPath); 1144 chrome::kMetroRegistryPath,
1145 WorkItem::kWow64Default);
1132 } 1146 }
1133 1147
1134 auto_launch_util::DisableAllAutoStartFeatures( 1148 auto_launch_util::DisableAllAutoStartFeatures(
1135 base::ASCIIToUTF16(chrome::kInitialProfile)); 1149 base::ASCIIToUTF16(chrome::kInitialProfile));
1136 1150
1137 // If user-level chrome is self-destructing as a result of encountering a 1151 // If user-level chrome is self-destructing as a result of encountering a
1138 // system-level chrome, retarget owned non-default shortcuts (app shortcuts, 1152 // system-level chrome, retarget owned non-default shortcuts (app shortcuts,
1139 // profile shortcuts, etc.) to the system-level chrome. 1153 // profile shortcuts, etc.) to the system-level chrome.
1140 if (cmd_line.HasSwitch(installer::switches::kSelfDestruct) && 1154 if (cmd_line.HasSwitch(installer::switches::kSelfDestruct) &&
1141 !installer_state.system_install()) { 1155 !installer_state.system_install()) {
(...skipping 16 matching lines...) Expand all
1158 // Delete the registry keys (Uninstall key and Version key). 1172 // Delete the registry keys (Uninstall key and Version key).
1159 HKEY reg_root = installer_state.root_key(); 1173 HKEY reg_root = installer_state.root_key();
1160 1174
1161 // Note that we must retrieve the distribution-specific data before deleting 1175 // Note that we must retrieve the distribution-specific data before deleting
1162 // product.GetVersionKey(). 1176 // product.GetVersionKey().
1163 base::string16 distribution_data(browser_dist->GetDistributionData(reg_root)); 1177 base::string16 distribution_data(browser_dist->GetDistributionData(reg_root));
1164 1178
1165 // Remove Control Panel uninstall link. 1179 // Remove Control Panel uninstall link.
1166 if (product.ShouldCreateUninstallEntry()) { 1180 if (product.ShouldCreateUninstallEntry()) {
1167 InstallUtil::DeleteRegistryKey(reg_root, 1181 InstallUtil::DeleteRegistryKey(reg_root,
1168 browser_dist->GetUninstallRegPath()); 1182 browser_dist->GetUninstallRegPath(),
1183 WorkItem::kWow64Default);
1169 } 1184 }
1170 1185
1171 // Remove Omaha product key. 1186 // Remove Omaha product key.
1172 InstallUtil::DeleteRegistryKey(reg_root, browser_dist->GetVersionKey()); 1187 InstallUtil::DeleteRegistryKey(reg_root, browser_dist->GetVersionKey(),
1188 WorkItem::kWow64Default);
1173 1189
1174 // Also try to delete the MSI value in the ClientState key (it might not be 1190 // Also try to delete the MSI value in the ClientState key (it might not be
1175 // there). This is due to a Google Update behaviour where an uninstall and a 1191 // there). This is due to a Google Update behaviour where an uninstall and a
1176 // rapid reinstall might result in stale values from the old ClientState key 1192 // rapid reinstall might result in stale values from the old ClientState key
1177 // being picked up on reinstall. 1193 // being picked up on reinstall.
1178 product.SetMsiMarker(installer_state.system_install(), false); 1194 product.SetMsiMarker(installer_state.system_install(), false);
1179 1195
1180 InstallStatus ret = installer::UNKNOWN_STATUS; 1196 InstallStatus ret = installer::UNKNOWN_STATUS;
1181 1197
1182 if (is_chrome) { 1198 if (is_chrome) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 chrome_launcher_support::InstallationState level_to_check = 1270 chrome_launcher_support::InstallationState level_to_check =
1255 installer_state.system_install() ? 1271 installer_state.system_install() ?
1256 chrome_launcher_support::INSTALLED_AT_SYSTEM_LEVEL : 1272 chrome_launcher_support::INSTALLED_AT_SYSTEM_LEVEL :
1257 chrome_launcher_support::INSTALLED_AT_USER_LEVEL; 1273 chrome_launcher_support::INSTALLED_AT_USER_LEVEL;
1258 bool has_legacy_app_launcher = level_to_check == 1274 bool has_legacy_app_launcher = level_to_check ==
1259 chrome_launcher_support::GetAppLauncherInstallationState(); 1275 chrome_launcher_support::GetAppLauncherInstallationState();
1260 if (!has_legacy_app_launcher) { 1276 if (!has_legacy_app_launcher) {
1261 BrowserDistribution* shadow_app_launcher_dist = 1277 BrowserDistribution* shadow_app_launcher_dist =
1262 BrowserDistribution::GetSpecificDistribution( 1278 BrowserDistribution::GetSpecificDistribution(
1263 BrowserDistribution::CHROME_APP_HOST); 1279 BrowserDistribution::CHROME_APP_HOST);
1264 InstallUtil::DeleteRegistryKey(reg_root, 1280 InstallUtil::DeleteRegistryKey(
1265 shadow_app_launcher_dist->GetVersionKey()); 1281 reg_root,
1282 shadow_app_launcher_dist->GetVersionKey(),
1283 WorkItem::kWow64Default);
1266 } 1284 }
1267 } 1285 }
1268 } 1286 }
1269 1287
1270 if (installer_state.is_multi_install()) 1288 if (installer_state.is_multi_install())
1271 ProcessGoogleUpdateItems(original_state, installer_state, product); 1289 ProcessGoogleUpdateItems(original_state, installer_state, product);
1272 1290
1273 // Get the state of the installed product (if any) 1291 // Get the state of the installed product (if any)
1274 const ProductState* product_state = 1292 const ProductState* product_state =
1275 original_state.GetProductState(installer_state.system_install(), 1293 original_state.GetProductState(installer_state.system_install(),
1276 browser_dist->GetType()); 1294 browser_dist->GetType());
1277 1295
1278 // Delete shared registry keys as well (these require admin rights) if 1296 // Delete shared registry keys as well (these require admin rights) if
1279 // remove_all option is specified. 1297 // remove_all option is specified.
1280 if (remove_all) { 1298 if (remove_all) {
1281 if (!InstallUtil::IsChromeSxSProcess() && is_chrome) { 1299 if (!InstallUtil::IsChromeSxSProcess() && is_chrome) {
1282 // Delete media player registry key that exists only in HKLM. 1300 // Delete media player registry key that exists only in HKLM.
1283 // We don't delete this key in SxS uninstall or Chrome Frame uninstall 1301 // We don't delete this key in SxS uninstall or Chrome Frame uninstall
1284 // as we never set the key for those products. 1302 // as we never set the key for those products.
1285 base::string16 reg_path(installer::kMediaPlayerRegPath); 1303 base::string16 reg_path(installer::kMediaPlayerRegPath);
1286 reg_path.push_back(base::FilePath::kSeparators[0]); 1304 reg_path.push_back(base::FilePath::kSeparators[0]);
1287 reg_path.append(installer::kChromeExe); 1305 reg_path.append(installer::kChromeExe);
1288 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, reg_path); 1306 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, reg_path,
1307 WorkItem::kWow64Default);
1289 } 1308 }
1290 1309
1291 // Unregister any dll servers that we may have registered for this 1310 // Unregister any dll servers that we may have registered for this
1292 // product. 1311 // product.
1293 if (product_state != NULL) { 1312 if (product_state != NULL) {
1294 std::vector<base::FilePath> com_dll_list; 1313 std::vector<base::FilePath> com_dll_list;
1295 product.AddComDllList(&com_dll_list); 1314 product.AddComDllList(&com_dll_list);
1296 base::FilePath dll_folder = installer_state.target_path().AppendASCII( 1315 base::FilePath dll_folder = installer_state.target_path().AppendASCII(
1297 product_state->version().GetString()); 1316 product_state->version().GetString());
1298 1317
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 // If we need a reboot to continue, schedule the parent directories for 1457 // If we need a reboot to continue, schedule the parent directories for
1439 // deletion unconditionally. If they are not empty, the session manager 1458 // deletion unconditionally. If they are not empty, the session manager
1440 // will not delete them on reboot. 1459 // will not delete them on reboot.
1441 ScheduleParentAndGrandparentForDeletion(target_path); 1460 ScheduleParentAndGrandparentForDeletion(target_path);
1442 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { 1461 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) {
1443 *uninstall_status = UNINSTALL_FAILED; 1462 *uninstall_status = UNINSTALL_FAILED;
1444 } 1463 }
1445 } 1464 }
1446 1465
1447 } // namespace installer 1466 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698