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

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

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

   就会出现

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

  我建立的是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;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-12-17
  • 2022-12-23
  • 2021-12-22
  • 2022-02-14
  • 2021-07-12
猜你喜欢
  • 2021-09-26
  • 2022-02-02
  • 2021-12-27
  • 2022-01-24
  • 2021-05-29
  • 2022-03-08
  • 2021-12-19
相关资源
相似解决方案