InnoSetup:包含并自动安装DirectX

时间:2014-06-13 10:59:42

标签: web-applications installer inno-setup node-webkit

我正在为我的nodewebkit应用程序准备一个窗口安装程序。 这是一个使用Three.js的应用程序,因此需要DirectX。

如何修改我的installer.iss以在我的应用之前(或之后,并不重要)安装DirectX?

我有:

[Code]
function installDirectX() : Boolean;
begin
  ....
end;

[Run]
Filename "{app}\{#MyAppName}"; Description: "...."; Flags: nowait postinstall skipfsilent

更多规格

基本上我想在安装程序中包含directx.exe,但我也想启动directx.exe(仅当尚未安装 - 但这是一个加号 -

更新

正如RobeN建议我尝试的那样:

[Files]
Source: "path\dxsetup.exe"; DestDir: "{app}"

[Run]
Filename: "dxsetup.exe"; WorkingDir: "{app}"; Parameters: "/silent"; Flags: waitilterminated  skipifdoesntexist; StatusMsg: "Installing Microsoft DirectX..."

但仍然不起作用..

解决方案1:

在App安装后启动(始终)DirectX安装程序。

[Files]
Source: "dxsetup.exe"; DestDir: "{app}"; AfterInstall: DirecXinstaller

[Code]
procedure DirecXinstaller;
var
  ResultCode: Integer;
begin
  if not Exec(ExpandConstant('{app}\dxsetup.exe'), '', '', SW_SHOWNORMAL,
    ewWaitUntilTerminated, ResultCode)
  then
    MsgBox('Other installer failed to run!' + #13#10 +
      SysErrorMessage(ResultCode), mbError, MB_OK);
end;

1 个答案:

答案 0 :(得分:0)

如果通过[Run]部分

[Files]
Source: "X:\YOUR_GAMEFILES\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "d:\DirectX\*"; DestDir: "{tmp}"; Flags: nocompression createallsubdirs 
 recursesubdirs deleteafterinstall overwritereadonly ignoreversion uninsremovereadonly
;here you point to the folder with full DirectX intaller

[Run]
Filename: "{tmp}\DXSETUP.exe"; WorkingDir: "{tmp}"; Parameters: "/silent"; 
 Flags: waituntilterminated skipifdoesntexist; 
 StatusMsg: "Installing Microsoft DirectX..."
Filename: "{app}\YOURGAMEEXE.exe"; WorkingDir: "{app}"; 
 Flags: nowait postinstall runascurrentuser skipifsilent; Description: "Run MY GAME"