Skip to content
⌘ NSIS Forum Archive

Internet Shortcut Icon

11 posts

Afrow UK#
WriteINIStr "$SMPROGRAMS\MyApp\Shortcut.url" "InternetShortcut" "URL" "http://mywebsite.com"

-Stu
vitoco#
WriteINIStr "$SMPROGRAMS\MyApp\Shortcut.url" "InternetShortcut" "URL" "http://mywebsite.com"
WriteINIStr "$SMPROGRAMS\MyApp\Shortcut.url" "InternetShortcut" "IconFile" "$INSTDIR\file.dll"
WriteINIStr "$SMPROGRAMS\MyApp\Shortcut.url" "InternetShortcut" "IconIndex" "0"
file could also be .exe or .ico

BTW, never tried by me using NSIS... Just guessing (again) 😉

++Vitoco
vitoco#
I've just googled for your keywords, and the first result is a NSIS macro 😱

So, the answer was in the Wiki!
zeromoney#
Hi, I'm using

WriteINIStr "$SMPROGRAMS\MyApp\Shortcut.url" "InternetShortcut" "URL" "http://mywebsite.com"

to add an internet shortcut to my website, right.
The problem is, IconFile and IconIndex keeps adding by itself!!!
It adds http://mywebsite.com/favicon.ico as the IconFile and 1 as the Icon Index, it looks like this:

IconFile=http://mywebsite.com/favicon.ico
IconIndex=1

Why does this keep adding itself? I didn't put that crap in there and I don't want it!
kichik#
It's probably a feature of Internet Explorer that sets the shortcut's icon to the icon the website defines. I'd guess the only workaround is defining your own icon.
zeromoney#
An update: I cleared out my Internet Explorer cache, and now the problem is solved! Crap isn't added!