简体   繁体   English

如何在Windows 10上通过自定义的inf文件安装WinUSB驱动程序?

[英]How to install WinUSB driver through customized inf file on Windows 10?

I need to communicate with a simple custom device directly through USB. 我需要直接通过USB与简单的自定义设备进行通信。 I have full specifications for communication protocol. 我有通讯协议的完整规范。 Unfortunately, the device vendor did not provide WinUSB driver for the device. 不幸的是,设备供应商未提供该设备的WinUSB驱动程序。

According to https://msdn.microsoft.com/en-us/library/ff540283.aspx#inf I should be able to install WinUSB driver automatically on Windows 10 using the inf template. 根据https://msdn.microsoft.com/zh-cn/library/ff540283.aspx#inf,我应该能够使用inf模板在Windows 10上自动安装WinUSB驱动程序。

But installation fails with: 但是安装失败并显示:

The third-party INF does not contain digital signature information. 第三方INF不包含数字签名信息。

As I understand, it is looking for a signed .cat file. 据我了解,它正在寻找一个签名的.cat文件。 But in this case I have no any files to sign nor .cat file. 但是在这种情况下,我没有任何文件可以签名也没有.cat文件。 I just want to install Windows own WinUSB driver for the device, and clearly Windows drivers should be signed by Microsoft. 我只想为该设备安装Windows自己的WinUSB驱动程序,显然Windows驱动程序应该由Microsoft签名。

How do I proceed to install the .inf file? 如何继续安装.inf文件?

If you only care about supporting Windows 8.1 and later, and you have the ability to change the device's firmware, you might consider using Micrsoft OS 2.0 Descriptors . 如果您只关心支持Windows 8.1和更高版本,并且能够更改设备的固件,则可以考虑使用Micrsoft OS 2.0描述符 This will allow a Windows computer to recognize the device as a WinUSB device and automatically load the WinUSB driver. 这将使Windows计算机将设备识别为WinUSB设备并自动加载WinUSB驱动程序。

Another option would be to use Zadig or the related library libwdi to install the driver for your device. 另一个选择是使用Zadig或相关的库libwdi安装设备的驱动程序。 I would only recommend this for small, temporary, or organization-internal installations since it is kind of a hack (it installs its own certificate into your Trusted Root Certification Authorities list). 我只建议在小型,临时或组织内部安装中使用此方法,因为它很容易被破解(它将自己的证书安装到“受信任的根证书颁发机构”列表中)。

You could also look into disabling driver signature enforcement on your computer if you want to use the unsigned INF file. 如果要使用未签名的INF文件,也​​可以考虑在计算机上禁用驱动程序签名强制实施。

If none of those options are going to work for you, then you need to look into buying a code-signing certificate from a certificate authority and signing your driver. 如果这些选项都不对您有用,那么您需要考虑从证书颁发机构购买代码签名证书并为驱动程序签名。 Code signing for Windows is an ever-evolving field but my article Practical Windows Code and Driver Signing attempts to document what you need to know. Windows的代码签名是一个不断发展的领域,但是我的文章实用Windows代码和驱动程序签名试图记录您需要了解的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM