注册ActiveX控件时,有哪些方法可以覆盖用户访问控制(UAC)? [英] What are possible ways to override User Access Control (UAC) while registering an ActiveX Control ?

查看:101
本文介绍了注册ActiveX控件时,有哪些方法可以覆盖用户访问控制(UAC)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP.NET 2.0应用程序中,使用 ActiveX 控件。当用户第一次访问该应用程序时,他/她没有注册该ActiveX。应用程序显示弹出窗口以安装ActiveX 。当用户按照该过程进行操作时,会注册ActiveX并且应用程序会加载ActiveX以完成所需的任务。



Windows Vista,Win 7和Win 8 ,提示用户访问控制(UAC)允许在第一次安装ActiveX。即使用户也是管理员,也会发生这种情况。



安装ActiveX时,有哪些替代方法可以覆盖此UAC组件?

建议表示赞赏。

In an ASP.NET 2.0 Application, an ActiveX control is used. When user first time access the appliction and he/she did not have that ActiveX registered. Application show a popup to install ActiveX. When user follow the process, ActiveX is registered and application loads the ActiveX to accomplish desired tasks.

In Windows Vista, Win 7 and Win 8, User Access Control (UAC) is prompted to allow to install the ActiveX at very first time. This happens even if user is Administrator too.

What are alternatives to override this UAC component while installing ActiveX ?
Suggestions are appreciated.

推荐答案

唯一的解决办法就是关闭UAC,你无法用代码来解决这个问题。



UAC用于保护用户免受代码侵害。因此,代码无法绕过用户。如果在代码中有这种方法,那么病毒或恶意软件可以绕过UAC而不告诉用户,因此使UAC无用。
The only solution is to turn UAC off, there's nothing you can do in code to get around this.

UAC exists to protect the user from the code. For that reason the code can't bypass the user. If there was a way around this in code, then viruses or malware could bypass UAC without telling the user, therefore making UAC useless.


除了对解决方案1的评论中的讨论:



您的用户始终可以自由降低UAC保护。例如,在Windows 7上:

控制面板 - >小图标(所有控制面板项目) - >行动中心 - >更改用户帐户控制设置。



如果您的客户将滑块降低到从不通知,则他/她根本不会有UAC消息。重要的是他们自己做出这个可疑的决定,并且你不会在你的计算机上做这件事。 :-)



当然,你的应用程序无法降低UAC,否则会破坏整个UAC理念的目的。



你可以做不同的事情。您可能知道您的应用程序始终需要提升权限。在这种情况下,您可能希望在一开始就请求提升权限,而无需用户使用以管理员身份运行或使用等效的* .LNK。这是通过在嵌入式应用程序清单中声明相应的请求权限来完成的。这种清单很容易创建和嵌入。请参阅:

http://msdn.microsoft.com/en-us /library/bb756929.aspx [ ^ ]。



-SA
In addition to discussion in comments to Solution 1:

You user is always free to lower down UAC protection. For example, on Windows 7:
Control Panel -> Small Icons (All Control Panel Items) -> Action Center -> Change User Account Control Settings.

If your customer lowers the slider down to "Never Notify", she/he won't have UAC messages at all. It's important that they make this questionable decision by themselves and that you won't do it on your computer. :-)

And of course, your application cannot lower down UAC, otherwise it would defeat the purpose of the whole idea of UAC.

You can do different thing. You may know that your application would always need elevation of privileges. In this case, you may want to request elevation of the privileges in the very beginning, without having the user to use "Run as Administrator" or using equivalent *.LNK. This is done by claiming requested permissions accordingly in the embedded application manifest. Such manifest is created and embeded very easily. Please see:
http://msdn.microsoft.com/en-us/library/bb756929.aspx[^].

—SA


无法绕过UAC。但您可以在用户级注册您的控件,这不需要管理员权限。 Window Vista或更高版本的IE8引入了新的机制来注册具有非管理员权限的Current-User上的ActiveX控件。您只需更新您的INF文件,然后重新包装您的控件。



请查看以下链接了解更多详情。

http://msdn.microsoft.com/en-us/library/dd433049(VS.85) .aspx [ ^ ]



请注意,如果你有In-Proc ActiveX控件,这个答案是有效的。
There is no way to bypass UAC. But you can register your control at User-Level which will no required Administrator Privileges. Window Vista or later with IE8 introduce the new mechanism to register ActiveX control at Current-User with non-admin rights. You only have to update your INF file and then repackaging your control.

Please check the following link for more detail.
http://msdn.microsoft.com/en-us/library/dd433049(VS.85).aspx[^]

Please Note that this answer is valid if you have In-Proc ActiveX control.


这篇关于注册ActiveX控件时,有哪些方法可以覆盖用户访问控制(UAC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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