Navigation:  Object Model Reference > Builder Object >

RunProgram Method

Previous pageReturn to chapter overviewNext page

Creates a process to run an external application, logging any output that the process generates.  Any macros should be expanded before passing parameter values to the method.

 

Notes:

This method cannot be called from script code because the exitCode parameter is required, passed by reference, and of type Long.  Use RunProgramEx instead.
Use RunProgram2 from Run Program-derived custom actions with passwords in the command or to not use the extended wait property.

 

Syntax

 

builder.RunProgram(ByVal command As String, ByVal startIn As String, exitCode As Long, 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") As StepStatusEnum

 

Arguments

 

builder

       Builder object

 

command

       Required.  The command for the program to run.

 

startIn

       Required.  The path to set as the current directory for the launched process.  Can be an empty string.

 

exitCode

       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.

 

successCodes

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

 

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