相關步驟如下: ================================================================================== 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 =========================
添加回答
舉報
0/150
提交
取消