Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
132 views
in Technique[技术] by (71.8m points)

c# - How to change windows Applicatoin's default icon in Setup Project

How to change the Windows Application's default icon with other one in C# desktop application. I am trying to change it in Setup Project but it is not. I want to show my own icon with Application's shortcut rather then windows default icon

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is truly odd that when you are creating a deployment (set up) project, and you create a shortcut to the "Primary output" (an .exe), the shortcut does not automatically get the .exe's icon. Instead it gets a generic document shortcut icon. Some of the answers here suggest adding an .ico file to the installer, but that certainly feels wrong. You can get the desired icon into the shortcut without adding an .ico file.

Assuming you have already given your program the desired icon,

  • In the solution explorer, right click on the installation project and go to "View -> File System".
  • in the File System window, find the shortuct whose icon you want to change (for example, under "Users's Programs Menu")
  • go to the shortcut Properties (right-click and pick "Properties Window")
  • go to Icon
  • Browse...
  • change "Files of type" to *.exe
  • browse to and select your "primary output"
  • OK, OK

And as serhio pointed out, a similar process can set the icon for the Control Panel's "Add or Remove Programs" list.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...