![Old](images/statusicon/post_old.gif)
04-08-2003, 09:00 AM
|
Administrator
|
|
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
|
|
How can I perform custom functionality from a Visual Build Pro project?
Sometimes you may need to perform logic in your project which is specific to your application which Visual Build Pro does not provide a built-in way to perform. You have a several options:
- You can easily extend Visual Build Pro with custom script capabilities by using Windows Script and a scripting language such as VBScript or JScript. Script expressions can be inserted anywhere the Script Editor button is enabled in the Step Properties dialog (script code is denoted by enclosing in [brackets]), and you can also create Run Script step actions to execute arbitary script code.
To send output to the Visual Build Pro log from your script, use the Builder.LogMessage method. See the Script.bld sample for several examples, and visit http://msdn.microsoft.com/scripting/ for more details on what you can do within your script.
- Any internal or external OS command or batch file can be called using a Run Program step and the DOSCMD system macro. This includes COPY, XCOPY, MKDIR, RMDIR, MOVE, ATTRIB, FIND, DEL, DIR, FORMAT, SYS, etc., plus any batch/CMD language statements (FOR, TYPE, ECHO, NET, etc.). The tool output will be captured and displayed in the Visual Build Pro build view and log file if logging is enabled. The VStudio.bld, Advanced.bld, and Ftp.bld samples provide several examples of using OS commands in a Visual Build Pro project.
To redirect the command's output to a file, use the command interpreter redirection character (>). For example:
Code:
%DOSCMD% > "%TEMP%\output.txt" "path+exename to run" [parameters for exe]
- You can also extend Visual Build Pro by creating your own custom actions to provide a custom UI and logic within a build.
|