5

I would like to make it possible for our unsavvy website users to create a desktop link to our website with a custom icon (our website icon). Naturally, there is the drag-and-drop option, but this doesn't allow a custom icon (as far as I know). I can also go for an exe installer file, but this seems over the top for what I need - just a simple desktop link + icon.

Any ideas?

I need this working for Windows and Mac (but doesn't have to be the same solution for both).

Thanks.

kaminka
  • 53
  • 1
  • 1
  • 3
  • Internet Explorer handles this automatically (on Vista and Windows 7): it uses the site favicon as the icon to URL shortcut, if it finds one. Yet there may be no icon until users visit your website, so [the answer below](http://stackoverflow.com/q/8249404/572834) explains how to do it. – Alexey Ivanov Nov 24 '11 at 07:10

2 Answers2

3

If you are OK creating an EXE file you can do it with a small batch script, which can be converted to an EXE to contain the icon file.

  1. Create a BAT file to open the URL

In Notepad, write a line with the following text in it:

start http://www.domain.com

then save the file with a .bat extension, e.g. save it as launch.bat

  1. Convert the BAT to EXE with a custom icon.

http://www.f2ko.de/programs.php?lang=en&pid=b2e

  1. Distribute the EXE file.

The BAT runs a little shell script to open the browser, so there's a flash of the command line interface, but it disappears and the URL opens.

3

I thought this was interesting so I looked into bookmarks with custom icons on Windows Vista.

A bookmark is just a text file with a .url extension containing the following:

[InternetShortcut]
URL=http://forum.lxcenter.org/index.php?t=msg&goto=89304&#msg_89304
IconFile=C:\Users\Carl\AppData\Local\Google\Chrome\Application\chrome.exe

This example has custom icon, otherwise only the URL entry would be there. There's other optional values like hotkey that can go in as well.

I tried changing IconFile to point to an online resource (a favicon.ico) but it didn't work. Probably a security feature to keep out online nasties. So it looks like you would need the user download your icon file seperately, which sounds like too much for your target user.

The solution I would pursue would be to use a compiled language to create a standalone .exe file that has the icon you want embedded, and just loads the default web browser with the appropriate page. I don't do desktop apps, but I assume this shouldn't be too much harder than a hello world so I'd try that route.

Syntax Error
  • 4,475
  • 2
  • 22
  • 33
  • 1
    Thanks Alexey. I will look into the first solution. I wanted to avoid the exe creation because of the nasty warnings users (rightfully) receive when installing – kaminka Nov 24 '11 at 17:05
  • This actually didn't work for me. I created the bookmark file with a locally stored icon file but the icon was a firefox icon (firefox is my default browser) – kaminka Nov 24 '11 at 17:17
  • Did you use the full path to the icon (not a relative path) Also If you set the custom icon via right clicking does your sample icon work? If so what does the bookmark file look like when you open it in notepad? – Syntax Error Nov 25 '11 at 23:55
  • 1
    OK, it didn't work because it didn't refresh itself. When I created a new file (different name) I got the new icon. I wonder if it possible to force the refresh (if I want to give users a different icon at some point without a new installation) – kaminka Nov 27 '11 at 09:18
  • Restarting explorer should make it refresh. (I think) Not something I would ask of non-technical users though. CTRL+Shft+Esc will bring up the task manager, under the processes tab you can end the explorer.exe process. Then to start it again you click on file in the task manager and type explorer.exe – Syntax Error Nov 27 '11 at 22:38