Share via


How to create a decktop icon for .exe file in C# windows application through setup

Question

Friday, March 27, 2009 2:08 PM

 I have a created a simple windows form in windows applications using c#.net.

Then i have created setup file for that application using setup and deployment project.

But after installing exe in my system i want to get a short cut on my desktop for that exe file.

i.e when i click that shortcut icon my form has to open.

Generally when we install either msn messenger or yahoo messenger we will get a desktop icon for that application. When we click that icon messenger will popup . Like that i am expecting here also.

Can any body please help me.

All replies (12)

Friday, March 27, 2009 5:00 PM ✅Answered | 1 vote

in your setup-project:

  • right-click the project namen and choose "file system"
  • this will open the file system editor
  • in the file system editor, click on "users desktop"
  • right click the right pane
  • choose "create new shortcut"
  • now select whatever the shortcut is supposed to point to

WM_HOPETHISHELPS
-thomas woelferhttp://www.die.de/blog


Monday, March 30, 2009 9:07 AM ✅Answered | 5 votes

1. From Solution Explorer click your setup project.
2. Click File System Editor (on top of Solution Explorer).
3. When File System Editor has opened, on left tab you can see "File System on Target Machine". Click Application Folder.
4. Then on the left tab the "Primary output from MyApp (Active)" appears. Right click it and select "Create shortcut to Primary output from MyApp (Active)". You should now see the shortcut appear below the primary output, which is your application executable.
5. Drag & Drop that shortcut from right tab to left tabs File System on Target Machine - User's Desktop folder.
6. Now the shortcut to your exe will appear on the desktop after install.
7. You can click the shortcut in File System Editor and edit the Name property from Properties grid to change the text that appears on the icon.
Tomi Airaksinen - MCPD [Remember to click "mark as answered" when you get a correct reply to your question]


Saturday, March 28, 2009 5:43 AM

Thank you for your quick response.

But when i did like that it's creating shortcut to desktop not for application?

Please guide me .


Saturday, March 28, 2009 2:04 PM

the shortcut that will be created will be a shortcut to whatever _you_ let it point to. so when you're asked what the shortcut should point to, you need to specify it should point to whatever you are installing.

WM_HOPETHISHELPS
-thomas woelferhttp://www.die.de/blog


Monday, March 30, 2009 8:46 AM

Hi Gopinath,  

I am moving this thread from Base ".NET Framework Setup and Installation" forum to the "ClickOnce and Setup & Deployment Projects" forum, since the issue is related to deployment. There are more deployment experts in the "ClickOnce and Setup & Deployment Projects" forum.

Thanks


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Tuesday, May 5, 2009 5:55 PM

I was wondering if anyone else is having problems with such desktop shortcuts and multiple users.
My deployment setup application creates a desktop shortcut to my application (created as described above); the deployment setup has the InstallAllUsers property set to true.
Unfortunately when a user different from the user that ran the deployment setup launches the application from the desktop shortcut for the first time, the .msi is called again and something is installed.
Is there any way to have a shortcut on the desktop that every user on the machine can use (without having the .msi running)?

Any help/suggestions are appreciated, thanks!


Monday, February 22, 2010 10:50 PM

I was wondering if anyone else is having problems with such desktop shortcuts and multiple users.
My deployment setup application creates a desktop shortcut to my application (created as described above); the deployment setup has the InstallAllUsers property set to true.
Unfortunately when a user different from the user that ran the deployment setup launches the application from the desktop shortcut for the first time, the .msi is called again and something is installed.
Is there any way to have a shortcut on the desktop that every user on the machine can use (without having the .msi running)?

Any help/suggestions are appreciated, thanks!

I am also having this issue. In fact on Windows 7 machines when you go to another user the msi fails to install and the shortcut doesnt work.

Any ideas?


Monday, February 22, 2010 11:05 PM

I was wondering if anyone else is having problems with such desktop shortcuts and multiple users.
My deployment setup application creates a desktop shortcut to my application (created as described above); the deployment setup has the InstallAllUsers property set to true.
Unfortunately when a user different from the user that ran the deployment setup launches the application from the desktop shortcut for the first time, the .msi is called again and something is installed.
Is there any way to have a shortcut on the desktop that every user on the machine can use (without having the .msi running)?

Any help/suggestions are appreciated, thanks!

I am also having this issue. In fact on Windows 7 machines when you go to another user the msi fails to install and the shortcut doesnt work.

Any ideas?

I found an answer in this thread:
http://social.msdn.microsoft.com/Forums/en/winformssetup/thread/42396e05-9414-497a-9cf4-685cf33eb80d


Friday, April 8, 2011 8:25 AM

Hello, I have an WPF application. I have followed Tomi Airaksinens guide and made a msi package.

It works, but my problem is that I don't get my applications icon on the users desktop.

If I follow the guide, I get an icon that looks like an rtf-document.

I have also tried to change the icon in the shortcuts properties in installer solution. I added a copy of my icon, used that as an icon, but when I do that I get another icon that looks like a generic software icon.

Odd is that if I manually create a desktop short cut (right clicking on the desktop) to my installed program, I get the correct Icon!

How can I make the installation software show my Icon?

Best regards,

Thorsten


Thursday, April 21, 2011 9:27 PM

Hello, I received no answer for my question, but I found the reason for my own problem. I had changed icon and the new icon was 60x60. When I resized it to 48x48 it worked! I see my icon on the desktop now after installation. 

 

Best regards,

Thorsten


Sunday, January 15, 2012 6:44 AM

thanks men.... been having the same problem for days now


Sunday, March 12, 2017 8:31 PM

This help me too :) 

Thanks!