Is there any way to set custom icon for setup.exe file when publishing through VS for click once publish. Always after publishing, I am getting setup.exe file and with the icon (kind of black disc image) but after installing the application, I can see my custom logo on the startmenu,ctrlpanel.
-
You can set the icon in Project Properties > Application > Icon and Manifest > Icon. Just browse to the one you want. – Equalsk Jan 26 '16 at 17:21
-
@Equalsk Hi, I am currently doing that and it is actually updating the application's logo after installing but what I want is to change the icon for the setup.exe and *.application files that are formed after publishing using clickonce, which I still have the disc like logo. – bharath Jan 26 '16 at 18:34
2 Answers
I'm not aware of any way to change the icon BEFORE building the project so that once the ClickOnce is deployed it already has the icon, however you can edit the setup.exe icon AFTER deployment quite easily. If anyone else knows of a way to do it before then they can trump my answer.
In Visual Studio go to File > Open > File and browse to the setup.exe for your ClickOnce deployment. Open this file.
You should see a folder tree. Right click on the Icon node and choose Add Resource.
It should already have the Icon resource type chosen on the left so click Import on the right to add your icon.
Your icon will open up in Visual Studio, just close this tab. You should be back to your folder tree. Look under the Icon node and make sure your icon has the lowest ID number.
Save the file.
Your setup.exe will now have the new icon.
Disclaimer: For me Windows was weird and didn't refresh the icon right away. If I went to its properties or copied the file elsewhere I could see the icon immediately. I imagine it's a caching thing.
Edit: Screenshot:

- 7,954
- 2
- 41
- 67
-
Hi, I tried to open the setup.exe in VS and it is just showing so binary code and I don't see any folder tree to add an Icon node. – bharath Jan 29 '16 at 15:04
-
Are you sure you followed the steps exactly? File > Open > File > browse to setup.exe. I have included a screenshot of what it looks like. I am using Visual Studio 2015 but I'm sure it's the same on previous versions. – Equalsk Jan 29 '16 at 15:10
-
I am also using VS2015, I am actually doing the same steps,opening the setup.exe after publishing is done from VS2015. – bharath Jan 29 '16 at 15:57
-
Then I have no idea what to tell you my friend. Mine is a vanilla install of VS, I have not installed or configured anything special. You can find a program called ResourceHacker that is free and lets you do the same thing with the icon. Although I can't provide steps for this there are plenty of guides online. – Equalsk Jan 29 '16 at 15:59
-
Here is the link of my screenshot. [link](http://s9.postimg.org/w18gacapb/VS_Setup.jpg). Hey, I tried to use the ResourceHacker but when I tried to replace the icon, I am confused which one to replace as there are so many icons with different resolutions. – bharath Jan 29 '16 at 16:03
-
You don't normally need to replace an icon, either add a new one with the lowest ID or replace the one with the lowest ID and it should work. – Equalsk Jan 29 '16 at 16:07
-
Thanks for the answer. Currently,I am told to keep the default icon but I will try your answer and check because my exe file is signed file, so I have to unsign and again sign it. – bharath Feb 02 '16 at 04:18
Double-click on the properties for your main project.
Click on the Application tab. (I'm assuming C# here. If you're doing VB, post back if it's different and I'll see if it's the same.)
In the middle of the page, there is an option for "icon and manifest". Browse to find the icon you want to use and select it. It needs to be in the top folder of your project; I think it will put it there when you select it. The icon will be deployed with your project, and will be used in the Start Menu. (You can doublecheck the Application Files dialog -- it should be in there marked include(auto)).
You can set the icon on the forms to point to the same icon, and show it on all your forms too.
this link got your answer: ClickOnce start menu icon