我找不到Inno安装程序安装驱动程序的方法。Inno安装程序驱动程序安装
我已经在这里检查了这些问题: Inno setup: install drivers with rundll32 or dpinst? How to run a file before setup with Inno Setup和How to install DirectX redistributable from Inno-setup?。
我的代码是这样的:
[Files]
Source: "drivers\dpinst64.exe"; DestDir: "{app}\drivers"; Check: Is64BitInstallMode; Components: drivers;
[code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode: Integer;
begin
if IsWin64 then begin
ExtractTemporaryFile('drivers\dpinst64.exe');
Exec(ExpandConstant('{tmp}\dpinst64.exe'), '-install "' + ExpandConstant('{tmp}') + '"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;
1)现在我的安装程序将会崩溃,因为提取的临时文件时,它无法找到驱动程序\ dpinst64.exe。
2)在此之前,我试图在[运行]中简单地运行.exe,但没有发生任何事情。当.exe运行时,运行持续5毫秒,然后我得到了-2147483648返回码。 Exec(ExpandConstant('{win} \ notepad.exe'),'','',SW_SHOW,ewWaitUntilTerminated,ResultCode)在InitializeSetup中运行得很好。
这里有什么问题?在安装者完成工作之前,是否有另一种更好的方式来启动驱动程序的安装?
我忘了,司机的exe还需要与它的几个文件和库,你说得对。 Bun现在我应该使用类似于:Source“drivers \ amd64 \ *”; DestDir:“{tmp} \ amd64”;组件:驱动程序 – Paul 2012-02-13 15:39:21
@Paul足够好了,至少现在你的想法是:) – ecle 2012-02-13 15:44:21