1.产品上位机程序,须要驱动支持,在安装 exe程序的时候,连同NET框架4.0和 .inf驱动文件,一块儿安装,框架
安装驱动的时候,会发现,spa
若是系统 C:\Windows\Inf 缺乏mdmcpq.inf文件和 C:\Windows\System32 缺乏usbser.sys 文件,prototype
就会出现code
因此在安装的时候,要用脚本判断一下,是否存在这两个文件。blog
我创建的是Installshield script项目。 在organization 目录新建features,命名为 DriverPatchip
export prototype DriverPatch_Installed(); function DriverPatch_Installed() string s; number r; begin if(FindFile ("C:\\Windows\\Inf","mdmcpq.inf",s) <0) then r= CopyFile (TARGETDIR^"\\mdmcpq.inf", "C:\\Windows\\Inf\\mdmcpq.inf"); endif; if(FindFile ("C:\\Windows\\System32","usbser.sys",s) <0) then r= CopyFile (TARGETDIR^"\\usbser.sys", "C:\\Windows\\System32\\usbser.sys"); endif; end;