Capturing stdout, stderr and exit codes
| Author: BitRock Support Date: April 08, 2008 04:11 Tags: |
Installbuilder
Actions Error Handling Installer Variables |
BitRock InstallBuilder provides a built-in feature that makes it possible to retrieve the standard output, standard error and exit code for every application run by the installer (via a <runProgram> or <setInstallerVariableFromScriptOutput> actions). This way, after you execute any of those two actions, the following installer variables will get populated:
program_stdout
program_stderr
program_exit_code
You can make use of them wherever you want in the xml file (just note that if you run another program, the variables will be overwritten with the new values). For instance:
<runProgram> <program>program</program> <programArguments>argument1 argument2</programArguments> </runProgram> <showInfo> <text>Program output: ${program_stdout} Program error: ${program_stderr} Program exit code: ${program_exit_code} </text> </showInfo> |
If stdout or stderr are redirected this installer variable will be created but will be empty.
Comments
Stdout in called Linux script not displaying
Author: John Lacsny Date: March 24, 2010 16:10In Linux, when calling a bash script from an action (i.e. Pre-installation), anything written to stdout does not display when executing the installer in text mode.
How can you display the stdout messages?
Stdout in called Linux script not displaying
Author: BitRock Support Date: March 25, 2010 09:15Hi.
The stdout is not displayed in the console but stored in the program_stdout variable. If you need to display it while the script is being executed, you can consider using a <runConsoleProgram> (its usage is the same as the <runProgram>). However, it does not correctly work if you need the user to provide feedback to the script, it is just to display information.
Best regards,
Juanjo.