PDA

View Full Version : How can I perform custom functionality from a Visual Build Pro project?


kinook
04-08-2003, 09:00 AM
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:<ul>
<li>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 (http://www.kinook.com/VisBuildPro/Manual/scriptexpressions.htm) can be inserted anywhere the Script Editor (http://www.kinook.com/VisBuildPro/Manual/scripteditor.htm) button is enabled in the Step Properties (http://www.kinook.com/VisBuildPro/Manual/stepproperties.htm) dialog (script code is denoted by enclosing in [brackets]), and you can also create Run Script (http://www.kinook.com/VisBuildPro/Manual/runscript.htm) step actions to execute arbitary script code.

To send output to the Visual Build Pro log from your script, use the Builder (http://www.kinook.com/VisBuildPro/Manual/builderobject.htm).LogMessage method. See the Script.bld (http://www.kinook.com/VisBuildPro/Manual/scriptsample.htm) sample for several examples, and visit <a target="_blank" href="http://msdn.microsoft.com/scripting/">http://msdn.microsoft.com/scripting/</a> for more details on what you can do within your script.

<li>Any internal or external OS command or batch file can be called using a Run Program (http://www.kinook.com/VisBuildPro/Manual/runprogramaction.htm) 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 (http://www.kinook.com/VisBuildPro/Manual/samples.htm) provide several examples of using OS commands in a Visual Build Pro project.<br>
To redirect the command's output to a file, use the command interpreter redirection character (>). For example:%DOSCMD% &gt; "%TEMP%\output.txt" "path+exename to run" [parameters for exe]
<li>You can also extend Visual Build Pro by creating your own custom actions (http://www.kinook.com/VisBuildPro/Manual/userdefaction.htm) to provide a custom UI and logic within a build.</ul>