Execute External Program
Previous Topic  Next Topic 

This action will execute an external program like a shell script or batch file and return the results in specified virtual text.  It can also be used to show progressive output while the external program is running, so that the user can see what the program is doing while it runs.


You cannot execute in a console or as root if Show Progressive Output is true.

Standard Properties 

See Standard Action Properties.

Advanced Properties

Clear Progressive Widget

If this property is true, the progressive text widget used during Show Progressive Output will be cleared before the external program is executed.

Console Title (UNIX only)

If this property is not null, it specifies the title to use on the console window if the Execute in Console property is true.

Execute as Root (UNIX only)

If this property is true, InstallJammer will attempt to execute the given program as root.  If the user is already root, the action will execute as normal.  If the user is not root, they will be prompted for their root password which will then execute the program as root.

Execute in Console

If this property is true, InstallJammer will execute the external program in a console window.  This is useful for executing scripts that expect some kind of input from the user on the command-line.

Technical Detail

InstallJammer will attempt to locate the best possible terminal based on desktop environment.  On KDE, this will be Konsole.  On Gnome, it will be gnome-terminal.  If nothing else can be found, good old xterm will be used.

If Execute in Console is specified in conjunction with Execute as Root, and the user is not root, the console will first ask the user for their root password in the same console window before executing.

Include Stderr

If this property is true, the standard error channel of the executing program will be included in the output from the program.  This will include the standard error in the result of the execution or in the progressive output if it is being used.

Program Command Line

This is the command-line of the program to execute.  The command line is executed exactly as it is input with all arguments included.  Virtual text will automatically be substituted.

It should be noted that arguments on the command-line are separated by spaces, and each argument is passed separately to the system as arguments to the command being executed.  Each argument is parsed individually for virtual text rather than substituting the string as a whole so that each argument is properly appended to a list of arguments to execute.

Progressive Output Widget

This property specifies a textbox widget that will be updated with the output of a progressive command as it becomes available.  The textbox will automatically scroll down to keep up with new input.  A widget can be specified by its ID or Alias if it was created with the Add Widget action, or it can be the name of a widget on the current pane, or it can be specified as <PANE>.<WIDGET>.

Result Virtual Text 

This is a virtual text variable to store the result of external program.  This will be any data that is output to standard out while the program is running.  If progressive output is being shown, this variable will be the entire result that was output when the program finishes executing.

Show Progressive Output

If this value is true, the Progressive Output Widget will be updated with new data as it becomes available from the external program.  If this value is false, all output from the external program is buffered and stored in Result Virtual Text.

Status Virtual Text

This is a virtual text variable that stores the exit code of the external program.  An exit code of 0 usually means that the program succeeded without error.  Any other exit code usually means that the program failed in some way.

Wait  for Program

This tells InstallJammer to wait until the external program finishes before continuing on with the install.  If this value is false, InstallJammer will execute the external program in the background and continue on.

Watch Progressive Output

If this property is true, and Show Progressive Output is true, InstallJammer will watch the output from the external program for cues that tell InstallJammer to set virtual text while it is running.  The text InstallJammer looks for looks like a line surrounded by : with a single word as the first argument followed by any other arguments.


:Status Checking for file...:

This will set the <%Status%> virtual text variable to the value "Checking for file..." and then refresh the screen.  This allows an external program to update the status or progres bars while it is running to keep the GUI alive so that the user knows what is going on while it is running.  Any line that matches the output that InstallJammer is looking for will not be displayed in the output.  It will be swallowed by InstallJammer before the user sees it.

Watch Regular Expression

This property specifies the regular expression to use when watching progressive output.  By default, it looks for text in the manner described for Watch Progressive Output, but this property can be changed to look for any other kind of pattern.  If the regular expression provides two submatch values, they will be used as the virtual text variable name and the value to set the virtual text to.  If there is only one or no submatch, the Watch Virtual Text property will be used to store the value that matches.  This property should only be changed if you really know what you're doing and know enough about regular expressions.

Watch Virtual Text

If the Watch Regular Expression does not include two submatches, this virtual text will be used as the virtual text to set with the result of the regular expression when watching progressive output.