0

I have created a Setup project for Visual Studio 2010 installing a website directly under IIS, but after installing it in IIS, I want to create a shortcut for the application in my desktop, so that after I click the shortcut icon it should open the application directly from the desktop which is created in IIS. How can I achieve this from my Visual Studio Setup project?

user3085636
  • 15
  • 1
  • 7

1 Answers1

0

Here's my approach:

  1. Create an IE favorite for the newly installed site, resulting in an URL-shortcut.
  2. It is (so far has always been) a text file with .URL extension of the following format:

    [InternetShortcut]
    URL={0}
    IDList=
    HotKey=0
    IconFile={1}
    IconIndex=0
    [{000214A0-0000-0000-C000-000000000046}]
    Prop3=19,2
    
  3. Add a Custom Action to the Setup project, capturing necessary details (like site URL) and spitting them out into an URL-shortcut, placed on e.g. Public Desktop (thus available to every user).

  4. The icon (set by IconFile={1}) is the hardest part: the only thing that works reliably and sticks, is a local path (like C:\Inetpub\wwwroot\MyApp\AppIcon.ico), obviously that works only on that local machine. Any attempt to use an URL to an icon (similar to how favicons work) does not seem to work or survive a reboot (the icon is lost). But i can live with that.

Note: Shortcut extension must be capitalized (.URL) to function properly on Windows 7!

Once you figured out step 3, add an Uninstall Custom Action to remove that URL-shortcut. :)

Astrogator
  • 1,041
  • 11
  • 27