如何以编程方式在Windows 10中设置文件关联。 [英] How to programmatically set file associations in Windows 10.

查看:187
本文介绍了如何以编程方式在Windows 10中设置文件关联。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司(Qoppa Software)开发的PDF编辑器应用程序是Adobe的竞争对手。由于Windows 10已经发布,我们的安装程序无法再设置.PDF扩展名
来使用我们的PDF Studio应用程序作为默认设置。安装Windows 10后,只显示一条消息"重置应用程序默认值"。做一些研究似乎windows改变了文件关联的处理方式,并实现了一些
的新文件关联保护,导致许多应用程序遇到了这个问题。

My company (Qoppa Software) develops PDF Editor applications that are a competitor to Adobe. Since windows 10 has been released our installer is no longer able to set .PDF extensions to use our PDF Studio application as the default. After installing Windows 10 just displays a message "an app default was reset". Doing some research it seems that windows has changed the way file associations are handled and have implemented some new file association protections that have led a number of applications to run into this issue.


文件关联重置主要由"旧"触发。修改UserChoice注册表项(如在Windows 7或更早版本中所做的那样)来设置关联的程序,这使得"哈希"无效。
每个MS,不应触及此密钥,此处的任何篡改都会导致自动重置为Windows 10默认值,现代应用程序将接管。

The file assoc reset is mostly triggered by "old" programs that modify the UserChoice registry key (as they did in Windows 7 or earlier) for setting associations, which makes the "hash" invalid. Per MS, this key shouldn't be touched and any tampering here results in automatic reset to Windows 10 default, with the modern apps taking over.


我们注意到Adobe Acrobat在安装时能以某种方式设置文件关联。我的问题是:我们公司如何生成文件关联哈希,以便我们的应用程序
可以设置为默认值。我们是否需要在某处或某处注册我们的应用程序,以便我们的客户在安装期间将我们的应用程序设置为默认的PDF应用程序?没有理由Adobe可以做到这一点,我们无法做到这一点。 

We've noticed that Adobe Acrobat is somehow able to set file associations when being installed. My question is: How can our company generate the file association hash so that our application can be set as the default. Do we we need to register our application somewhere or something in order to allow our customer to set our application as the default PDF Application during install? There is no reason Adobe can do this and we would not be able to. 

推荐答案

这是设计的。 IApplicationAssociationRegistration :: SetAppAsDefault在Windows 8中停止工作。只有用户可以更改默认值。现在阻止程序覆盖用户偏好。阻止并不完美,因为你可以看到Adobe仍然可以
覆盖用户偏好,但很确定它会随着时间的推移而改善。

This is by design. IApplicationAssociationRegistration::SetAppAsDefault stopped working in Windows 8. Only the user can change the default. Overwriting user preference by programs are blocked now. The blocking is not perfect, as you can see Adobe can still overwrite user preference, but pretty sure it will improve over time.

您可以使用IApplicationAssociationRegistrationUI :: LaunchAdvancedAssociationUI来通知用户您需要设置为默认值。用户是否遵循您的指示取决于用户。

You can use IApplicationAssociationRegistrationUI::LaunchAdvancedAssociationUI to inform the user that you need to be set as default. Whether the user follow your instruction or not is up to the user.


这篇关于如何以编程方式在Windows 10中设置文件关联。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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