相关步骤如下:
==================================================================================
1.编写activex 插件DLL功能组件,并配置生成
//////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
=============================
通过IE安全控件认证,实现IObjectSafeTy接口
#####################################
/// <summary>
/// 创建IObjectSafety接口
/// </summary>
[ComImport, Guid("415fa9ac-887c-48da-a7c2-db8fc31c44f1")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IObjectSafety
{
[PreserveSig]
void GetInterfacceSafyOptions(
int riid,
out int pdwSupportedOptions,
out int pdwEnabledOptions);
[PreserveSig]
void SetInterfaceSafetyOptions(
int riid,
int dwOptionsSetMask,
int dwEnabledOptions);
}
#####################################
实现IObjectSafety接口代码:
#####################################
#region IObjectSafety 成员
public void GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
{
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}
public void SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
{
throw new System.NotImplementedException();
}
#endregion
#####################################
===========================
2.添加安装项目,以DLL文件项目为主输出,生成activex插件的msi格式的可安装文件
=========================
改动ActiveX控件的主输出文件的属性,将其Register属性改为vsdrpCOM.
=========================
3.编写inf文件(内容见底部)
4.根据msi文件和inf文件用CABARC.EXE生成cab文件(打包)
CABARC.EXE -s 6144 n C:\ControlSetUp.cab C:\ControlSetUp.msi C:\ControlSetUp.inf
5.生成pfx密钥(测试证书及密钥)
===================
makecert -r -n "CN= BroadWay Firm" -b 01/01/2008 -e 01/01/2018 -sv c:\myselfName.pvk c:\myselfName.cer
cert2spc c:\myselfName.cer c:\myselfName.spc
pvkimprt -pfx c:\myselfName.spc c:\myselfName.pvk
===================
6.为cab包签名
signtool signwizard
给数据盖时间戳
http://timestamp.verisign.com/scripts/timstamp.dll
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
以上生成过程中,都没有出问题,最后在客户端安装过以后,显示是个红叉.. 望大侠指教.谢谢
附:
[inf文件]
=========================
[Setup Hooks]
hook1=hook1
[hook1]
run=msiexec.exe /i %EXTRACT_DIR%\ControlSetUp.msi /qn
[Version]
; This section is required for compatibility on both Windows 95 and Windows NT.
Signature="$CHICAGO$"
AdvancedInf=2.0
=========================
红颜莎娜