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 10-03-2005, 01:31 PM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
VBScript code failing

I have been attempting to copy the log file from the build, rename it, and send an email from the vbld_BuildDone script event. I initially tried to do everything with VBScript from within VBP. I continually ran into errors where the code would simply stop executing without any error. I then tried the attached code to dynamically build a batch file and then execute it. It also does not work. The last line that calls the MsgBox never executes. I am beginning to have concern for the reliablity of this tool.

Are there any known restrictions/limitations on the use of VBScript code in VBP? What about on the length of strings? Is there any way to debug the script code?
Reply With Quote
  #2  
Old 10-03-2005, 03:57 PM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
The attached code works fine the the VBP 6 Beta. It does not work with v5.7 or v5.6
Reply With Quote
  #3  
Old 10-03-2005, 04:49 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I don't see any attachments.
Reply With Quote
  #4  
Old 10-03-2005, 04:51 PM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
Here is the file.
Attached Files
File Type: zip temp2.zip (1.3 KB, 1502 views)
Reply With Quote
  #5  
Old 10-03-2005, 05:17 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The messagebox displays here on Windows XP SP2 in VBP 5.7 and 6.0. Which version/SP of Windows are you running on? Which Windows Script version? (use the following VBScript code in a Run Script step to report it:

Builder.LogMessage ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion

You can use MsgBox or Builder.LogMessage to aid debugging script code, although in this case, it seems like it would be a lot simpler to replace the script code with a Failure Send Mail step (ala the VStudio.bld sample).
Reply With Quote
  #6  
Old 10-03-2005, 05:26 PM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
Windows XP w/SP2
WSH 5.6

I am attaching the full build script. This uses a slightly different set of code which also didn't work.
Attached Files
File Type: zip mmss_newold.zip (19.8 KB, 1518 views)
Reply With Quote
  #7  
Old 10-03-2005, 06:25 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The On Error Resume Next call at the top of the vbld_BuildDone function can result in errors being silently eaten. Remove or comment out that line of code to determine which line of code is actually failing.
Reply With Quote
  #8  
Old 10-04-2005, 09:42 AM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
I will try that but it doesn't explain why the project works as is in 6.0 Beta.
Reply With Quote
  #9  
Old 10-04-2005, 10:44 AM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
I have tried commenting out all references to 'On Error Resume Next' and the code still does not work.

Are there known limitations with the capabilities of VBScript within VBP? When I first started having problems I noticed that a single line of code with many string concatinations would not work. The same code broken up into multiple lines seemed to work more of the time. I also noticed that the function to create a directory tree did not succeed unless a sleep line was inserted or a msgbox.
Reply With Quote
  #10  
Old 10-04-2005, 10:58 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
There aren't any such limitations that we're aware of. Script is hosted in VBP in much the same way that other hosts do (cscript/wscript.exe, etc.), and that has not changed between v5 and v6. We have never seen or had any other reports of script that just stops in the middle without any error condition, and both samples you provided display a messagebox as expected at the end of the build when built here. I would suggest adding more logging to narrow down at what line of code it is stopping for you.
Reply With Quote
  #11  
Old 10-04-2005, 11:20 AM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
The problem that I have had there is that I am trying to copy the log file which means that I have to stop writing to it. Once I stop writing to the log file I have to start using MsgBox. I have discovered that after 4 to 6 successive calls to MsgBox the code will stop executing and if several of the MsgBox calls are commented out then the code will sometimes run further. I also had been using the 'On Error Resume Next' so that if the file copy fails (which it does) the email will still send.

I have not used a failure step as I want to send the email with different messages depending on whether the build succeeded or failed.

Could the log file copy operation be failing because the file is still open from VBP? When does the log file get closed?

I just tried the project on the our build server here which is running Windows 2000 w/SP 4 and WSH 5.6. It does not work there either.
Reply With Quote
  #12  
Old 10-04-2005, 11:51 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Possibly use a single MsgBox call and keep moving it down to see how far it gets.

It seems that using Send Mail / Copy Files steps at the end of the build (for success) and also in Failure steps would be exactly what you need if you want to send a different message on failure.

The only time the VBP logging components open the log file are to actually write something to it, which in the context of the vbld_BuildDone event would only happen due to a Builder.LogMessage call. And they open the file with share for read access, so even if they had it open when copied, I wouldn't expect that to cause the copy to fail. You might check the Event Viewer's application log to see if VBP reported any errors there that it couldn't log for some reason.

One other option to avoid copying would be to write the log file directly to the log archive directory.

I can't reproduce the problem here, so it's probably dependent on other build processing that doesn't happen here since we don't have everything needed to actually build your entire project. If you can narrow things down to a reproducible test case, that will greatly increase the chances of us being able to debug it.
Reply With Quote
  #13  
Old 10-06-2005, 01:29 PM
jjaymcdaniel jjaymcdaniel is online now
Registered User
 
Join Date: 10-03-2005
Location: Fredericksburg, VA
Posts: 8
I have tried the attached project on another engineer's computer running XP SP2 w/WSH 5.6. It did not work there either. I have only been executing the script down to the step named 'Delay Public Build'.
Attached Files
File Type: zip mmss_new.zip (19.7 KB, 1480 views)
Reply With Quote
  #14  
Old 10-10-2005, 08:31 AM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
The issue is that the build you have provided is not generic enough to be executed as-is without your development environment. When it is stripped down here to the point it can be executed, we can not reproduce the problem.

If you can simplify this build down to a reproduceable case (that can be executed without your build environment), please provide it so we can investigate the issue you report experiencing.
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:25 PM.


Copyright © 1999-2023 Kinook Software, Inc.