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/base_paths.h" | 13 #include "base/base_paths.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/files/file_enumerator.h" | 15 #include "base/files/file_enumerator.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process/kill.h" | 17 #include "base/process/kill.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/win/registry.h" | 22 #include "base/win/registry.h" |
23 #include "base/win/scoped_handle.h" | 23 #include "base/win/scoped_handle.h" |
24 #include "base/win/shortcut.h" | 24 #include "base/win/shortcut.h" |
25 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
28 #include "chrome/common/chrome_result_codes.h" | 28 #include "chrome/common/chrome_result_codes.h" |
29 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | |
30 #include "chrome/installer/setup/install.h" | 29 #include "chrome/installer/setup/install.h" |
31 #include "chrome/installer/setup/install_worker.h" | 30 #include "chrome/installer/setup/install_worker.h" |
32 #include "chrome/installer/setup/setup_constants.h" | 31 #include "chrome/installer/setup/setup_constants.h" |
33 #include "chrome/installer/setup/setup_util.h" | 32 #include "chrome/installer/setup/setup_util.h" |
34 #include "chrome/installer/util/auto_launch_util.h" | 33 #include "chrome/installer/util/auto_launch_util.h" |
35 #include "chrome/installer/util/browser_distribution.h" | 34 #include "chrome/installer/util/browser_distribution.h" |
36 #include "chrome/installer/util/channel_info.h" | 35 #include "chrome/installer/util/channel_info.h" |
37 #include "chrome/installer/util/delete_after_reboot_helper.h" | 36 #include "chrome/installer/util/delete_after_reboot_helper.h" |
38 #include "chrome/installer/util/firewall_manager_win.h" | 37 #include "chrome/installer/util/firewall_manager_win.h" |
39 #include "chrome/installer/util/google_update_constants.h" | 38 #include "chrome/installer/util/google_update_constants.h" |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1275 | 1274 |
1276 RemoveBlacklistState(); | 1275 RemoveBlacklistState(); |
1277 | 1276 |
1278 // Notify the shell that associations have changed since Chrome was likely | 1277 // Notify the shell that associations have changed since Chrome was likely |
1279 // unregistered. | 1278 // unregistered. |
1280 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); | 1279 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); |
1281 | 1280 |
1282 // TODO(huangs): Implement actual migration code and remove the hack below. | 1281 // TODO(huangs): Implement actual migration code and remove the hack below. |
1283 // Remove the "shadow" App Launcher registry keys. | 1282 // Remove the "shadow" App Launcher registry keys. |
1284 if (installer_state.is_multi_install()) { | 1283 if (installer_state.is_multi_install()) { |
1285 // If we're not uninstalling the legacy App Launcher, and if it was | 1284 // Delete the "shadow" keys. |
gab
2014/07/25 12:25:13
The "legacy App Launcher" never shipped beyond Dev
grt (UTC plus 2)
2014/07/25 14:20:27
i don't really know. my understand is this (sam: p
| |
1286 // not installed in the first place, then delete the "shadow" keys. | 1285 BrowserDistribution* shadow_app_launcher_dist = |
1287 chrome_launcher_support::InstallationState level_to_check = | 1286 BrowserDistribution::GetSpecificDistribution( |
1288 installer_state.system_install() ? | 1287 BrowserDistribution::CHROME_APP_HOST); |
1289 chrome_launcher_support::INSTALLED_AT_SYSTEM_LEVEL : | 1288 InstallUtil::DeleteRegistryKey( |
1290 chrome_launcher_support::INSTALLED_AT_USER_LEVEL; | 1289 reg_root, |
1291 bool has_legacy_app_launcher = level_to_check == | 1290 shadow_app_launcher_dist->GetVersionKey(), |
1292 chrome_launcher_support::GetAppLauncherInstallationState(); | 1291 KEY_WOW64_32KEY); |
1293 if (!has_legacy_app_launcher) { | |
1294 BrowserDistribution* shadow_app_launcher_dist = | |
1295 BrowserDistribution::GetSpecificDistribution( | |
1296 BrowserDistribution::CHROME_APP_HOST); | |
1297 InstallUtil::DeleteRegistryKey( | |
1298 reg_root, | |
1299 shadow_app_launcher_dist->GetVersionKey(), | |
1300 KEY_WOW64_32KEY); | |
1301 } | |
1302 } | 1292 } |
1303 } | 1293 } |
1304 | 1294 |
1305 if (installer_state.is_multi_install()) | 1295 if (installer_state.is_multi_install()) |
1306 ProcessGoogleUpdateItems(original_state, installer_state, product); | 1296 ProcessGoogleUpdateItems(original_state, installer_state, product); |
1307 | 1297 |
1308 // Get the state of the installed product (if any) | 1298 // Get the state of the installed product (if any) |
1309 const ProductState* product_state = | 1299 const ProductState* product_state = |
1310 original_state.GetProductState(installer_state.system_install(), | 1300 original_state.GetProductState(installer_state.system_install(), |
1311 browser_dist->GetType()); | 1301 browser_dist->GetType()); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1474 // If we need a reboot to continue, schedule the parent directories for | 1464 // If we need a reboot to continue, schedule the parent directories for |
1475 // deletion unconditionally. If they are not empty, the session manager | 1465 // deletion unconditionally. If they are not empty, the session manager |
1476 // will not delete them on reboot. | 1466 // will not delete them on reboot. |
1477 ScheduleParentAndGrandparentForDeletion(target_path); | 1467 ScheduleParentAndGrandparentForDeletion(target_path); |
1478 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1468 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
1479 *uninstall_status = UNINSTALL_FAILED; | 1469 *uninstall_status = UNINSTALL_FAILED; |
1480 } | 1470 } |
1481 } | 1471 } |
1482 | 1472 |
1483 } // namespace installer | 1473 } // namespace installer |
OLD | NEW |