OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file 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 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 const ProductState* product_state = | 988 const ProductState* product_state = |
989 original_state.GetProductState(installer_state.system_install()); | 989 original_state.GetProductState(installer_state.system_install()); |
990 | 990 |
991 // Remove the event log provider registration as we are going to delete | 991 // Remove the event log provider registration as we are going to delete |
992 // the file which serves the resources anyways. | 992 // the file which serves the resources anyways. |
993 DeRegisterEventLogProvider(); | 993 DeRegisterEventLogProvider(); |
994 | 994 |
995 // Delete shared registry keys as well (these require admin rights) if | 995 // Delete shared registry keys as well (these require admin rights) if |
996 // remove_all option is specified. | 996 // remove_all option is specified. |
997 if (remove_all) { | 997 if (remove_all) { |
998 if (!InstallUtil::IsChromeSxSProcess()) { | 998 if (installer_state.system_install()) { |
999 // Delete media player registry key that exists only in HKLM. We don't | 999 // Delete media player registry key that exists only in HKLM. |
1000 // delete this key in SxS uninstall as we never set the key for it. | |
1001 base::string16 reg_path(installer::kMediaPlayerRegPath); | 1000 base::string16 reg_path(installer::kMediaPlayerRegPath); |
1002 reg_path.push_back(base::FilePath::kSeparators[0]); | 1001 reg_path.push_back(base::FilePath::kSeparators[0]); |
1003 reg_path.append(installer::kChromeExe); | 1002 reg_path.append(installer::kChromeExe); |
1004 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, reg_path, | 1003 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, reg_path, |
1005 WorkItem::kWow64Default); | 1004 WorkItem::kWow64Default); |
1006 } | 1005 } |
1007 } | 1006 } |
1008 | 1007 |
1009 // Finally delete all the files from Chrome folder after moving setup.exe | 1008 // Finally delete all the files from Chrome folder after moving setup.exe |
1010 // and the user's Local State to a temp location. | 1009 // and the user's Local State to a temp location. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 // If we need a reboot to continue, schedule the parent directories for | 1104 // If we need a reboot to continue, schedule the parent directories for |
1106 // deletion unconditionally. If they are not empty, the session manager | 1105 // deletion unconditionally. If they are not empty, the session manager |
1107 // will not delete them on reboot. | 1106 // will not delete them on reboot. |
1108 ScheduleParentAndGrandparentForDeletion(target_path); | 1107 ScheduleParentAndGrandparentForDeletion(target_path); |
1109 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1108 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
1110 *uninstall_status = UNINSTALL_FAILED; | 1109 *uninstall_status = UNINSTALL_FAILED; |
1111 } | 1110 } |
1112 } | 1111 } |
1113 | 1112 |
1114 } // namespace installer | 1113 } // namespace installer |
OLD | NEW |