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())) { |