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

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

Issue 11299024: Revert 168080 - Configure system-level Chrome settings (i.e. install its shortcuts) immediately fol… (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
« no previous file with comments | « 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
===================================================================
--- chrome/installer/util/shell_util.cc (revision 168098)
+++ chrome/installer/util/shell_util.cc (working copy)
@@ -1797,19 +1797,27 @@
}
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;
- FilePath read_target;
- if (!base::win::ResolveShortcut(shortcut_path, &read_target, NULL))
+ 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();
return false;
+ }
- if (InstallUtil::ProgramCompare(
- FilePath(target_exe)).Evaluate(read_target.value())) {
+ if (InstallUtil::ProgramCompare(FilePath(target_exe)).Evaluate(read_target)) {
// 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())) {
« no previous file with comments | « chrome/installer/setup/uninstall.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698