1、制作inf安装脚本
[Version]
signature="$CHICAGO$"
AdvancedINF=2.5
[DefaultInstall]
CopyFiles=install.files
RegisterOCXs=RegisterFiles
AddReg=AddRegistry
[DefaultUninstall]
cleanup=1
DelFiles=RemoteClient.files
DelReg=DelRegistry
UnRegisterOCXs=UnRegisterFiles
[strings]
VersionNumber = "1.0.0.1"
Publisher = ""
ProductName = "myOcx ActiveX Module"
GUID = "{716ACBDA-BE00-4C41-BE80-71166B1D8CEE}"
DataFolder = "C:windowssystem32myOcx"
DiskName = "myOcx Files"
[SourceDisksNames]
1=%DiskName%,myOcx.CAB,1
[install.files]
myOcx.ocx=myOcx.ocx
libyfun.dll=libyfun.dll
libmySQ5.dll=libmySQ5.dll
[DestinationDirs]
install.files=11, myOcx
[AddRegistry]
; Make sure it's enabled
HKLM,"SOFTWAREMicrosoftInternet ExplorerActiveX Compatibility%GUID%","Compatibility Flags",,"0"
[DelRegistry]
HKLM,"SOFTWAREMicrosoftInternet ExplorerActiveX Compatibility%GUID%","Compatibility Flags",,
[RegisterFiles]
%11%myOcxmyOcx.ocx
[UnRegisterFiles]
%11%myOcxmyOcx.ocx
2、制作OCX发布包
利用iexpress.exe工个选择要发布的所有文件,包括OCX/DLL/INI等文件。
3、网页上调用OCX
<object classid="clsid:716ACBDA-BE00-4C41-BE80-71166B1D8CEE"
id="myOcx" style="position: absolute; left: 0; top: 0"
codebase="myOcx.cab#version=1,0,1,17">
</object>