SimonCropp
5th February 2008 23:18 UTC
write to command line when silent
I would like to put write some messages to the command line when my installer is running in silent mode (by passing the /S flag).
I tried searching the forums and Google for various combinations of “command lineâ€, “silent†“console†and “nsis†with no luck. Also looked through the manual.
Both resulted in plenty of information about passing input over the command line and the command line options for makensis.
I also tried calling the command “Exec ‘echo sdfsdfsdf’†from within my script. Still no love.
I am probably missing something obvious but could someone please point me to it?
Anders
5th February 2008 23:23 UTC
nsis is a gui app, not a console program.
Calling AttachConsole(ATTACH_PARENT_PROCESS) etc. with the system plugin might work
http://forums.winamp.com/showthread....hreadid=243205
SimonCropp
5th February 2008 23:32 UTC
Wow. Speedy reply. is 5 minutes a record?
Thanks Anders.
With "AttachConsole" as an extra search word i got to this
http://forums.winamp.com/printthread...hreadid=240746
The script towards the bottom seems to work.
Will have a go at refining the code to make it a little more usable and post my results.
Anders
6th February 2008 00:27 UTC
Turns out I made example code for someone in the nsis IRC channel a long time ago to handle this
Comparing Instructor's code with mine and my notes, you should call GetStdHandle first, then AttachConsole, and use the built in FileWrite command and not WriteConsole, if you do this, you can use pipes and redirection (foo.exe > out.txt etc.) still limited to XP and up
so, without any error handling or anything:
System
::Call 'kernel32::GetStdHandle(i -11)i.r0'
>System::Call 'kernel32::AttachConsole(i -1)'
>FileWrite $0 "hello"