Archive: Get the output of an program


Get the output of an program
Hello,

I try to get the output of a program.

I tried to direct this to a file an then read it from the file with the following code:

ExecWait '"$PROGRAM_PATH\program" -param > "$INSTDIR\tmp\Output.txt"'

StrCpy $2 ""

FileOpen $0 "$INSTDIR\tmp\Output.txt" r
IfErrors FileReadEnd
FileReadAgain:
FileRead $0 $1
IfErrors FileReadEnd
StrCpy $2 "$2|$1"
Goto FileReadAgain
FileReadEnd:
FileClose $0

My problem is the file $INSTDIR\tmp\Output.txt is not created. Then the following code is useless.

How can I achieve my goal ?

Thanks,

Matthieu


If program is DOS application, use http://nsis.sourceforge.net/wiki/ExecDos


This works thanks.

BTW is there a way to have the dll plugin elsewhere than in plugins directory of NSIS ?


Yes you can extract it manually with File and then call it with CallInstDLL

-Stu


Or simply use !addplugindir.