6

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?

Community
  • 1
  • 1
Siva
  • 1,281
  • 2
  • 19
  • 41

3 Answers3

8

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.

Siva
  • 1,281
  • 2
  • 19
  • 41
  • My setup project uses the 256*256 version for whatever reason, but this answer finally led me into the direction of "maybe the actual icon is the problem..." after struggling with this for WAY too long. +1 – Vultuxe Aug 24 '21 at 19:36
2

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.

Craylen
  • 313
  • 2
  • 12
  • As you suggested, I had added an .ico file to my setup project. Now selected "User's Desktop" created a shortcut and then from the properties I have selected application folder and "File of type" as "*.ico".Then rebuild the solution and then in the debug location there are exe and msi files. After running msi file it got installed and the shortcut created in the desktop. But still it does not show icon. In the program files I found .ico file in the following location "C:\Program Files (x86)\Dummy\SayHelloSetup". Could please help where am I doing wrong. – Siva Jan 04 '18 at 15:07
  • I've updated my post, check the settings if they help you. – Craylen Jan 04 '18 at 15:37
0

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