自动安装activeX [英] Auto Install activeX
问题描述
我是一名Web开发人员,目前的任务是构建ActiveX组件。
I'm a web developer and my current task is to build an ActiveX component.
这是我第一次必须使用ActiveX,并且设法建立了一个有效的示例。
It's the first time I have to work with ActiveX and I managed to make an working example.
但是我无法从浏览器进行ActiveX安装。当使用Visual Studio 2008安装它并运行网页时,所有操作均按预期方式进行,当我没有安装它时,我会期望类似于Windows Update的询问我是否允许安装,但这种情况不会发生....
However I cannot make the ActiveX install from a browser. When installing it using visual studio 2008 and running the web page all works as expected, when I don't have it installed I would expect something similar to windows updates asking me if I allow the installation but this does not happen....
这是我将其放在网页中的方式:
Here is how I'm placing it in the web page:
<object id="myActiveX" name="myActiveX" classid="clsid:A68B19C8-9DB4-49e4-912F-37FB44968528"
codebase="http://localhost/myWebSite/install.cab#version=1,0,0,0"></object>
classId中的guid与我为我的班级创建的guid匹配。
The guid in the classId matches the guid I created for my class.
有人可以指出我所缺少的吗?
Can anyone point out what I'm missing?
编辑:
忘记了这一点,我有一个ActiveX的安装项目,该项目会生成一个.msi和Setup.exe
Forgot to mention this, I have a Setup Project for my ActiveX that generates an .msi and an Setup.exe
我已经与使用.inf文件的用户制作了cab文件,如下所示:
i have made a cab file with those using a .inf file as so:
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Setup Hooks]
hook1=hook1
[hook1]
run=msiexec.exe /i %EXTRACT_DIR%\Install.msi /qf
推荐答案
您可能要检查IE安全设置:默认情况下,未签名的ActiveX控件将被忽略。
You might want to check your IE security settings: By default, unsigned ActiveX controls are ignored.
这是另一种可能性:
您是否将控件标记为脚本安全和初始化安全?
Did you mark your control as "Safe for scripting" and "safe for initialization"?
我不确定这是您遇到的问题,因为1)您的示例HTML代码未显示您正在脚本中使用控件,以及2)说HTML代码段未显示您设置控件属性。
但是,这是一个通常的陷阱,所以如果我是您,我来看一下。
I'm not sure this is the issue you're running into since 1) your sample HTML code doesn't show that you're using the control in a script and 2) said HTML snippet doesn't show that you set control properties. However this is a usual trap so if I were you, I'd give a look.
IIRC,可以通过实现 IObjectSafety 界面或使用注册表设置。
IIRC this can be achieved either by implementing the IObjectSafety interface or using registry settings.
这和这是2个使您入门的指针。
This and this are 2 pointers to get you started.
这篇关于自动安装activeX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!