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 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); | 305 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); |
306 | 306 |
307 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() | 307 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() |
308 << " from taskbar"; | 308 << " from taskbar"; |
309 // Ignore return value: keep uninstalling if the unpin fails. | 309 // Ignore return value: keep uninstalling if the unpin fails. |
310 file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str()); | 310 file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str()); |
311 | 311 |
312 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); | 312 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); |
313 if (!file_util::Delete(shortcut_path, true)) | 313 if (!file_util::Delete(shortcut_path, true)) |
314 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); | 314 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); |
| 315 |
| 316 // For system-level installs: also delete the per-user Start Menu shortcut |
| 317 // created by the Active Setup flow. |
| 318 // TODO (gab): This is ugly, but I have a much cleaner solution to all of |
| 319 // this in my upcoming refactoring. |
| 320 if (installer_state.system_install() && |
| 321 PathService::Get(base::DIR_START_MENU, &shortcut_path)) { |
| 322 shortcut_path = shortcut_path.Append(product_name); |
| 323 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); |
| 324 if (!file_util::Delete(shortcut_path, true)) |
| 325 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); |
| 326 } |
315 } | 327 } |
316 | 328 |
317 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), | 329 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), |
318 chrome_exe); | 330 chrome_exe); |
319 } | 331 } |
320 | 332 |
321 bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) { | 333 bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) { |
322 FilePath parent_dir = path.DirName(); | 334 FilePath parent_dir = path.DirName(); |
323 bool ret = ScheduleFileSystemEntityForDeletion(parent_dir.value().c_str()); | 335 bool ret = ScheduleFileSystemEntityForDeletion(parent_dir.value().c_str()); |
324 if (!ret) { | 336 if (!ret) { |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 ShellUtil::QuickIsChromeRegisteredInHKLM( | 1090 ShellUtil::QuickIsChromeRegisteredInHKLM( |
1079 browser_dist, chrome_exe, suffix))) { | 1091 browser_dist, chrome_exe, suffix))) { |
1080 DeleteChromeRegistrationKeys(browser_dist, HKEY_LOCAL_MACHINE, suffix, | 1092 DeleteChromeRegistrationKeys(browser_dist, HKEY_LOCAL_MACHINE, suffix, |
1081 installer_state.target_path(), &ret); | 1093 installer_state.target_path(), &ret); |
1082 } | 1094 } |
1083 | 1095 |
1084 ProcessDelegateExecuteWorkItems(installer_state, product); | 1096 ProcessDelegateExecuteWorkItems(installer_state, product); |
1085 | 1097 |
1086 ProcessOnOsUpgradeWorkItems(installer_state, product); | 1098 ProcessOnOsUpgradeWorkItems(installer_state, product); |
1087 | 1099 |
1088 // TODO(gab): This is only disabled for M22 as the shortcut CL using Active | |
1089 // Setup will not make it in M22. | |
1090 #if 0 | |
1091 UninstallActiveSetupEntries(installer_state, product); | 1100 UninstallActiveSetupEntries(installer_state, product); |
1092 #endif | |
1093 } | 1101 } |
1094 | 1102 |
1095 if (product.is_chrome_frame()) { | 1103 if (product.is_chrome_frame()) { |
1096 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, | 1104 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, |
1097 product); | 1105 product); |
1098 } | 1106 } |
1099 | 1107 |
1100 if (installer_state.is_multi_install()) | 1108 if (installer_state.is_multi_install()) |
1101 ProcessGoogleUpdateItems(original_state, installer_state, product); | 1109 ProcessGoogleUpdateItems(original_state, installer_state, product); |
1102 | 1110 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1207 |
1200 // Try and delete the preserved local state once the post-install | 1208 // Try and delete the preserved local state once the post-install |
1201 // operations are complete. | 1209 // operations are complete. |
1202 if (!backup_state_file.empty()) | 1210 if (!backup_state_file.empty()) |
1203 file_util::Delete(backup_state_file, false); | 1211 file_util::Delete(backup_state_file, false); |
1204 | 1212 |
1205 return ret; | 1213 return ret; |
1206 } | 1214 } |
1207 | 1215 |
1208 } // namespace installer | 1216 } // namespace installer |
OLD | NEW |