Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: Why do some shortcuts not support editing the command line and other properties?

$
0
0

There is no real reason for the shell to prevent you from changing the icon, its just by design. With a little bit of work it would be possible to support a custom argument string as well (MSI app path + lnk arguments)

When a LNK is blessed with a Darwin(MSI) datablock the shell does extra work to invoke the shortcut but before it gets to this point it probably needs to know the icon and a list of verbs (IContextMenu).

The normal Path/Pidl/Icon entries in the LNK point to a file in %windir%\Installer\{guid} or %appdata%\Microsoft\Installer\{guid} (So calling IShellLink::GetPath on a MSI shortcut does work). Why the icon is stored this way is not a big surprise since the application itself might not be installed yet. The path and/or pidl is another story, at least on older versions of Windows the file in the Installer\{guid} directory has to have the same extension as the target (.exe, .chm etc) so that the shell can build the list of verbs by pretending that this file is the real target.

Back in the old shell days this information was not stored in a LNK datablock, the Logo3 or Darwind id was stored directly in the path in a special format: IShellLink->SetPath("::{DarwinOrLogo3Guid}:%appid%::c:\path\to\real\target.exe") (Google blesslnk)


Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>