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" | |
27 #include "chrome/installer/setup/install.h" | 28 #include "chrome/installer/setup/install.h" |
28 #include "chrome/installer/setup/install_worker.h" | 29 #include "chrome/installer/setup/install_worker.h" |
29 #include "chrome/installer/setup/setup_constants.h" | 30 #include "chrome/installer/setup/setup_constants.h" |
30 #include "chrome/installer/setup/setup_util.h" | 31 #include "chrome/installer/setup/setup_util.h" |
31 #include "chrome/installer/util/auto_launch_util.h" | 32 #include "chrome/installer/util/auto_launch_util.h" |
32 #include "chrome/installer/util/browser_distribution.h" | 33 #include "chrome/installer/util/browser_distribution.h" |
33 #include "chrome/installer/util/channel_info.h" | 34 #include "chrome/installer/util/channel_info.h" |
34 #include "chrome/installer/util/delete_after_reboot_helper.h" | 35 #include "chrome/installer/util/delete_after_reboot_helper.h" |
35 #include "chrome/installer/util/google_update_constants.h" | 36 #include "chrome/installer/util/google_update_constants.h" |
36 #include "chrome/installer/util/google_update_settings.h" | 37 #include "chrome/installer/util/google_update_settings.h" |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1224 | 1225 |
1225 ProcessDelegateExecuteWorkItems(installer_state, product); | 1226 ProcessDelegateExecuteWorkItems(installer_state, product); |
1226 | 1227 |
1227 ProcessOnOsUpgradeWorkItems(installer_state, product); | 1228 ProcessOnOsUpgradeWorkItems(installer_state, product); |
1228 | 1229 |
1229 UninstallActiveSetupEntries(installer_state, product); | 1230 UninstallActiveSetupEntries(installer_state, product); |
1230 | 1231 |
1231 // Notify the shell that associations have changed since Chrome was likely | 1232 // Notify the shell that associations have changed since Chrome was likely |
1232 // unregistered. | 1233 // unregistered. |
1233 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); | 1234 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 that gat added. | |
grt (UTC plus 2)
2013/05/08 19:36:09
nit: remove " that gat added"
huangs
2013/05/08 20:18:00
Done.
| |
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 bool has_legacy_app_launcher = | |
1242 chrome_launcher_support::GetAppLauncherInstallationState() | |
1243 != chrome_launcher_support::NOT_INSTALLED; | |
1244 bool uninstalling_app_launcher = product.is_chrome_app_host(); | |
grt (UTC plus 2)
2013/05/08 19:36:09
this will always be false since this whole code bl
huangs
2013/05/08 20:18:00
This was meant for the edge case of simultaneous u
| |
1245 if (!has_legacy_app_launcher && !uninstalling_app_launcher) { | |
1246 BrowserDistribution* shadow_app_launcher_dist = | |
1247 BrowserDistribution::GetSpecificDistribution( | |
1248 BrowserDistribution::CHROME_APP_HOST); | |
1249 InstallUtil::DeleteRegistryKey(reg_root, | |
1250 shadow_app_launcher_dist->GetVersionKey()); | |
1251 } | |
1252 } | |
1234 } | 1253 } |
1235 | 1254 |
1236 if (product.is_chrome_frame()) { | 1255 if (product.is_chrome_frame()) { |
1237 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, | 1256 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, |
1238 product); | 1257 product); |
1239 } | 1258 } |
1240 | 1259 |
1241 if (installer_state.is_multi_install()) { | 1260 if (installer_state.is_multi_install()) { |
1242 ProcessGoogleUpdateItems(original_state, installer_state, product); | 1261 ProcessGoogleUpdateItems(original_state, installer_state, product); |
1243 | 1262 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1409 // deletion unconditionally. If they are not empty, the session manager | 1428 // deletion unconditionally. If they are not empty, the session manager |
1410 // will not delete them on reboot. | 1429 // will not delete them on reboot. |
1411 ScheduleParentAndGrandparentForDeletion(target_path); | 1430 ScheduleParentAndGrandparentForDeletion(target_path); |
1412 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1431 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
1413 installer::DELETE_FAILED) { | 1432 installer::DELETE_FAILED) { |
1414 *uninstall_status = installer::UNINSTALL_FAILED; | 1433 *uninstall_status = installer::UNINSTALL_FAILED; |
1415 } | 1434 } |
1416 } | 1435 } |
1417 | 1436 |
1418 } // namespace installer | 1437 } // namespace installer |
OLD | NEW |