Icon for ClickOnce application in 'Add or Remove Programs'
Asked Answered
S

2

7

I got the icons right for my application, in the Start Menu, application folders, etc., but it doesn't come right into the Add or Remove Programs listing. What should I include for this?

Semolina answered 7/11, 2012 at 8:31 Comment(1)
Possible duplicate of Custom icon for ClickOnce application in 'Add or Remove Programs'.Jennettejenni
G
5

You might not be able to do it directly through ClickOnce, as it's not supported. Maybe you could try editing the registry a bit as shown in Missing Icon in Add/Remove Programs for ClickOnce Application:

RegistryKey myUninstallKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall");
string[] mySubKeyNames = myUninstallKey.GetSubKeyNames();

for (int i = 0; i < mySubKeyNames.Length; i++)
{
    RegistryKey myKey = myUninstallKey.OpenSubKey(mySubKeyNames , true);
    object myValue = myKey.GetValue("DisplayName");
    if (myValue != null && (string)myValue == _ApplicationName)
    {
        myKey.SetValue("DisplayIcon", _ExecutablePath + @"\App.ico");
        break;
    }
}
Gabble answered 7/11, 2012 at 8:56 Comment(0)
N
0

You can add an icon using the Windows standard property ARPPRODUCTICON. In your standard Windows installer, add the following code. This will add an icon in the control panel.

<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
Nitrogen answered 10/7, 2015 at 10:50 Comment(1)
Humor me for a moment: where exactly does this code go? Where is the standard windows installer?Strickland

© 2022 - 2024 — McMap. All rights reserved.