我想安装一个使用InnoSetup的串口驱动程序。我有inf文件,我可以通过设备管理器手动安装驱动程序,但我希望能够将驱动程序包含在我的安装程序中,这样用户就不必自己安装驱动程序了。
发布于 2011-09-14 06:44:13
请参阅MSDN上的InstallHinfSection。文档还提到了如何通过调用'Rundll32.exe‘来调用安装。你可能会得到类似下面这样的结果:
[Files]
..
Source: "driver\my_x86driver.inf"; DestDir: {app}\driver;
Source: "driver\my_x86driver.sys"; DestDir: {app}\driver;
[Run]
..
Filename: {sys}\rundll32.exe; Parameters: "setupapi,InstallHinfSection DefaultInstall 128 {app}\driver\my_x86driver.inf"; WorkingDir: {app}\driver; Flags: 32bit;请注意,您可能需要在64位系统中以64位模式运行安装程序才能安装驱动程序:
[Setup]
..
ArchitecturesInstallIn64BitMode=x64 此外,您还可以根据机器架构(例如Check: Is64BitInstallMode)检查是否运行.inf文件的版本。
发布于 2013-07-16 16:46:46
这是一个更好的答案:Inno setup: install drivers with rundll32 or dpinst?
在Windows7及更高版本上使用InstallHinfSection似乎要么支离破碎,要么困难重重。让它在批处理文件中工作是很困难的,让它从innosetup中工作更困难。DPINST似乎更可取,而且更简单。
发布于 2018-01-12 20:01:11
我像这样使用dpinst:
[Files]
Source: "Source\dpinst\dpinst32.exe"; DestDir: "{app}\driver"; DestName: dpinst.exe; Check: not IsWin64; Flags: ignoreversion
Source: "Source\dpinst\dpinst64.exe"; DestDir: "{app}\driver"; DestName: dpinst.exe; Check: IsWin64; Flags: ignoreversion
[Run]
Filename: "{app}\driver\dpinst.exe"; Parameters: "/A /LM";https://stackoverflow.com/questions/7405009
复制相似问题