cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tinkan
Level 2

InstallScript:write to stdout

Hi everyone. I am new to this form, so I have posted incorrectly please let me know. I am working with 2010 InstallScript and I have been assigned what I thought would be a simple task, but I cannot find any information on how to accomplish this. Please help. Here is what I have:


The installer is written in InstallScript. It is kicked off by using the windows command prompt and entering setup.exe and some argument. For example, if the argument /version is passed, I need to make the version display return from the setup.exe in the command prompt. I can make it return to a MessageBox, so the code is solid, but I need a silent solution. Any ideas will be appreciated. Thank you in advance, Tin Kan
Labels (1)
0 Kudos
(1) Reply
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Since installations built by InstallShield (Windows Installer or InstallScript projects) are Win32 GUI mode applications, they have no console allocated to them after they are launched. As such, it would be necessary to allocate a new console (with AllocConsole) and obtain the standard output handle from Windows (with GetStdHandle). You could also possibly attach to the parent process' console with AttachConsole. In either case, these APIs will need to be prototyped to be able to use them through InstallScript. No predefined functionality is included in any project type in InstallShield to be able to write to a console standard output handle.

More information on consoles can be found in the MSDN article Consoles.

Note that it would be simpler to write any information needed to a text file (since InstallScript does provide functions to read and write to text files) compared with trying to send output to a console window.
0 Kudos