Navigation:  Object Model Reference > Builder Object >

RunProgramEx Method

Previous pageReturn to chapter overviewNext page

Runs an external application, with advanced options.  Any macros should be expanded before passing parameter values to the method.

 

Notes:

If the wait parameter (or wait property for Run Program-derived actions) is True, the exit code of the process will be stored in the RUNPROGRAM_EXITCODE temporary macro.
If the wait parameter is False, the process ID of the launched process will be stored in the RUNPROGRAM_PROCESSID temporary macro.
The window option will be ignored for GUI applications if the Always show GUI applications option is checked.
Use RunProgramEx2 from Run Program-derived custom actions with passwords in the command or to not use the extended wait property.

 

Syntax

 

builder.RunProgramEx(ByVal command As String, ByVal startIn As String = "", ByRef exitCode As Variant = Null, ByVal outputLoc As OutputLocEnum = vbldOutputStdout, ByVal outputFile As String = "", ByVal delOutFile As Boolean = False, ByVal window As Boolean = False, ByVal wait As Boolean = True, ByVal successCodes As String = "0", ByVal redirInput As RedirectInputEnum = vbldRedirectNone, ByVal redirInputVal As String = "", ByVal logOutput As Boolean = True, ByVal returnOutput As Boolean = False, ByRef output As Variant = Null) As StepStatusEnum

 

Arguments

 

builder

       Builder object

 

command

       Required.  The command for the program to run.

 

startIn

       Optional.  The path to set as the current directory for the launched process.

 

exitCode

       Optional; returned value.  The exit code of the process.

 

outputLoc

       Optional.  The location to read output from.  The values for outputLoc are:

Constant

Value

Description

vbldOutputNone

0

Don't read any output from the program.

vbldOutputStdout

1

Read any output written to Stdout or Stderr.

vbldOutputFile

2

Read output from a file.

 

outputFile

       Optional.  The name of the output file to read if outputLoc is vbldOutputFile.

 

delOutFile

       Optional.  Whether to delete the output file before running the program if outputLoc is vbldOutputFile.

 

window

       Optional.  Whether to show a window for the process.

 

wait

       Optional.  Whether to wait for the process to complete or return as soon as the process is started.  For Run Program-derived actions, this parameter will be ignored and the value of the extended wait step property will be used directly.

 

successCodes

       Optional.  Exit codes to consider successful.  In the form code1, code2:code3

 

redirectInput

       Optional.  The location to provide redirected input from.  The values for redirectInput are:

Constant

Value

Description

vbldRedirectNone

0

Don't read send any input to the program.

vbldRedirectFile

1

Write the contents of the given file to the program's standard input.

vbldRedirectString

2

Write the given string to standard output.

 

redirectInputVal

       Optional.  The filename or string to provide program input from.

 

logOutput

       Optional.  Whether to log any captured output to the build log.

 

returnOutput

       Optional.  Whether to return the program's output in the output parameter.

 

output

       Optional.  A reference to a variable to populate with program output.

 

Return value

       The result of running the program.  The possible values are:        

Constant

Value

Description

vbldStepStatSucceeded

0

The step was successfully built or was marked to continue on failure.

vbldStepStatFailed

1

The step failed.

vbldStepStatAborted

2

The build was aborted by the user.

 

See Also

 

Applies to Builder object