Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Making a decision based on the existence of a file (https://www.kinook.com/Forum/showthread.php?t=4820)

cholzwarth 03-31-2011 01:28 PM

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?

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/Ma...scriptfile.htm
http://www.kinook.com/VisBuildPro/Ma...xpressions.htm
http://www.kinook.com/VisBuildPro/Manual/buildrules.htm

BetaLaserMike 03-27-2013 04:10 PM

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.

BetaLaserMike 03-27-2013 04:13 PM

I found the Single instance sample.
 
never mind hopefully the single instance sample will do everything I want...

kinook 03-27-2013 04:16 PM

1 Attachment(s)
See the attached sample.


All times are GMT -5. The time now is 07:20 AM.


Copyright © 1999-2023 Kinook Software, Inc.