How to get command output in NSIS?
Asked Answered
Z

1

16

I'm wondering, how do I get the output of an execwait command in NSIS. For example, if I run tree, how would I get the output, which would be the actual tree?

Zarzuela answered 25/10, 2010 at 19:27 Comment(2)
NSIS has instructions to enumerate files, see FindFirst in the helpfileRomelda
The command I'm running isn't tree, it's a lot more complex. Tree is just an example.Zarzuela
R
19

You can't do that with ExecWait, you have to use one of the plugins: nsExec, ExecDos or ExecCmd

Romelda answered 25/10, 2010 at 21:27 Comment(5)
Thanks. I ended up using: nsExec::ExecToStack 'command', pop $1 (for the exit code), pop $1 (for the ouput)Zarzuela
ExecCmd now states: "This plug-in is no longer updated and has been superseded by the ExecDos plug-in."Nun
@Romelda im using execwait to launch an exe but it is stuck on this command and it never proceeds. ExecWait "$INSTDIR\Application\abc.exe"Aphonic
@Aphonic How is this related? ExecWait waits until the process ends. Is it stuck waiting for stdin?Romelda
I want to run a command get its output and show it in textbox I'm using the following code and always getting 0 as the output nsExec::ExecToStack 'powershell -NoProfile -Command "$(& {$Args[0]})" "where code"' Pop $Output ; ${NSD_SetText} $LocationTextbox "$Output"If

© 2022 - 2024 — McMap. All rights reserved.