Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 23 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/win/registry.h" | 26 #include "base/win/registry.h" |
| 27 #include "base/win/scoped_handle.h" | 27 #include "base/win/scoped_handle.h" |
| 28 #include "base/win/shortcut.h" | 28 #include "base/win/shortcut.h" |
| 29 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
| 30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/chrome_result_codes.h" | 32 #include "chrome/common/chrome_result_codes.h" |
| 33 #include "chrome/installer/setup/app_launcher_installer.h" | 33 #include "chrome/installer/setup/app_launcher_installer.h" |
|
grt (UTC plus 2)
2016/08/02 07:28:21
is this now unused? please remove if so.
| |
| 34 #include "chrome/installer/setup/install.h" | 34 #include "chrome/installer/setup/install.h" |
| 35 #include "chrome/installer/setup/install_worker.h" | 35 #include "chrome/installer/setup/install_worker.h" |
| 36 #include "chrome/installer/setup/setup_constants.h" | 36 #include "chrome/installer/setup/setup_constants.h" |
| 37 #include "chrome/installer/setup/setup_util.h" | 37 #include "chrome/installer/setup/setup_util.h" |
| 38 #include "chrome/installer/setup/user_hive_visitor.h" | 38 #include "chrome/installer/setup/user_hive_visitor.h" |
| 39 #include "chrome/installer/util/auto_launch_util.h" | 39 #include "chrome/installer/util/auto_launch_util.h" |
| 40 #include "chrome/installer/util/browser_distribution.h" | 40 #include "chrome/installer/util/browser_distribution.h" |
| 41 #include "chrome/installer/util/channel_info.h" | 41 #include "chrome/installer/util/channel_info.h" |
| 42 #include "chrome/installer/util/delete_after_reboot_helper.h" | 42 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 43 #include "chrome/installer/util/firewall_manager_win.h" | 43 #include "chrome/installer/util/firewall_manager_win.h" |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1146 if (is_chrome) { | 1146 if (is_chrome) { |
| 1147 const base::string16 suffix( | 1147 const base::string16 suffix( |
| 1148 ShellUtil::GetCurrentInstallationSuffix(browser_dist, chrome_exe)); | 1148 ShellUtil::GetCurrentInstallationSuffix(browser_dist, chrome_exe)); |
| 1149 | 1149 |
| 1150 // Remove all Chrome registration keys. | 1150 // Remove all Chrome registration keys. |
| 1151 // Registration data is put in HKCU for both system level and user level | 1151 // Registration data is put in HKCU for both system level and user level |
| 1152 // installs. | 1152 // installs. |
| 1153 DeleteChromeRegistrationKeys(installer_state, browser_dist, | 1153 DeleteChromeRegistrationKeys(installer_state, browser_dist, |
| 1154 HKEY_CURRENT_USER, suffix, &ret); | 1154 HKEY_CURRENT_USER, suffix, &ret); |
| 1155 | 1155 |
| 1156 #if defined(GOOGLE_CHROME_BUILD) | |
| 1157 if (!InstallUtil::IsChromeSxSProcess()) | |
| 1158 RemoveAppLauncherVersionKey(reg_root); | |
| 1159 #endif // GOOGLE_CHROME_BUILD | |
| 1160 | |
| 1161 // If the user's Chrome is registered with a suffix: it is possible that old | 1156 // If the user's Chrome is registered with a suffix: it is possible that old |
| 1162 // unsuffixed registrations were left in HKCU (e.g. if this install was | 1157 // unsuffixed registrations were left in HKCU (e.g. if this install was |
| 1163 // previously installed with no suffix in HKCU (old suffix rules if the user | 1158 // previously installed with no suffix in HKCU (old suffix rules if the user |
| 1164 // is not an admin (or declined UAC at first run)) and later had to be | 1159 // is not an admin (or declined UAC at first run)) and later had to be |
| 1165 // suffixed when fully registered in HKLM (e.g. when later making Chrome | 1160 // suffixed when fully registered in HKLM (e.g. when later making Chrome |
| 1166 // default through the UI)). | 1161 // default through the UI)). |
| 1167 // Remove remaining HKCU entries with no suffix if any. | 1162 // Remove remaining HKCU entries with no suffix if any. |
| 1168 if (!suffix.empty()) { | 1163 if (!suffix.empty()) { |
| 1169 DeleteChromeRegistrationKeys(installer_state, browser_dist, | 1164 DeleteChromeRegistrationKeys(installer_state, browser_dist, |
| 1170 HKEY_CURRENT_USER, base::string16(), &ret); | 1165 HKEY_CURRENT_USER, base::string16(), &ret); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1379 // If we need a reboot to continue, schedule the parent directories for | 1374 // If we need a reboot to continue, schedule the parent directories for |
| 1380 // deletion unconditionally. If they are not empty, the session manager | 1375 // deletion unconditionally. If they are not empty, the session manager |
| 1381 // will not delete them on reboot. | 1376 // will not delete them on reboot. |
| 1382 ScheduleParentAndGrandparentForDeletion(target_path); | 1377 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1383 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1378 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
| 1384 *uninstall_status = UNINSTALL_FAILED; | 1379 *uninstall_status = UNINSTALL_FAILED; |
| 1385 } | 1380 } |
| 1386 } | 1381 } |
| 1387 | 1382 |
| 1388 } // namespace installer | 1383 } // namespace installer |
| OLD | NEW |