Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-15-2003, 03:53 PM
Dean Dean is online now
Registered User
 
Join Date: 05-14-2003
Posts: 8
Question why do i keep getting this

this still deals with getting the following error each time i build. this did not start happening until yesterday.

--------------------Starting Build: '422build.bld'--------------------
Building project step 'mlsall Project'...

Process completed with exit code 128
Building project step 'Copy files to InstallShield'...



also is there a way to check if a certain exe or dll's exist if they do not then fail?
Reply With Quote
  #2  
Old 05-15-2003, 05:15 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
The following JScript function does the trick:

function FileExists (filename)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
return fso.FileExists(filename);
}


The VBScript version would be similar, but I don't have an example of it.

One way to use the it is to put something like the following in a script step:

if (! FileExists ("filePath\\fileName"))
throw "failure"

Note that the path seperator '\' needs to be quoted in JScript strings. This can be a real trap if you have the file name in a macro and do this:

"%FileName%"

where %FileName% = filePath\fileName

the result is:

"fileNamefilePath"
Reply With Quote
  #3  
Old 05-15-2003, 05:52 PM
Dean Dean is online now
Registered User
 
Join Date: 05-14-2003
Posts: 8
if i have a variable (FIRSTVAR) already set can I have the program "look" into the directory (DIRVAR) and if the FIRSTVAR exists then continue if not stop and throw an error?
Reply With Quote
  #4  
Old 05-15-2003, 06:15 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
put something like the following in a script step:

if (! FileExists (Application.FindMacro ("DIRVAR").Value + "\\" + Application.FindMacro ("FIRSTVAR").Value))
throw "failure"

The Application.FindMacro bit avoids the \ problem.
Note that this assumes that you are using JScript. Something similar works for VBScript but the throw becomes:

Err.Raise 1, Step.Name, "Forcing build failure..."
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 03:31 PM.


Copyright 1999-2019 Kinook Software, Inc.