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 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "base/win/registry.h" | 20 #include "base/win/registry.h" |
21 #include "base/win/scoped_handle.h" | 21 #include "base/win/scoped_handle.h" |
22 #include "base/win/shortcut.h" | 22 #include "base/win/shortcut.h" |
23 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
24 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
25 #include "chrome/common/chrome_paths_internal.h" | 25 #include "chrome/common/chrome_paths_internal.h" |
26 #include "chrome/common/chrome_result_codes.h" | 26 #include "chrome/common/chrome_result_codes.h" |
27 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | |
28 #include "chrome/installer/setup/install.h" | 27 #include "chrome/installer/setup/install.h" |
29 #include "chrome/installer/setup/install_worker.h" | 28 #include "chrome/installer/setup/install_worker.h" |
30 #include "chrome/installer/setup/setup_constants.h" | 29 #include "chrome/installer/setup/setup_constants.h" |
31 #include "chrome/installer/setup/setup_util.h" | 30 #include "chrome/installer/setup/setup_util.h" |
32 #include "chrome/installer/util/auto_launch_util.h" | 31 #include "chrome/installer/util/auto_launch_util.h" |
33 #include "chrome/installer/util/browser_distribution.h" | 32 #include "chrome/installer/util/browser_distribution.h" |
34 #include "chrome/installer/util/channel_info.h" | 33 #include "chrome/installer/util/channel_info.h" |
35 #include "chrome/installer/util/delete_after_reboot_helper.h" | 34 #include "chrome/installer/util/delete_after_reboot_helper.h" |
36 #include "chrome/installer/util/google_update_constants.h" | 35 #include "chrome/installer/util/google_update_constants.h" |
37 #include "chrome/installer/util/google_update_settings.h" | 36 #include "chrome/installer/util/google_update_settings.h" |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 | 1224 |
1226 ProcessDelegateExecuteWorkItems(installer_state, product); | 1225 ProcessDelegateExecuteWorkItems(installer_state, product); |
1227 | 1226 |
1228 ProcessOnOsUpgradeWorkItems(installer_state, product); | 1227 ProcessOnOsUpgradeWorkItems(installer_state, product); |
1229 | 1228 |
1230 UninstallActiveSetupEntries(installer_state, product); | 1229 UninstallActiveSetupEntries(installer_state, product); |
1231 | 1230 |
1232 // Notify the shell that associations have changed since Chrome was likely | 1231 // Notify the shell that associations have changed since Chrome was likely |
1233 // unregistered. | 1232 // unregistered. |
1234 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); | 1233 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); |
1235 | |
1236 // TODO(huangs): Implement actual migration code and remove the hack below. | |
1237 // Remove the "shadow" App Launcher registry keys. | |
1238 if (installer_state.is_multi_install()) { | |
1239 // If we're not uninstalling the legacy App Launcher, and if it was | |
1240 // not installed in the first place, then delete the "shadow" keys. | |
1241 chrome_launcher_support::InstallationState level_to_check = | |
1242 installer_state.system_install() ? | |
1243 chrome_launcher_support::INSTALLED_AT_SYSTEM_LEVEL : | |
1244 chrome_launcher_support::INSTALLED_AT_USER_LEVEL; | |
1245 bool has_legacy_app_launcher = level_to_check == | |
1246 chrome_launcher_support::GetAppLauncherInstallationState(); | |
1247 if (!has_legacy_app_launcher) { | |
1248 BrowserDistribution* shadow_app_launcher_dist = | |
1249 BrowserDistribution::GetSpecificDistribution( | |
1250 BrowserDistribution::CHROME_APP_HOST); | |
1251 InstallUtil::DeleteRegistryKey(reg_root, | |
1252 shadow_app_launcher_dist->GetVersionKey()); | |
1253 } | |
1254 } | |
1255 } | 1234 } |
1256 | 1235 |
1257 if (product.is_chrome_frame()) { | 1236 if (product.is_chrome_frame()) { |
1258 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, | 1237 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, |
1259 product); | 1238 product); |
1260 } | 1239 } |
1261 | 1240 |
1262 if (installer_state.is_multi_install()) { | 1241 if (installer_state.is_multi_install()) { |
1263 ProcessGoogleUpdateItems(original_state, installer_state, product); | 1242 ProcessGoogleUpdateItems(original_state, installer_state, product); |
1264 | 1243 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 // deletion unconditionally. If they are not empty, the session manager | 1409 // deletion unconditionally. If they are not empty, the session manager |
1431 // will not delete them on reboot. | 1410 // will not delete them on reboot. |
1432 ScheduleParentAndGrandparentForDeletion(target_path); | 1411 ScheduleParentAndGrandparentForDeletion(target_path); |
1433 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1412 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
1434 installer::DELETE_FAILED) { | 1413 installer::DELETE_FAILED) { |
1435 *uninstall_status = installer::UNINSTALL_FAILED; | 1414 *uninstall_status = installer::UNINSTALL_FAILED; |
1436 } | 1415 } |
1437 } | 1416 } |
1438 | 1417 |
1439 } // namespace installer | 1418 } // namespace installer |
OLD | NEW |