如何在控制面板-默认程序中显示的程序详细信息中添加网址 [英] How to add a web address to program details displayed in Control Panel - Default Programs

查看:247
本文介绍了如何在控制面板-默认程序中显示的程序详细信息中添加网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个可以处理mailto:协议的程序.为了允许用户选择我的程序作为默认电子邮件处理程序,我注册了我的程序.但是,我注意到某些程序在公司名称下显示了指向公司网站的可点击链接,例如File Explorer.

如何指定到我的网站的链接,以便在选择我的应用程序时显示默认程序" UI?

我使用Microsoft Visual Studio 2013 Ultimate.这是我的.reg格式的程序注册详细信息:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"MyMail"="SOFTWARE\\MyFirm\\MyApp\\Capabilities"

[HKEY_LOCAL_MACHINE\SOFTWARE\MyFirm\MyApp\Capabilities]
"ApplicationDescription"="This is an awesome description."
"ApplicationName"="Awesome App"

[HKEY_LOCAL_MACHINE\SOFTWARE\MyFirm\MyApp\Capabilities\URLAssociations]
"mailto"="mailto.2"

[HKEY_CLASSES_ROOT\mailto.2]
@="URL:MailTo Protocol"
"EditFlags"=dword:00000002
"FriendlyTypeName"="My Mail Client"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\mailto.2\shell\open\command]
@="\"C:\\bg\\awesome.exe\" \"%l\""

这是文件资源管理器中可单击链接的示例.

这是我的没有链接的应用程序

这是我到目前为止发现的:

  1. 并非所有应用程序都显示此链接.

  2. Microsoft和非Microsoft应用程序都可以显示此链接,例如,讯连科技PowerDVD会显示指向www.cyberlink.com的链接.

  3. 并非所有Microsoft应用程序都显示该链接,但确实显示该链接的应用程序可能具有不同的URL.例如,Microsoft Corporation的三个应用程序:绘画"-无链接,图片库"- http://www.microsoft.com ,Visual Studio 2013- http://microsoft.com (无www).

  4. Skype for Desktop显示了公司Skype Technologies SA和指向 http://www.microsoft.com .

  5. 链接地址没有存储在注册表中.它存储在shell \ open \ command下列出的可执行文件中.

  6. 它似乎没有作为资源存储在可执行文件中.

  7. 从sysinternals中找到字符串工具找不到可执行文件中的链接地址.

解决方案

在默认程序"中的程序和公司名称下显示的URL作为身份验证属性1.3.6.1.4.1.311.2.1.12存储在数字签名中. >

设置此值的一种方法是使用Visual Studio命令提示符中的signtool. URL是/du参数后面的值,例如:

signtool sign /s My /n "RegmagiK Software" /du "http://www.RegmagiK.com" awesome.exe 

该证书必须由受信任的证书颁发机构签名.

对于测试,可以使用makecert工具创建自签名证书,并使用证书管理器使其受信任.

makecert -r -ss My -sr CurrentUser -n "CN=RegmagiK Software" SelfSigned.cer
certmgr.exe /add SelfSigned.cer /s /r currentUser root

对可执行文件签名后,重新打开默认程序",然后单击您的应用程序.现在,它应该显示到您的站点的链接.

I am writing a program that can handle mailto: protocol. In order to allow user to select my program as a default email handler, I registered my program. However, I noticed that some, programs display clickable link to company web site under company name, for example File Explorer.

How do I specify a link to my web site so that Default Programs UI shows it when my app is selected?

I use Microsoft Visual Studio 2013 ultimate. Here's my program registration details in .reg format:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"MyMail"="SOFTWARE\\MyFirm\\MyApp\\Capabilities"

[HKEY_LOCAL_MACHINE\SOFTWARE\MyFirm\MyApp\Capabilities]
"ApplicationDescription"="This is an awesome description."
"ApplicationName"="Awesome App"

[HKEY_LOCAL_MACHINE\SOFTWARE\MyFirm\MyApp\Capabilities\URLAssociations]
"mailto"="mailto.2"

[HKEY_CLASSES_ROOT\mailto.2]
@="URL:MailTo Protocol"
"EditFlags"=dword:00000002
"FriendlyTypeName"="My Mail Client"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\mailto.2\shell\open\command]
@="\"C:\\bg\\awesome.exe\" \"%l\""

Here is an example of clickable link for File Explorer.

Here is my application that does not have a link

This is what I found out so far:

  1. Not all apps display this link.

  2. Both Microsoft and non-Microsoft apps can display this link, for example, CyberLink PowerDVD displays link to www.cyberlink.com.

  3. Not all Microsoft apps display the link, and those that do display it, may have different URLs. For example, three apps by Microsoft Corporation: Paint - no link, Photo Gallery - http://www.microsoft.com, Visual Studio 2013 - http://microsoft.com (no www).

  4. Skype for Desktop shows company Skype Technologies S.A. and a link to http://www.microsoft.com.

  5. It does not appear that the link address is stored in the Registry. It is stored in the executable listed under shell\open\command.

  6. It does not appear to be stored as a resource in the executable.

  7. The strings tool from sysinternals does not find the link address in the executable.

解决方案

The URL displayed under the program and company name in Default Programs is stored in the digital signature as authenticated attribute 1.3.6.1.4.1.311.2.1.12.

One way to set this value is using signtool from Visual Studio Command Prompt. The URL is the value after /du parameter, for example:

signtool sign /s My /n "RegmagiK Software" /du "http://www.RegmagiK.com" awesome.exe 

The certificate must be signed by a trusted certificate authority.

For testing, one can create a self-signed certificate using makecert tool and make it trusted using certificate manager.

makecert -r -ss My -sr CurrentUser -n "CN=RegmagiK Software" SelfSigned.cer
certmgr.exe /add SelfSigned.cer /s /r currentUser root

After signing executable, reopen Default Programs and click on your application. It should now display the link to your site.

这篇关于如何在控制面板-默认程序中显示的程序详细信息中添加网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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