Creating Application Shortcut in Programs for Windows Installer Project

It has been while since I posted something. Actually I was on very long vacation Open-mouthed smile for almost 2 months and during that time all I did was eating, traveling, sleeping and eating again … and now it is ended and I am back .. I think I have gained few pounds… so (just like every year) this new year I have taken resolution to get back in shape (that’s a different story that right now I am in crisis to stay resolute Confused smile).

Ok, enough babbling … I am sure everyone is familiar with shortcuts created for an application when we install it. Usually these shortcuts are created inside Programs’ menu (aka Start menu) and Desktop … sometimes you even have options to create in quick launch menu too. Actually it is very easy to achieve this in Windows Installation project and in this post I am going to show just that …

First step is to create new Visual Studio Installer project and give it any name. Since I am very bad with names, I simply gave it “TestMSI”. Then I added one text file I had for another post and added it installation. If you don’t know how to create an installation project or add a file into installation project then read this old 101 post. Once that file is added, say I want to create a shortcut of this file on user’s desktop and start menu. To create a shortcut in Start menu, select “File System” in MSI project and select “User’s Program Menu”. When it is selected, right click in work area and select “Create New Shortcut”.

AddShortCut_1 AddShortCut_2

This will open up browse menu and all you need to do is to select an item that you want to create a shortcut for. In this case I wanted to create shortcut for a text file located inside “Application Folder” so I selected that file. Once file is selected click on OK and you will see that a shortcut is added in User’s Program Menu. You can give it any name you want and shortcut with that name will be created. You can select only one file at a time which means you can create ONLY ONE shortcut in one time. To create multiple shortcut you will have to follow same process multiple times.

AddShortCut_3 AddShortCut_5

Next step is to create a shortcut for desktop. This process is identical to creating shortcut in start menu, and only difference is instead of User’s Program Menu you have to select “User’s Desktop” folder.

Once that is done just build MSI and install it, And you will see that it has created shortcut of that file in start menu and desktop.

AddShortCut_6

That’s it for now…

It’s Just A Thought … Fingers crossed

Gaurang Sign

Leave a Reply

Your email address will not be published. Required fields are marked *