Siva
Siva

Reputation: 1411

How to set icon for the desktop shortcut of setup project created using visual studio Installer?

I have created a Setup Project from Visual Studio Installer.
I installed the MSI and I was able to install the application. I want to add an icon for the shortcut I have created on the desktop. For this I tried the following steps:

  • 1) Selected the desktop shortcut from the FileSystem view.
  • 2) Press F4 for properties.
  • 3) For the Icon Field selected Browse option.
  • 4) Clicked on Browse button.
  • 5) Set File of type to Executable(.exe)
  • 6) Press OK and OK again.
  • 7) Then build my C# application and then the Setup Project.
  • 8) Then ran the MSI from the debug location.
  • 9) Then a shortcut created and as well as .exe file got installed on the desktop.
  • 10) ICON size is 16*16.

The .exe file shows the ICON , where as the desktop shortcut for the same executable is not showing ICON and it showing as below.
enter image description here

I can not figure out why it does not show the icon.

Could someone please help me to resolve this issue?

Upvotes: 9

Views: 21033

Answers (3)

tpillera
tpillera

Reputation: 1

In MSVS->Setup go to "User's Programs Menu->Shortcut->Properties->Icon" select your Icon and rebuild. This fixed it for me.

Upvotes: 0

Siva
Siva

Reputation: 1411

Finally I resolved it. The solution for this is changing the ICON size from 16*16 to 48*48 pixel. I have set my application ICON size to 48*48 pixels and the same is selected while setting the ICON for the desktop shortcut in the setup project. Even ICON of size 24*24 also worked. Hope this helps someone looking for similar issue.

Upvotes: 12

Craylen
Craylen

Reputation: 333

I've had a similar problem and i solved it when i included the *.ico file directly in the Installer Project.

First you have to include the *.ico file for your shortcut, rightclick on your installer project in solution explorer and "Add", then "File", then choose your icon. ( Settings.ico for example )

Project Settings

Then you should choose your icon file for the shortcut and click ok. ( your step 5 and 6 )

Select Icon

After installation, your icon should shown correct on the desktop.

Be aware that with this solution, the icon file is copied to your application folder after installation, but nobody should disturb that.

EDIT:

You should see your selected icon when you click on the right menu "(Icon)" => "(Browse...)":

Show Icon

Here the settings for the shortcut:

Settings

Check your settings if they fit.

Upvotes: 2

Related Questions