在 Windows XP 上静默安装设备驱动程序
有没有一种方法可以在 Windows Xp 上以编程方式静默安装设备驱动程序,无需 cat 文件且无需连接设备?
我正在使用 Windows 驱动程序工具包中的 DriverPackageInstall 函数。仅当连接设备时我才能安装驱动程序。在其他情况下,我收到错误:ERROR_NO_SUCH_DEVINST。但该方法在 Windows Vista 上运行良好。
另一个问题是警告对话框,由于缺少 cat 文件而要求用户继续或停止安装。它显示在两种操作系统上。
有什么想法吗?
Is there a way to programmatically install device driver silently without cat file and without connecting the device on Windows Xp?
I'm using DriverPackageInstall function from Windows Driver Kit. And I can install driver only if device is attached. In other case I get an error: ERROR_NO_SUCH_DEVINST. But that method works fine with Windows Vista.
Another problem is warning dialog that asks user to continue or stop installation because cat file is missing . It shows on both OSes.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不会跳过签名提示,因为这已经融入到 Windows 中了,但 DDK 中有一个名为 devinst 的工具非常适合设备安装。
其中包含源代码。
You're not going to get past the signing prompt, as this is baked pretty far into windows, but there is a tool in the DDK called devinst that works well for device installations.
There's Source Code included with it.
避免因驱动程序未签名而导致任何 UI 交互的唯一方法是通过直接修改注册表来预安装驱动程序。
是的,这是可以做到的。您必须
修改以SYSTEM身份运行的HKLM\System\CurrentControlSet\Enum注册表项上的ACL(通过将自己安装为服务或使用Sysinternalspsexec -s
) ,并添加 Windows 设备安装通常会添加的所有注册表项 - 您自己。只有当您能够准确预测设备的设备实例 ID 时,这才有效——例如,如果是 USB 设备,则需要准确预测它所连接的端口等。这很 hacky,但结果将是设备被本质上是“预安装”的。这将需要大量工作,并且在 Windows Vista 上会崩溃。
Microsoft 确实希望您在 Windows XP 上采用 WHQL 方式,抱歉:(
The only way to avoid any UI interaction caused by your driver being unsigned is to hackishly preinstall the driver by modifying the registry directly.
Yes, it can be done. You'd have to
modify the ACLs on the HKLM\System\CurrentControlSet\Enum registry keyrun as SYSTEM (by installing yourself as a service or using Sysinternalspsexec -s
), and add all the registry keys which Windows device installation would usually add - on your own. This will only work if you can predict precisely what your device's Device Instance ID would be -- e.g. in case of a USB device, the precise port it'd be connected to etc.This is hacky, but the result would be the device being essentially "preinstalled". It'll be a lot of work, and it'll break on Windows Vista.
Microsoft really wants you to go the WHQL way on Windows XP, sorry :(