“添加或删除程序”中ClickOnce应用程序的图标 [英] Icon for ClickOnce application in 'Add or Remove Programs'

查看:235
本文介绍了“添加或删除程序”中ClickOnce应用程序的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序,开始菜单,应用程序文件夹等中的图标正确,但它没有直接进入添加或删除程序列表。我应该包含哪些内容?

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?

推荐答案

您可能无法通过ClickOnce直接执行此操作,因为它不受支持。也许您可以尝试编辑注册表,如 ClickOnce应用程序的添加/删除程序中缺少图标

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

这篇关于“添加或删除程序”中ClickOnce应用程序的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆