0

I'm preparing a window installer for my nodewebkit application. It's an app that use Three.js, so DirectX is required.

How can I modify my installer.iss to install DirectX before (or after, isn't important) my app?

I have:

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

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

more specifications

basically I want to include directx.exe in installer but I want also to launch directx.exe (only if NOT already installed -but this is a plus-)

update

As RobeN suggests I try:

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

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

But still doesn't work..

Solution 1:

This launch (always) DirectX installer after App installation.

[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;
gaitat
  • 12,449
  • 4
  • 52
  • 76
Luca Davanzo
  • 21,000
  • 15
  • 120
  • 146
  • possible duplicate of [How to install DirectX redistributable from Inno-setup?](http://stackoverflow.com/questions/8723836/how-to-install-directx-redistributable-from-inno-setup) – TLama Jun 13 '14 at 11:03
  • no.. I can't understand where I have to call installDirecX – Luca Davanzo Jun 13 '14 at 11:11
  • Yes. The code Deanna showed there is executed from `PrepareToInstall` event which runs before the installation itself starts, hence before your app is installed (if you followed common practices of course). – TLama Jun 13 '14 at 11:18
  • @RobeN, that's what the answer in the duplicate question says as well. This question is nothing more than duplicate. In such cases you should vote to close it as such, and optionally improve the answer there (if you feel it needs a code example). – TLama Jun 13 '14 at 12:38
  • @Velthune, but the code from the post you linked copies the installer into the `{app}` folder. Is that the desired behavior ? You should really better describe what's your aim, ideally step by step. And if you have some trouble with an existing script, include its relevant parts into your question, please as well. – TLama Jun 13 '14 at 14:44
  • take a look on update @TLama – Luca Davanzo Jun 13 '14 at 14:57

1 Answers1

0

If via [Run] Section

[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"
RobeN
  • 5,346
  • 1
  • 33
  • 50
  • we did not understand each other well.. I've dxsetup.exe and I want to run this exe, before or after of app installation.. – Luca Davanzo Jun 13 '14 at 14:23
  • I've try your solution, but it only copy dxsetup.exe in C:\..\FooApp – Luca Davanzo Jun 13 '14 at 14:25
  • I gave you a pretty straight forward solution. If you modify one entry, then you have to modify all coresponding entries too. – RobeN Jun 13 '14 at 14:35
  • Clear, I've modify {tmp} with {app}, but still not work. THIS is the solution I'm searching! http://stackoverflow.com/questions/19589309/inno-setup-install-other-installer-and-run-it-before-continuing-my-install – Luca Davanzo Jun 13 '14 at 14:37
  • DXSETUP.exe is not a Full Install... DX June 2010 has 158 install files. You should Copy ALL DX Install files and then run DXSETUP... This is why I pointed to `DirectX\*` - `*` for ALL FILES inside the folder with DirectX install files. – RobeN Jun 13 '14 at 14:57
  • no roben, is the web installer version, so I have only one exe – Luca Davanzo Jun 13 '14 at 14:58
  • So this will not work this way. Remove `/silent` parameter and remove `skipifdoesntexist` flag and then check what happens (if you get any error or something). – RobeN Jun 13 '14 at 16:12