1

I have a VSTO application that is developed as an add-in for Outlook using .NET. When I build the application (in Release or Debug mode), I get 2 files, one is <project_output>.MSI and the other is setup.exe file. My goal is to change the default icon of the setup.exe file.

  1. I have tried changing it by opening the setup.exe file in Visual Studio and importing the icon, this seems to do the trick but I don't think it is a good solution as every time I build, I would have to do that.

  2. I have tried this as well, where I specified the image file(.ico) in project properties.. This is not working. I tried ending the explorer.exe task and re-running it (it was mentioned in one of the answers in StackOverflow, and helped in clearing cache).

The requirement is the setup.exe file should have the icon that I set (in any way using visual studio) and not the default icon on building the project(in any mode).

image of output setup.exe

Thanks in advance.

Cam4phor
  • 11
  • 2

1 Answers1

0

You can change the Icon of Form in the Form Properties.

• You can also use the application Properties, Project > "Project Name" Properties > Application > Icon and Manifest ( Select the Icon that you want )

Once done, select the form and double click until you hava the Form_Load, under it type

this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); 

for NotifyIcon type

NotifyIcon.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

You can also set the icon for other forms

Form2 frm2 = new Form2(); 
frm2.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77