How to change the icon in 'Add or Remove Programs'
Asked Answered
G

6

20

enter image description here

I'm trying to set the icon in Add or Remove Programs to the same as my application's icon. My icon is stored in the Application Folder of my solution. I read on SourceForge you have to edit the ARPPRODUCTICON property. How/where do I do this in Windows Forms?

Gorged answered 25/4, 2013 at 1:20 Comment(3)
I guess that is the work of installer.Biscay
Well, don't store it in a folder, embed it in your EXE instead so you don't have to do anything special.Faitour
Possible duplicate of Custom icon for ClickOnce application in 'Add or Remove Programs'.Lajuanalake
G
46

I found an extremely simple solution. Under your deployment project's properties, click the "AddRemoveProgram" and browse for your file. I recommend dropping your application's icon in your Application folder.

enter image description here

Gorged answered 28/4, 2013 at 3:43 Comment(8)
What do you mean by "deployment project's properties"? I looked all over the place for those properties, but couldn't find it. Wish you hadn't censored the top bit...Cumberland
@DanW ... he means the Install/steup project properties.Kalimantan
How do I find this in Visual Studio 2017 ? EDIT, found it, select the deployment project and press F4Conners
@Ameena: Still can't find it. Which menu or pane is this supposed to be found in? I'm using VS 2010.Cumberland
Months later, still having trouble finding it. Looked everywhere. What exactly do I click on? I'm on a C# Winforms project in VS2010.Cumberland
@Dan W Left click on the "Setup" project then press F4, a window will appear as shown in the image above.Anthropography
@Poly: Still can't find it. What exactly do you mean by "Setup" project? I have F4 mapped to actually run the program by the way.Cumberland
@DanW I know I am very late, but in case someone is wondering. You should have your "code" project, where you right your code, and another project of type "setup" which takes your "code" project and wraps in an install-able package, if you left-click on your "setup" project and press F4, properties window appears and you can put your icon there. I am not sure if this is valid for VS-2010, consider upgrading if possible.Anthropography
A
9

You can manually change these details under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Some of the valid accepted key values:

  • InstallLocation (string) - Installation directory ($INSTDIR)
  • DisplayIcon (string) - Path, filename and index of of the icon that will be displayed next to your application name
  • Publisher (string) - (Company) name of the publisher
  • ModifyPath (string) - Path and filename of the application modify program
  • InstallSource (string) - Location where the application was installed from
  • ProductID (string) - Product ID of the application
  • Readme (string) - Path (File or URL) to readme information
  • RegOwner (string) - Registered owner of the application
  • RegCompany (string) - Registered company of the application
  • HelpLink (string) - Link to the support website
  • HelpTelephone (string) - Telephone number for support
  • URLUpdateInfo (string) - Link to the website for application updates
  • URLInfoAbout (string) - Link to the application home page
  • DisplayVersion (string) - Displayed version of the application
  • VersionMajor (DWORD) - Major version number of the application
  • VersionMinor (DWORD) - Minor version number of the application
  • NoModify (DWORD) - 1 if uninstaller has no option to modify the installed application
  • NoRepair (DWORD) - 1 if the uninstaller has no option to repair the installation
  • SystemComponent (DWORD) - Set 1 to prevents display of the application in the Programs List of the Add/Remove Programs in the Control Panel.
  • EstimatedSize (DWORD) - The size of the installed files (in KB)
  • Comments (string) - A comment describing the installer package

If both NoModify and NoRepair are set to 1, the button displays "Remove" instead of "Modify/Remove".

For example:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinRAR archiver]
"DisplayName"="WinRAR 4.20 (64-bit)"
"DisplayVersion"="4.20.0"
"VersionMajor"=dword:00000004
"VersionMinor"=dword:00000014
"UninstallString"="C:\\Program Files\\WinRAR\\uninstall.exe"
"DisplayIcon"="C:\\Program Files\\WinRAR\\WinRAR.exe"
"InstallLocation"="C:\\Program Files\\WinRAR\\"
"NoModify"=dword:00000001
"NoRepair"=dword:00000001
"Language"=dword:00000000
"Publisher"="win.rar GmbH"

You can change (or create it if it does not exist) the value of the DisplayIcon key. This will change the uninstaller icon in Add or Remove Programs in the control panel.

Attract answered 25/4, 2013 at 2:32 Comment(0)
H
3

Windows installer supports property by which you can add Icon ARPPRODUCTICON. To Set this property we need to add icon in your installer using Icon element.

<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />

This will add icon in Control Panel.

Hesperian answered 10/7, 2015 at 10:47 Comment(0)
E
3

The easy way- on first start up run this code (vb .net):

 Dim myUninstallKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall")
 dim iconSourcePath As String = "c:\myprogram\myprogram.exe,0"
 Dim mySubKeyNames As String() = myUninstallKey.GetSubKeyNames()
 For i As Integer = 0 To mySubKeyNames.Length - 1
     Dim myKey As RegistryKey = myUninstallKey.OpenSubKey(mySubKeyNames(i), True)
     Dim myValue As Object = myKey.GetValue("DisplayName")
     If myValue IsNot Nothing AndAlso myValue.ToString() = "YourProgaram" Then
         myKey.SetValue("DisplayIcon", iconSourcePath)
         Exit For
     End If
 Next

or c#

RegistryKey myUninstallKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall");
string iconSourcePath = "c:\myprogram\myprogram.exe,0";
string[] mySubKeyNames = myUninstallKey.GetSubKeyNames();
for (int i = 0; i <= mySubKeyNames.Length - 1; i++) {
    RegistryKey myKey = myUninstallKey.OpenSubKey(mySubKeyNames(i), true);
    object myValue = myKey.GetValue("DisplayName");
    if (myValue != null && myValue.ToString() == "YourProgaram") {
        myKey.SetValue("DisplayIcon", iconSourcePath);
        break; // TODO: might not be correct. Was : Exit For
    }
}
Echols answered 20/4, 2017 at 14:30 Comment(0)
C
3

In Visual Studio 2017 Community edition:

Select the installer project and press F4 (mouse clicking is not helpful this time, but I swear I got it through another way before.)

Conners answered 30/7, 2018 at 21:10 Comment(1)
And VS 2019 Community. Top property is AddRemoveProgramsIconErmines
A
2

Yes, you can do it by this code:

 string Install_Reg_Loc = @"Software\Microsoft\Windows\CurrentVersion\Uninstall";
 string displayIcon = @"C:\MorganTech\setup-icon.ico";
 RegistryKey hKey = (Registry.LocalMachine).OpenSubKey(Install_Reg_Loc, true);
 RegistryKey appKey = hKey.OpenSubKey(productName);
 appKey.SetValue("DisplayIcon", (object)displayicon, RegistryValueKind.String)
Audra answered 6/9, 2013 at 4:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.