Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-31-2011, 01:28 PM
cholzwarth cholzwarth is online now
Registered User
 
Join Date: 03-19-2010
Posts: 5
Making a decision based on the existence of a file

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?
Reply With Quote
  #2  
Old 03-31-2011, 01:35 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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/Ma...scriptfile.htm
http://www.kinook.com/VisBuildPro/Ma...xpressions.htm
http://www.kinook.com/VisBuildPro/Manual/buildrules.htm
Reply With Quote
  #3  
Old 03-27-2013, 04:10 PM
BetaLaserMike BetaLaserMike is online now
Registered User
 
Join Date: 03-04-2013
Posts: 2
where do I put the FileExists

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.
Reply With Quote
  #4  
Old 03-27-2013, 04:13 PM
BetaLaserMike BetaLaserMike is online now
Registered User
 
Join Date: 03-04-2013
Posts: 2
I found the Single instance sample.

never mind hopefully the single instance sample will do everything I want...
Reply With Quote
  #5  
Old 03-27-2013, 04:16 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See the attached sample.
Attached Files
File Type: bld CheckExists.bld (798 Bytes, 1911 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:00 PM.


Copyright © 1999-2023 Kinook Software, Inc.