Kinook Software Forums

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

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 02-23-2011, 11:44 AM
bwilder bwilder is online now
Registered User
 
Join Date: 02-23-2011
Posts: 17
Error firing vbld_BuildStarting event

Hi,
Suddenly, today, a script of mine that has been running successfully for months failed to run with the following error in the output panel:

Error firing vbld_BuildStarting event: Error in Project (VBScript) script code at Line 51, Column 6
Build ended.

The build didn't even start, just sat there for a few seconds and eventually dumped out the error. The issue persists even when using backup copies of the scripts that are weeks or months old, so I doubt that it's the actual script that is causing the issue. Something must've changed with the environment, but I'm not sure how to proceed.

Where is the vbld_BuildStarting event located?
What VBScript should I look at to troubleshoot this?

Visual Build Professional Version 7.2a
Reply With Quote
  #2  
Old 02-23-2011, 11:52 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
Somewhere in the project script code (View | Other Windows | Script Editor -> Project tab). It's failing on line 51 (which could be the event function or a function called by it). Pressing F8 (Go | Last Error) after the error occurs should also take you there.
Reply With Quote
  #3  
Old 02-23-2011, 12:04 PM
bwilder bwilder is online now
Registered User
 
Join Date: 02-23-2011
Posts: 17
Thanks,
The full script is posted below and the failing method appears to be the CreateObject() method in the vbld_BuildStarting() method. Do you have any thoughts on what would causing this or how I would go about fixing it?

Code:
Sub CreateShortcut(target, sname)

	Set objWshShell = CreateObject("Wscript.Shell")
	
	' Read desktop path using WshSpecialFolders object
	strDesktopPath = objWshShell.SpecialFolders("Desktop")
	
	' Create a shortcut object on the desktop
	Set objShortcut = objWshShell.CreateShortcut(strDesktopPath & "\" & sname & ".lnk")
	
	' Set shortcut object properties and save it
	objShortcut.TargetPath = target
	objShortcut.Save
End Sub

Function IsVS2003Installed()
	IsVS2003Installed = Len(Application.ExpandMacros("%REG_READ(" & _
		"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir, )%")) > 1
End Function

Function IsVS2005Installed()
	IsVS2005Installed = Len(Application.ExpandMacros("%REG_READ(" & _
		"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\InstallDir, )%")) > 1	
End Function

Function IsVS2008Installed()
	IsVS2008Installed = Len(Application.ExpandMacros("%REG_READ(" & _
		"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\InstallDir, )%")) > 1
End Function

Function IsVB6Installed()
	IsVB6Installed = Len(Application.ExpandMacros("%REG_READ(" & _
		"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Basic\ProductDir, )%")) > 1
End Function

Function IsVC6Installed()
	IsVC6Installed = Len(Application.ExpandMacros("%REG_READ(" & _
		"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir, )%")) > 1
End Function

Function IsVSSInstalled()
	IsVSSInstalled = Len(Application.ExpandMacros("%REG_READ(" & _
		"HKCR\CLSID\{783CD4E4-9D54-11CF-B8EE-00608CC9A71F}\InprocServer32\, )%")) > 1
End Function

Sub vbld_BuildStarting()
dim a,b
a= 0
b= Builder.LaunchType
if a=b then
     CreateObject("wscript.shell").run "build\SenderResult.exe  submitstatus$b1",vbhide  
End If

End Sub




Sub vbld_BuildDone(status)
dim a,b
a=0
b= Builder.LaunchType
if a=b then 
    CreateObject("wscript.shell").run "build\SenderResult.exe buildresult$"&status&" submitstatus$"&"b2",vbhide
 End If

End Sub
Reply With Quote
  #4  
Old 02-23-2011, 12:13 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
Actually, it's probably failing on the .run method call, not CreateObject. You can determine that by separating into two lines:
Code:
Set shell = CreateObject("wscript.shell")
shell.run "build\SenderResult.exe  submitstatus$b1",vbhide
and seeing which line fails.
Reply With Quote
  #5  
Old 02-23-2011, 12:26 PM
bwilder bwilder is online now
Registered User
 
Join Date: 02-23-2011
Posts: 17
You were right, the "shell.run" line failed. As you might've guessed, I didn't build this script myself, I'm just maintaining it. Are the last 20 lines or so in my source standard or custom?

Code:
Sub vbld_BuildStarting()
dim a,b
a= 0
b= Builder.LaunchType
if a=b then
     CreateObject("wscript.shell").run "build\SenderResult.exe  submitstatus$b1",vbhide  
End If

End Sub




Sub vbld_BuildDone(status)
dim a,b
a=0
b= Builder.LaunchType
if a=b then 
    CreateObject("wscript.shell").run "build\SenderResult.exe buildresult$"&status&" submitstatus$"&"b2",vbhide
 End If

End Sub
I've checked for this in another installation of the same version of the product and I don't see it there.
If it's standard, do you have any idea what would cause it to suddenly start failing?

Thank you!
Reply With Quote
  #6  
Old 02-23-2011, 12:37 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,758
Visual Build does not have any predefined any script events. I don't know what SenderResult.exe is or what it does. Since the code uses a relative path, you might make sure that executable exists relative to the .bld file and that you have Tools | Application Options | General | Set current directory to project folder after loading and saving projects checked.
http://www.kinook.com/VisBuildPro/Manual/miscopt.htm
Reply With Quote
  #7  
Old 02-23-2011, 01:12 PM
bwilder bwilder is online now
Registered User
 
Join Date: 02-23-2011
Posts: 17
Yup, that did it. Someone moved the target files that were being called by that custom script.

Thanks for your help!
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 04:29 PM.


Copyright 1999-2019 Kinook Software, Inc.