Adding Icon to Short cut in setup - c#

I'm trying to get icons to show up on the Shortcuts i create in my set up application. I have two shortcuts one for the start menu and desktop. The icon shows up fine in the program files but then that's the direct output of the application. The other two are shortcuts. They are still showing the default shortcut icon.
I found this and it didn't work. When i do it there is no icon displayed. So i cant select OK
Setting correct icon for Shortcut in VS2010 Setup Project
Then i found this link
How to change windows Applicatoin's default icon in Setup Project
Right click on you windows application project, select properties. In the properties window, select the application tab. In the application tab, there is a radio button saying Icon and manifest. Select that and browse and select your custom icon for the application in the Icon drop down menu.
When i try and do that. i get an error:
Error 8 Error generating Win32 resource: Error reading icon
'C:\Users\<me>\Documents\Visual Studio 2010\Projects\<solution>\<project>\
<mylogo>.ico' -- The data is invalid.
C:\Users\<me>\Documents\Visual Studio 2010\Projects\<solution>\<project>\
obj\x86\Debug\<program>.exe <project>
Any help please would be greatly appreciated.

It means your ico is corrupt. Try converting or creating the ico with a different tool or website if you converted it online before

Related

How to change Setup.exe icon when publishing through clickonce

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.
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:
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

replacing application icon after build

I need to brand a specific white labeled app and it needs to get the appropriate app icon, so that when I browse to the exe in file explorer it shows with the branded icon. I dont mean changing the icon at runtime because that is not a problem.
I have tried accessing the assemblies with mono.cecil and replacing the resource called "app.ico" but it doesnt seem to work. I also tried to use pack URIs in xaml but that doesnt work because at compile time I dont know where the branding resources are located.
I know that this can possibly be done during a pre-build event but I prefer replacing the icon after the exe is built.
Any ideas?
In the 'Solution Explorer' in Visual Studio, select the startup project. Either right click on it and select 'Properties', or just press Alt+Enter on the keyboard to open the project properties. On the 'Application' tab, you should see a 'Resources' section. Click on the 'Icon and manifest' and select an icon for your application. Is that what you were talking about?

Taskbar button/icon does not appear properly if it is set to combine

I am facing the issue in windows 7 taskbar button. When set Taskbar Button property to "Always combine" then my winform application (developed using VS 2010) buttons appeared with default icon.
But if I set Taskbar Buttons property to "Never combine" then it appears with correct icon which I have set for my exe application.
Any idea how can I resolve this issue.. it is suppose to come with icon on combine always settings.
Regards,
Subodh
I created a windows forms application in VS 2010. Added an icon (linked to ico file directly - not through resources) to the project properties (Resources -> Icon: -> Browse). The exe used the new icon.
When changing from 'Always combine' to 'Never combine', the same thing you described happened.
I went back to the project and added the same ico file as an icon for the form. Rebuilt and the problem was gone.
It appears that when using 'Never combine', Windows 7 uses the form icon to display elements in the taskbar. While, when using 'Always combine', it uses the program's icon.

C# VS2010 Setup Project makes no Icons and WinXP Error

I created a Setup Project and it works in Windows 7, but no icons are shown in the shortcuts. I added the icons in the Form, in the Setup Project, in the Desktop Icon tab, in the Start menu tab and in the Add/Remove tab. I added the same icon for all the configurations...could it be a problem with the size of the icon?
Another question:
I am getting an error when I try to install it in Win XP computers...I have no messages to post in here, because my WinXP computer opens the VS2010 for debugging and the debugger has nothing to show.
I've had the same problem recently. I've tried setting the shortcut icons to the app main output icon... didn't work. Then I've set added the same icon to the application folder and set to shortcut icons to that... didn't work either. The problem was the icon size. I've generated a multi size icon on https://icoconvert.com/ and behold. All the icons show properly now. Try doing that, maybe it wil fix the problem.

Winforms console application, how can I embed an icon in exe file?

I have a console application, I want to include an ico file as an embedded resource in the exe, then have it as the programs icon in windows explorer, how is this done?
If you right click on your actual project that you want to change the final icon and select properties at the pop-up menu, then the main screen will change to the properties file edit, in the screen that appeared, at the botton you will see that you can select the icon to use in the application, select it and when you compile your project, at the release type you will see that the application have the icon that you selected.
Regards.
In the project settings page for your Console Application, go to the Application Page.
Under "Icon and Manifest", click on the [...] button next to where it says (Default Icon), and pick your Icon. Rebuild your app.
This will give your console application a custom icon.
The icon displayed in windows explorer for any .net application is the assembly icon which can be set in the project settings in visual studio.

Categories