Search code examples
nsis

redirect execwait result to a file nsis


Hi how can I redirect result from ExecWait command

I was trying

ExecWait '"$INSTDIR\MyApp\isql.exe localhost:$INSTDIR\MyApp\tts.fdb -U SYSDBA -p password -i $INSTDIR\MyApp\src\dbfile.sql >>$INSTDIR\logfile.txt"'

But no luck, it did not create any log file. Any ideas? I do not want to use any additional libraries. Thanks


Solution

  • ExecWait is just a thin wrapper around the CreateProcess API and it does not support redirection.

    The easy way to get redirection is to use cmd.exe/%comspec% with the /c switch and one of the exec plugins, nsExec, ExecDos or ExecCmd: "$sysdir\cmd.exe" /c "c:\your\app.exe" /param1 /param2 > "c:\file.txt"

    If you search for "comspec" on the NSIS forum you will find many threads about this...