- NSIS Discussion
- Echoing to Std out, Std err
Archive: Echoing to Std out, Std err
longoja
26th September 2005 22:45 UTC
Echoing to Std out, Std err
Currently I am using an automated tool, which can deploy a batch file to a machine, and then runs the files and can read the echo from them.
Is there a way to write to Standard Out / Err, or simulate an echo.
Thanks, James
Joel
27th September 2005 00:40 UTC
Why not use nsExec?
longoja
27th September 2005 04:16 UTC
Originally posted by Joel
Why not use nsExec?
I have tried nsExec already, doesn't seem to work. I can use nsExec and Echo. to a log file, which works. But when I tried to just use Echo with it, it doesn't seem to get picked up.
I have tried Exec, ExecToStack, ExecToLog, all of them I can echo to a log, but without putting this to a log, it seems to get lost, and the application pushing this, doesn't seem to see the Echo's.
Has anyone tried this successfully? Maybe i'm doing it wrong?
Takhir
27th September 2005 07:09 UTC
May be I misunderstood something, but it looks like you want stdin (echo input) emulation for you console application. You can add one line of code to ExecDos plug-in to use app's stdout as echo stdin (ExecDos.c, add as line 148, not tested):
WriteFile(hInputWrite, b, 1, &rslt, NULL);
longoja
27th September 2005 14:28 UTC
Here is what I am trying, so that the app deploying and running my .exe can see what the app is echoing. I'm trying to echo from the installer when installing, so that echo's from the app, can be seen in Standard Out.
nsExec::ExecToLog 'cmd /c Echo. %computername% - INSTALLER - Installing temp installation files >> "$INSTDIR\temp\${installfile}.log"'
nsExec::ExecToLog 'cmd /c type $INSTDIR\temp\${installfile}.log'
I have also tried
nsExec::Exec 'cmd /c Echo. %computername% - INSTALLER - Installing temp installation files >> "$INSTDIR\temp\${installfile}.log"'
nsExec::Exec 'cmd /c type $INSTDIR\temp\${installfile}.log'
I have also tried
nsExec::Exec 'cmd /c Echo. %computername% - INSTALLER - Installing temp installation files'
kichik
27th September 2005 17:09 UTC
NSIS is not a console application. It can't write the console it was executed from because it's detached of it.
longoja
27th September 2005 18:10 UTC
Originally posted by kichik
NSIS is not a console application. It can't write the console it was executed from because it's detached of it.
Does this mean it's impossible to write to Standard Out then?
kichik
27th September 2005 18:37 UTC
You can recompile NSIS as a console application, but that'd probably cause a console window to show up when an installer is executed outside of any console.
longoja
22nd August 2006 20:52 UTC
I saw in release 2.15, they mentioned this...
Added NSIS_CONFIG_LOG_STDOUT configuration option for logging to stdout.
Is anyone using this right now, and successfully writing straight to stdout?
kichik
25th August 2006 12:39 UTC
That setting will build NSIS as a console application with a side-effect of enabling logging. It'll allow you to write to the parent console, but will also create a new console, if executed outside of a console.
To avoid the logging, go to line 59 in Source\exehead\SConscript, remove the condition line and keep only the Append line.