Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 10889028: Install a user-level Start Menu shortcut for every user on system-installs through Active Setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments + exit code + create shell notify Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); 291 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk"));
292 292
293 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() 293 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value()
294 << " from taskbar"; 294 << " from taskbar";
295 // Ignore return value: keep uninstalling if the unpin fails. 295 // Ignore return value: keep uninstalling if the unpin fails.
296 file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str()); 296 file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str());
297 297
298 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); 298 VLOG(1) << "Deleting shortcut " << shortcut_path.value();
299 if (!file_util::Delete(shortcut_path, true)) 299 if (!file_util::Delete(shortcut_path, true))
300 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); 300 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value();
301
302 // Also delete the per-user Start Menu shortcut possibly created by the
303 // Active Setup flow.
304 // TODO (gab): This is ugly, but I have a much cleaner solution to all of
305 // this in my upcoming refactoring.
306 if (installer_state.system_install()) {
307 PathService::Get(base::DIR_START_MENU, &shortcut_path);
grt (UTC plus 2) 2012/09/01 03:20:28 y u no handle return code?
gab 2012/09/01 22:28:40 same comment as in other files, staying close to b
grt (UTC plus 2) 2012/09/02 14:18:19 It's actively harmful to not handle it. |shortcut
308 shortcut_path = shortcut_path.Append(product_name);
309 VLOG(1) << "Deleting shortcut " << shortcut_path.value();
310 if (!file_util::Delete(shortcut_path, true))
311 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value();
312 }
301 } 313 }
302 } 314 }
303 315
304 bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) { 316 bool ScheduleParentAndGrandparentForDeletion(const FilePath& path) {
305 FilePath parent_dir = path.DirName(); 317 FilePath parent_dir = path.DirName();
306 bool ret = ScheduleFileSystemEntityForDeletion(parent_dir.value().c_str()); 318 bool ret = ScheduleFileSystemEntityForDeletion(parent_dir.value().c_str());
307 if (!ret) { 319 if (!ret) {
308 LOG(ERROR) << "Failed to schedule parent dir for deletion: " 320 LOG(ERROR) << "Failed to schedule parent dir for deletion: "
309 << parent_dir.value(); 321 << parent_dir.value();
310 } else { 322 } else {
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 // !|remove_all| for now). 1070 // !|remove_all| for now).
1059 if (installer_state.system_install() || 1071 if (installer_state.system_install() ||
1060 (remove_all && 1072 (remove_all &&
1061 ShellUtil::QuickIsChromeRegisteredInHKLM( 1073 ShellUtil::QuickIsChromeRegisteredInHKLM(
1062 browser_dist, chrome_exe, suffix))) { 1074 browser_dist, chrome_exe, suffix))) {
1063 DeleteChromeRegistrationKeys(browser_dist, HKEY_LOCAL_MACHINE, suffix, 1075 DeleteChromeRegistrationKeys(browser_dist, HKEY_LOCAL_MACHINE, suffix,
1064 installer_state.target_path(), &ret); 1076 installer_state.target_path(), &ret);
1065 } 1077 }
1066 1078
1067 ProcessDelegateExecuteWorkItems(installer_state, product); 1079 ProcessDelegateExecuteWorkItems(installer_state, product);
1068
1069 // TODO(gab): This is only disabled for M22 as the shortcut CL using Active
1070 // Setup will not make it in M22.
1071 #if 0
1072 UninstallActiveSetupEntries(installer_state, product); 1080 UninstallActiveSetupEntries(installer_state, product);
1073 #endif
1074 } 1081 }
1075 1082
1076 if (product.is_chrome_frame()) { 1083 if (product.is_chrome_frame()) {
1077 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, 1084 ProcessChromeFrameWorkItems(original_state, installer_state, setup_path,
1078 product); 1085 product);
1079 } 1086 }
1080 1087
1081 if (installer_state.is_multi_install()) 1088 if (installer_state.is_multi_install())
1082 ProcessGoogleUpdateItems(original_state, installer_state, product); 1089 ProcessGoogleUpdateItems(original_state, installer_state, product);
1083 1090
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1187
1181 // Try and delete the preserved local state once the post-install 1188 // Try and delete the preserved local state once the post-install
1182 // operations are complete. 1189 // operations are complete.
1183 if (!backup_state_file.empty()) 1190 if (!backup_state_file.empty())
1184 file_util::Delete(backup_state_file, false); 1191 file_util::Delete(backup_state_file, false);
1185 1192
1186 return ret; 1193 return ret;
1187 } 1194 }
1188 1195
1189 } // namespace installer 1196 } // namespace installer
OLDNEW
« chrome/installer/setup/setup_main.cc ('K') | « chrome/installer/setup/setup_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698