installshield 判断mdmcpq.inf和usbser.sys 是否 存在

1.产品上位机程序,需要驱动支持,在安装  exe程序的时候,连同NET框架4.0和 .inf驱动文件,一起安装,

   安装驱动的时候,会发现,

   如果系统 C:\Windows\Inf 缺少mdmcpq.inf文件和 C:\Windows\System32 缺少usbser.sys 文件,

   就会出现

安装设备时出现一个错误,这个INF中的服务安装段落无效

  所以在安装的时候,要用脚本判断一下,是否存在这两个文件。

  我建立的是Installshield script项目。 在organization 目录新建features,命名为 DriverPatch

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;

 

转载于:https://www.cnblogs.com/HCCZX/p/3551995.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值