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/uninstall.cc

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 ScopedTokenPrivilege se_backup_name_privilege(SE_BACKUP_NAME); 796 ScopedTokenPrivilege se_backup_name_privilege(SE_BACKUP_NAME);
797 if (!se_restore_name_privilege.is_enabled() || 797 if (!se_restore_name_privilege.is_enabled() ||
798 !se_backup_name_privilege.is_enabled()) { 798 !se_backup_name_privilege.is_enabled()) {
799 // This is not a critical failure as those privileges aren't required to 799 // This is not a critical failure as those privileges aren't required to
800 // clean hives that are already loaded, but attempts to LoadRegKey() below 800 // clean hives that are already loaded, but attempts to LoadRegKey() below
801 // will fail. 801 // will fail.
802 LOG(WARNING) << "Failed to enable privileges required to load registry " 802 LOG(WARNING) << "Failed to enable privileges required to load registry "
803 "hives."; 803 "hives.";
804 } 804 }
805 805
806 for (base::win::RegistryKeyIterator it(HKEY_LOCAL_MACHINE, kProfileList); 806 for (base::win::RegistryKeyIterator it(HKEY_LOCAL_MACHINE, kProfileList, 0);
807 it.Valid(); ++it) { 807 it.Valid(); ++it) {
808 const wchar_t* profile_sid = it.Name(); 808 const wchar_t* profile_sid = it.Name();
809 809
810 // First check if this user's registry hive needs to be loaded in 810 // First check if this user's registry hive needs to be loaded in
811 // HKEY_USERS. 811 // HKEY_USERS.
812 base::win::RegKey user_reg_root_probe( 812 base::win::RegKey user_reg_root_probe(
813 HKEY_USERS, profile_sid, KEY_READ); 813 HKEY_USERS, profile_sid, KEY_READ);
814 bool loaded_hive = false; 814 bool loaded_hive = false;
815 if (!user_reg_root_probe.Valid()) { 815 if (!user_reg_root_probe.Valid()) {
816 VLOG(1) << "Attempting to load registry hive for " << profile_sid; 816 VLOG(1) << "Attempting to load registry hive for " << profile_sid;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 reg_app_id.append(dist->GetBaseAppId() + browser_entry_suffix); 931 reg_app_id.append(dist->GetBaseAppId() + browser_entry_suffix);
932 InstallUtil::DeleteRegistryKey(root, reg_app_id, WorkItem::kWow64Default); 932 InstallUtil::DeleteRegistryKey(root, reg_app_id, WorkItem::kWow64Default);
933 933
934 // Delete all Start Menu Internet registrations that refer to this Chrome. 934 // Delete all Start Menu Internet registrations that refer to this Chrome.
935 { 935 {
936 using base::win::RegistryKeyIterator; 936 using base::win::RegistryKeyIterator;
937 InstallUtil::ProgramCompare open_command_pred(chrome_exe); 937 InstallUtil::ProgramCompare open_command_pred(chrome_exe);
938 base::string16 client_name; 938 base::string16 client_name;
939 base::string16 client_key; 939 base::string16 client_key;
940 base::string16 open_key; 940 base::string16 open_key;
941 for (RegistryKeyIterator iter(root, ShellUtil::kRegStartMenuInternet); 941 for (RegistryKeyIterator iter(root, ShellUtil::kRegStartMenuInternet, 0);
942 iter.Valid(); ++iter) { 942 iter.Valid();
943 ++iter) {
943 client_name.assign(iter.Name()); 944 client_name.assign(iter.Name());
944 client_key.assign(ShellUtil::kRegStartMenuInternet) 945 client_key.assign(ShellUtil::kRegStartMenuInternet)
945 .append(1, L'\\') 946 .append(1, L'\\')
946 .append(client_name); 947 .append(client_name);
947 open_key.assign(client_key).append(ShellUtil::kRegShellOpen); 948 open_key.assign(client_key).append(ShellUtil::kRegShellOpen);
948 if (InstallUtil::DeleteRegistryKeyIf(root, client_key, open_key, 949 if (InstallUtil::DeleteRegistryKeyIf(root, client_key, open_key,
949 WorkItem::kWow64Default, NULL, open_command_pred) 950 WorkItem::kWow64Default, NULL, open_command_pred)
950 != InstallUtil::NOT_FOUND) { 951 != InstallUtil::NOT_FOUND) {
951 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it 952 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it
952 // references this Chrome (i.e., if it was made the default browser). 953 // references this Chrome (i.e., if it was made the default browser).
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 // If we need a reboot to continue, schedule the parent directories for 1468 // If we need a reboot to continue, schedule the parent directories for
1468 // deletion unconditionally. If they are not empty, the session manager 1469 // deletion unconditionally. If they are not empty, the session manager
1469 // will not delete them on reboot. 1470 // will not delete them on reboot.
1470 ScheduleParentAndGrandparentForDeletion(target_path); 1471 ScheduleParentAndGrandparentForDeletion(target_path);
1471 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { 1472 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) {
1472 *uninstall_status = UNINSTALL_FAILED; 1473 *uninstall_status = UNINSTALL_FAILED;
1473 } 1474 }
1474 } 1475 }
1475 1476
1476 } // namespace installer 1477 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698