Windows Vista和7上的.cab文件(ActiveX)安装问题 [英] Issue with .cab file (ActiveX) installation on Windows Vista and 7

查看:91
本文介绍了Windows Vista和7上的.cab文件(ActiveX)安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了ActiveX控件,并制作了.cab文件,可以使用Internet Explorer在客户端计算机上自动安装。它在Windows XP上可以正常工作,但是在Windows Vista和Windows 7上,其安装受到UAC的阻止(用户帐户控件),并且当我禁用它时,所有东西都可以正常工作...我已经用开发环境证书对我的.cab文件进行了签名...解决此问题的方法是什么。.我不想告诉用户以禁用其UAC模块...

I have made an ActiveX control and have made its .cab file for automatic installation on client machine using Internet Explorer.. It working fine of Windows XP, but on windows Vista and Windows 7 its installation is blocked by UAC (User account control), and when I disable it, all things works fine... I have signed my .cab file with a certificate for development enviornment... What is the way to over come this problem.. I don't want to tell users to disable their UAC module...

推荐答案

最有可能的原因是,您正在尝试在HKEY_LOCAL_MACHINE中注册控件,这是ATL中的默认设置。如果您更改控件以在HKEY_CURRENT_USER(在启用UAC且未提升权限的情况下可访问的注册表的唯一部分)中注册,则应该可以。

Most likely this is because you're trying to register your control in HKEY_LOCAL_MACHINE, which is the default in ATL. If you change your control to register in HKEY_CURRENT_USER (the only part of the registry accessible when UAC is enabled and you aren't elevated), you should be fine.

如果如果您使用的是VS2008和ATL,则可以通过以下方式进行操作:

If you're using VS2008 and ATL, you can do this by calling:

AtlSetPerUserRegistration(perUser);

在较旧的版本中,您需要多一点技巧。这是我们用来解决FireBreath(我帮助维护的跨浏览器插件框架)中的问题的类:

In older versions, you need a little more of a hack. Here is a class that we used to solve the issue in FireBreath, a cross-browser plugin framework I help maintain:

http://code.google.com/p/firebreath/source/browse/src/ActiveXPlugin/axutil .cpp
http: //code.google.com/p/firebreath/source/browse/src/ActiveXPlugin/axutil.h

然后您只需要输入: FbPerUserRegistration perUser(true); 在您的DllRegisterServer和DllUnregisterServer入口点中。

then you just have to put: FbPerUserRegistration perUser(true); in your DllRegisterServer and DllUnregisterServer entrypoints.

或者(我不使用.cab安装,所以我没有尝试过),但是msdn上有一个文档,讨论了修改.cab安装以实现此目的的方法,该文档不需要修改控件:

Alternately (I don't use .cab installs, so I haven't tried this), but there is a document on msdn that discusses ways to modify your .cab install to do this, that shouldn't require modification of your control:

> http://msdn.microsoft.com/en-us/library/dd433049%28VS.85%29.aspx

另一个简短的注释,您可以使用过程监视器查看注册控件时使用的键;它需要一些练习来摆弄过滤器,但是一旦掌握了它,这还不错。如果您要写入HKCR(HKEY_CLASSES_ROOT),则默认情况下会将其放入HKEY_LOCAL_MACHINE / Software / Classes。您想要做的(以避免没有管理员权限的问题)是将密钥放在HKEY_CURRENT_USER / Software / Classes中。

Another quick note, you can use Process Monitor to see what keys you are using when you register your control; it takes some practice fiddling with the filters, but once you get the hang of it it's not bad. If you're writing to HKCR (HKEY_CLASSES_ROOT) that will by default put things in HKEY_LOCAL_MACHINE/Software/Classes. What you want to do (to avoid problems with not having administrator privileges) is to put the keys in HKEY_CURRENT_USER/Software/Classes.

希望有帮助

这篇关于Windows Vista和7上的.cab文件(ActiveX)安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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