现做一个项目,需要和自己公司的设备通过USB设备相连,有自己的驱动程序,包括  .SYS  .INF等
   要求在程序安装过程中或程序启动运行时进行驱动程序的安装   我的程序是用MFC写的,安装包的制作是用VS2008自带的新建的项目安装程序   急急急!

解决方案 »

  1.   

      
        或者谁能帮我解释一下这个INF完成了什么功能,好用VC实现,O(∩_∩)O~
       [Version]
    Signature = "$Chicago$"
    provider  = %Mitech%
    DriverVer = INF_DATE,INF_VERSION
    CatalogFile = TGE udisk.catClass = LibUsbDevices
    ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567}[ClassInstall]
    AddReg=ClassInstall.AddReg[ClassInstall32]
    AddReg=ClassInstall.AddReg[ClassInstall.AddReg]
    HKR,,,,"LibUSB-Win32 Devices"
    HKR,,Icon,,"-20"[Manufacturer]
    %manufacturer%=Devices;--------------------------------------------------------------------------
    ; Files
    ;--------------------------------------------------------------------------[SourceDisksNames]
    1 = "Libusb-Win32 Driver Installation Disk",,[SourceDisksFiles]
    libusb0.sys = 1,,
    libusb0.dll = 1,,[DestinationDirs]
    LIBUSB.Files.Sys = 10,System32\Drivers
    LIBUSB.Files.Dll = 10,System32[LIBUSB.Files.Sys]
    libusb0.sys[LIBUSB.Files.Dll]
    libusb0.dll;--------------------------------------------------------------------------
    ; Device driver
    ;--------------------------------------------------------------------------[LIBUSB_DEV]
    CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll
    AddReg    = LIBUSB_DEV.AddReg[LIBUSB_DEV.NT]
    CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll[LIBUSB_DEV.HW]
    DelReg = LIBUSB_DEV.DelReg.HW
    AddReg = LIBUSB_DEV.AddReg.HW[LIBUSB_DEV.NT.HW]
    DelReg = LIBUSB_DEV.DelReg.HW
    AddReg = LIBUSB_DEV.AddReg.HW[LIBUSB_DEV.NT.Services]
    AddService = libusb0, 0x00000002, LIBUSB.AddService[LIBUSB_DEV.AddReg]
    HKR,,DevLoader,,*ntkern
    HKR,,NTMPDriver,,libusb0.sys; Older versions of this .inf file installed filter drivers. They are not
    ; needed any more and must be removed
    [LIBUSB_DEV.DelReg.HW]
    HKR,,LowerFilters
    HKR,,UpperFilters; Device properties
    [LIBUSB_DEV.AddReg.HW]
    HKR,,SurpriseRemovalOK, 0x00010001, 1;--------------------------------------------------------------------------
    ; Services
    ;--------------------------------------------------------------------------[LIBUSB.AddService]
    DisplayName    = "LibUsb-Win32 - Kernel Driver INF_DATE, INF_VERSION"
    ServiceType    = 1
    StartType      = 3
    ErrorControl   = 0
    ServiceBinary  = %12%\libusb0.sys;--------------------------------------------------------------------------
    ; Devices
    ;--------------------------------------------------------------------------[Devices]
    "Mitech Usb Device"=LIBUSB_DEV, USB\VID_0471&PID_0666
    ;--------------------------------------------------------------------------
    ; Strings
    ;--------------------------------------------------------------------------[Strings]manufacturer = "MFD USB TEST"
      

  2.   

    安装包里直接调这个INF不可以吗?
      

  3.   


        我的想法就是当程序运行是自己写程序完成INF文件里面的东西     要是在安装的时候就完成,呵呵,我不会…………    顶一下!!
      

  4.   

    INF稍微有点麻烦, 简单的驱动可以直接复制文件, 创建内核服务
    复制文件到系统驱动目录, 
    创建内核服务可以直接用API: CreateService
      

  5.   

    inf格式说明
    http://blog.csdn.net/zzz3265/archive/2010/04/15/5488341.aspx
      

  6.   


         To zzz3265
         谢谢
          不过到现在一直没有找到好的办法解决啊!      我想要自己手动完成INF所要完成的功能吧
          还有别的办法吗
      

  7.   

    google一下  驱动动态加载
      

  8.   


    邮箱:[email protected]
    谢谢
      

  9.   

    麻烦一下,偶也想要一份,谢谢
    [email protected]
      

  10.   

    to YUNSHI0123   已经发了 请查收
      

  11.   


       to hunt2088
          已收到,谢谢
      

  12.   

    to hunt2088:
    收到,谢谢
      

  13.   

    楼主,我也在做这个,有空时发给我一份,非常感谢,这几天一直在整理这个思路。
    [email protected]
      

  14.   

    楼主还有资料吗,发一份[email protected]谢谢!!
      

  15.   

    楼主,有空时发给我一份,非常感谢!
    [email protected]
      

  16.   

    楼主,有时间给我也发一份,
    [email protected]
    谢谢。
      

  17.   

    楼主 有时间也给我一份:
    [email protected]
    谢谢
      

  18.   

    我邮箱[email protected]   谢谢了