Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exec not working in NSIS installer

Tags:

nsis

I am new to NSIS i am trying to execute an executable while installation similar to pre request. I tried the below code which copies the exe to the installation path but it is not executing it.

Section "example" example
  SetOutPath "$INSTDIR"
  File "setup.exe"
  Exec "$INSTDIR\setup.exe"
  BringToFront
SectionEnd 
like image 823
Ramesh Avatar asked Sep 18 '25 18:09

Ramesh


1 Answers

The answer from Seki is mostly correct, I'd just like to add that the correct syntax for Exec/ExecWait is always Exec '"c:\path\app.exe" param1 "par am2" param3'

Parameters are of course optional but the path to the app should always be quoted, not just because in your case where $INSTDIR could contain spaces but at least on Win9x it will fail no matter what if you don't quote (According to the NSIS manual)

If the spaces/lack of quotes is not the issue then there are a couple of other things you might want to look into:

  • $OUTDIR is the working directory for the new process (SetOutPath sets this)
  • Missing dll's etc (Check with Process Monitor)
like image 168
Anders Avatar answered Sep 21 '25 17:09

Anders