插入USB设备时自动加载驱动程序
我在 Windows XP 下使用有限用户帐户,并且在获取 Adaptoid(最令人垂涎的 N64 控制器 -> USB 适配器,因为它支持发送原始 N64 控制器命令 + 事实上)时遇到了一些麻烦已停产)以顺利工作:安装后,附带的软件需要管理员权限才能加载驱动程序。
据推测,可以通过在驱动程序的 INF 文件中添加一些内容来安排在插入 Adaptoid 时自动加载驱动程序 (wishna1.inf): 问题是,什么东西?
(如果驱动程序可以在尝试打开 \Device\Wish_NA1
时自动加载,或者甚至在每次启动时自动加载,这也很适合我,但实际上是在插入似乎是正确的方式。)
注意:我确实可以访问管理帐户,只是我不想使用它日复一日。
I'm using a Limited User account under Windows XP, and I'm having a bit of trouble getting my Adaptoid (the most coveted N64 controller -> USB adapter, because of it's support for sending raw N64 controller commands + the fact that it's been discontinued) to work smoothly: as installed, the included software requires Administrator privileges to load the driver.
Presumably, it is possible to arrange for the driver to be loaded automatically when the Adaptoid is inserted by adding some stuff to the INF file for the driver (wishna1.inf):
the question is, what stuff?
(It would also suit me just as well if the driver could be automatically loaded when anything attempted to open \Device\Wish_NA1
, or even to have it automatically loaded at every boot, really, but doing it on insertion seems like the right way.)
Note: I do have access to an administrative account, it's just that I prefer not to have to use it day-to-day.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先我们要明确一下,USB设备有一个Plug &接口。在 Windows 2000 及更高版本上运行驱动程序,因此服务启动模式无关。驱动程序将在注册表中拥有一个作为“服务”的条目,但其启动模式在此无关紧要。
让我们将问题分为两部分:
安装设备驱动程序:这需要管理权限。当您第一次将 USB 设备插入端口时会发生这种情况。 Windows 会检查您的 .INF 文件以查找与您的硬件匹配的文件。如果驱动程序经过 WHQL 认证,它将自动加载。否则,您会看到可怕的添加新硬件向导。如果您以管理员身份运行,只需单击几次“下一步”就足以安装它。否则,最好准备好管理员密码。
加载设备驱动程序:安装设备后,每次此设备插入此时都会加载驱动程序USB 端口,无需任何额外的用户干预。您是否注意到 USB 打印机、相机或磁盘驱动器在第二次插入时加载速度会更快?这是因为这只是加载,而不是安装。
从.INF 来看,它看起来是有效的。此外,它未经过 WHQL 认证,因此您必须手动安装。
我假设当您插入 Adaptoid 时,您会看到“添加新硬件”向导。如果您手动将其指向安装目录,Adaptoid 是否会安装并运行?它是否出现在设备管理器中?
有序列号的 PS USB 设备是一个例外。它们针对所有 USB 端口安装一次。不过,这些设备相当不常见。
First of all, let's clarify that a USB device has a Plug & Play driver on Windows 2000 and higher, so services start modes are irrelevant. The driver will have an entry as a "service" in the registry, but its start mode is irrelevant here.
Let's split the problem into two parts:
Installing driver for the device: This requires administrative privileges. This happens when you insert a USB device into a port for the first time. Windows goes over your .INF files to find one that matches your hardware. If the driver is WHQL-certified, it'll load automatically. Otherwise, you'd see the dreaded Add New Hardware wizard. If you're running as admin, a few clicks on Next should be enough to install it. Otherwise, better have that Administrator password ready.
Loading the driver for the device: Once the device is installed, the driver will be loaded each time this device is inserted into this USB port without requiring any additional user intervention. Ever noticed how a USB printer, camera or disk drive load much faster the second time you plug it in? That's because that's just loading, without installing.
From looking at the .INF, it looks valid. Also, it's not WHQL-certified, so you'd have to install it manually.
I'm assuming when you insert the Adaptoid, you get an Add New Hardware wizard. If you point it manually to the installation directory, does the Adaptoid install and function? Does it appear in the Device Manager?
P.S. USB devices which have a serial number are an exception. They're installed once for all USB ports. Those devices are rather uncommon, though.