View Full Version : Making a decision based on the existence of a file
cholzwarth
03-31-2011, 01:28 PM
I work on a product that has multiple servers and items can be installed on different servers as parts of different releases. My build stages msi files based on a list of items to be deployed. The actual build is done in Nant but wrapped in Visual Build Pro during the conversion process. The Nant build currently compiles the code and stages the files. I am looking for a way to determine if a particular file exists in the staging area and perform an action if the file exists. Is there a Visual Build Pro solution that can check for the existence of a file and either set a variable I can use later or call a subroutine to do the actions?
kinook
03-31-2011, 01:35 PM
Use a build rule with with a script expression like
[vbld_FSO.FileExists("c:\path\to\file.ext")]
is true
http://www.kinook.com/VisBuildPro/Manual/sysscriptfile.htm
http://www.kinook.com/VisBuildPro/Manual/scriptexpressions.htm
http://www.kinook.com/VisBuildPro/Manual/buildrules.htm
BetaLaserMike
03-27-2013, 04:10 PM
I would like to 'fail' the build if a file exists. I thought I could place the vbld_FSO.FileExists as a step and it would return 0 as a failed condition, but that did not work. How do I (or where do I) put something like:
if vbld_FSO.FileExists(".\BuildStarted") then
// continue build everything ok
else
// stop the build with a Failure condition...Previous build not completed since the
// file exists.
return 0
end if
I'm sure this is an easy question, I just do not know enough about the Visual build product.
Thanks.
BetaLaserMike
03-27-2013, 04:13 PM
never mind hopefully the single instance sample will do everything I want...
kinook
03-27-2013, 04:16 PM
See the attached sample.
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.