要将其包含在设置中,您可以将其安装到{tmp}
,然后从那里安装[Run]
。
安装这种要求正确的方法是在代码中提取并呼吁它Exec()
在PrepareToInstall()
事件功能:
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
InstallerResult: integer;
begin
//Check if .Net is available already
if NeedsDirectX() then begin
ExtractTemporaryFile('DXSETUP.exe');
if Exec(ExpandConstant('{tmp}\DXSETUP.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, InstallerResult) then begin
case InstallerResult of
0: begin
//It installed successfully (Or already was), we can continue
end;
else begin
//Some other error
result := 'DirectX installation failed. Exit code ' + IntToStr(InstallerResult);
end;
end;
end else begin
result := 'DirectX installation failed. ' + SysErrorMessage(InstallerResult);
end;
end;
end;
的ISXKB有article on how to detect the versions installed。
此函数'NeedsDirectX()'从哪里来? – 2012-12-18 14:05:41