如何使用 Inno Setup 安装驱动程序?
我想使用 Inno Setup 安装串行端口驱动程序。我有 inf
文件,我可以通过设备管理器手动安装驱动程序,但我希望能够将驱动程序包含在我的安装程序中,以便用户不必通过自己安装驱动比较麻烦。
I'd like to install a driver for a serial port using Inno Setup. I have the inf
file, and I can install the driver manually through device manager, but I'd like to be able to include the driver in my installer so that users don't have to go through the trouble of installing the driver themselves.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请参阅
InstallHinfSection
微软文档。该文档还提到了如何通过调用 Rundll32.exe 来调用安装。可能您最终会得到这样的结果:请注意,您可能需要在 64 位系统中以 64 位模式运行安装程序才能安装驱动程序:
另外您还可以检查运行
.inf 的版本
文件取决于机器架构(例如Check: Is64BitInstallMode
)。See
InstallHinfSection
in Microsoft documentation. The documentation also mentions how to invoke an installation by callingRundll32.exe
. Probably you'll end up with something like this:Note that you might need to run the setup in 64bit mode in 64bit systems to be able to install the driver:
Also you can put checks as to run the version of
.inf
file depending on machine architecture (e.g.Check: Is64BitInstallMode
).我这样使用 dpinst:
I used dpinst like this:
这是一个更好的答案:Install drivers with rundll32 or dpinst in Inno设置?
在 Windows 7 及更高版本上使用
InstallHinfSection
似乎要么被破坏,要么充满困难。使其通过批处理文件工作很困难,使其通过 Inno Setup 工作则更加困难。dpinst
似乎更可取,而且更简单。This is a better answer: Install drivers with rundll32 or dpinst in Inno Setup?
Using
InstallHinfSection
on Windows 7 and beyond seems to be either broken or fraught with difficulty. Making it work from a batch file is difficult, making it work from Inno Setup is even more difficult.dpinst
seems preferable, and is simpler.