Icon for ClickOnce application in 'Add or Remove Programs'

允我心安 提交于 2019-12-03 13:30:23
Sandeep

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;
    }
}
DigviJay Patil

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" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!