Skip to content
⌘ NSIS Forum Archive

Get the output of an program

5 posts

tieum#

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
tieum#
This works thanks.

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