在 Windows XP 上静默安装设备驱动程序

发布于 2024-08-08 02:08:34 字数 271 浏览 8 评论 0原文

有没有一种方法可以在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烈酒灼喉 2024-08-15 02:08:34

您不会跳过签名提示,因为这已经融入到 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.

就像说晚安 2024-08-15 02:08:34

避免因驱动程序未签名而导致任何 UI 交互的唯一方法是通过直接修改注册表来预安装驱动程序。

是的,这是可以做到的。您必须修改以SYSTEM身份运行的HKLM\System\CurrentControlSet\Enum注册表项上的ACL(通过将自己安装为服务或使用Sysinternals psexec -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 key run as SYSTEM (by installing yourself as a service or using Sysinternals psexec -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 :(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文