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

Unified Diff: chrome/installer/util/shell_util.cc

Issue 11359219: Configure system-level Chrome settings (i.e. install its shortcuts) immediately following self-dest… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« chrome/installer/setup/uninstall.cc ('K') | « chrome/installer/setup/uninstall.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 6cfaf5f9fac4dcad9b27403a1266cb3f3e0f4b79..72b312092776d6adf9191e0fb75bf0290f3c086a 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1797,27 +1797,19 @@ bool ShellUtil::RemoveShortcut(ShellUtil::ShortcutLocation location,
}
string16 shortcut_base_name(
- (shortcut_name ? *shortcut_name : dist->GetAppShortCutName()) +
- installer::kLnkExt);
+ (shortcut_name ? *shortcut_name :
+ dist->GetAppShortCutName()) + installer::kLnkExt);
FilePath shortcut_path(shortcut_folder.Append(shortcut_base_name));
if (!file_util::PathExists(shortcut_path))
return true;
- base::win::ScopedComPtr<IShellLink> i_shell_link;
- base::win::ScopedComPtr<IPersistFile> i_persist_file;
- wchar_t read_target[MAX_PATH] = {};
- if (FAILED(i_shell_link.CreateInstance(CLSID_ShellLink, NULL,
- CLSCTX_INPROC_SERVER)) ||
- FAILED(i_persist_file.QueryFrom(i_shell_link)) ||
- FAILED(i_persist_file->Load(shortcut_path.value().c_str(), STGM_READ)) ||
- FAILED(i_shell_link->GetPath(read_target, MAX_PATH, NULL,
- SLGP_SHORTPATH))) {
- NOTREACHED();
+ FilePath read_target;
+ if (!base::win::ResolveShortcut(shortcut_path, &read_target, NULL))
return false;
- }
- if (InstallUtil::ProgramCompare(FilePath(target_exe)).Evaluate(read_target)) {
+ if (InstallUtil::ProgramCompare(
+ FilePath(target_exe)).Evaluate(read_target.value())) {
// Unpin the shortcut if it was ever pinned by the user or the installer.
VLOG(1) << "Trying to unpin " << shortcut_path.value();
if (!base::win::TaskbarUnpinShortcutLink(shortcut_path.value().c_str())) {
« chrome/installer/setup/uninstall.cc ('K') | « chrome/installer/setup/uninstall.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698