PDA

View Full Version : builder.CompletionStatus and vbld_BuildDone()


citect
03-04-2010, 05:36 PM
Hi

I have got the project script below. The function "CreateXmlLogHandlingProject()" is working fine if "status" = vbldBuildCompFailed but it fails to run when "status" = vbldBuildCompDone or "status" = vbldBuildCompAborted.
When the script failed the last msgbox displayed is "Test 3".


Script:


Option Explicit

Function LogExt()

If Application.Options.LogFormat = "Text" Then
LogExt = "txt"
Else
LogExt = "xml"
End If

End Function


Function vbld_BuildStarting()
' delete any existing log file before the build begins
' This can be useful if a master project calls child projects
' which use the same log file as the master project, but the
' log file should be deleted only at the start of the master build.
' The global option 'Tools | Application Options | Logging | Delete
' log file at the start of each build' would cause the log file to
' be deleted at the beginning of the master and each child project,
' so instead that option can be unchecked and this step added to the
' start of the master project.

Dim logFile, message

' determine the log filename, retrieve with all macros/script expanded
logFile = Application.ExpandMacrosAndScript("%LOGFILE%")

' delete the file if it exists
If vbld_FSO.FileExists(logFile) Then
message = "Deleting log file '" + logFile + "' from vbld_BuildStarting event (go to Script Editor, Project tab to view script code)."
Builder.LogMessage vbCrLf + message + vbCrLf

vbld_FSO.DeleteFile logFile, True
End If
End Function


Function vbld_BuildDone(status)
CreateXmlLogHandlingProject(status)
End Function




Dim objApp, objBld, objStep, objMacro
Dim toEmailObjMacro, emailSubjectObjMacro, emailContentObjMacro

Function CreateXmlLogHandlingProject(status)

' create VisBuildPro app and build objects and connect
Set objBld = CreateObject("VisBuildSvr7.Builder")
Set objApp = CreateObject("VisBuildSvr7.Application")

objBld.Initialize objApp

' create a "XmlFilePath" macro containing the path of this project log file
Set objMacro = objApp.Project.Macros.Add("XmlFilePath")
objMacro.Value = Application.ExpandMacrosAndScript("%LOGFILE%")

' create a "HtmlFilePath" macro containing the path of the log file transformation result
Set objMacro = objApp.Project.Macros.Add("HtmlFilePath")
objMacro.Value = "%TEMP%\%PROJROOT%.html"
objMacro.Value = Application.ExpandMacrosAndScript(objMacro.Value)

' create a "LogFormat" macro indicating the format of this project log file
Set objMacro = objApp.Project.Macros.Add("LogFormat")
objMacro.Value = Application.Options.LogFormat

msgbox "status = " & status, vbOK, "CreateXmlLogHandlingProject"
msgbox "Test 1", vbOK, "CreateXmlLogHandlingProject"

' create a "TO_EMAIL" macro containing the email distribution list
Set objMacro = objApp.Project.Macros.Add("TO_EMAIL")
Select case status
case vbldBuildCompDone
objMacro.Value = ""%myEmail%"
case vbldBuildCompAborted
objMacro.Value = ""%myEmail%"
case vbldBuildCompFailed
objMacro.Value = "%myEmail%"
case else
objMacro.Value = ""%myEmail%"
end Select

msgbox "Test 2, objMacro.Value = " & objMacro.Value, vbOK, "CreateXmlLogHandlingProject"

' create a "EmailSubject" macro containing the subject of the email
Set objMacro = objApp.Project.Macros.Add("EmailSubject")

msgbox "Test 3", vbOK, "CreateXmlLogHandlingProject"

Select case status
case vbldBuildCompDone
objMacro.Value = "Nightly Build Result (COMPLETED)"
case vbldBuildCompAborted
objMacro.Value = "Nightly Build Result (ABORTED)"
case vbldBuildCompFailed
objMacro.Value = "Nightly Build Result (FAILED)"
case else
objMacro.Value = "Nightly Build Result (UNKNOWN STATUS='" + CStr(status) + "')"
end Select

msgbox "Test 4, objMacro.Value = " & objMacro.Value, vbOK, "CreateXmlLogHandlingProject"

' create a "EmailContent" macro containing the content of the email
Set objMacro = objApp.Project.Macros.Add("EmailContent")

msgbox "Test 5", vbOK, "CreateXmlLogHandlingProject"

Select case status
case vbldBuildCompDone
objMacro.Value = Application.ExpandMacrosAndScript("At %DATETIME%, the build '%PROJFILE%' on %COMPUTERNAME% completed successfully.") + vbCrLf + vbCrLf + vbCrLf
case vbldBuildCompAborted
objMacro.Value = Application.ExpandMacrosAndScript("At %DATETIME%, the build '%PROJFILE%' on %COMPUTERNAME% was canceled by the user.") + vbCrLf + vbCrLf + vbCrLf
case vbldBuildCompFailed
objMacro.Value = Application.ExpandMacrosAndScript("At %DATETIME%, the build '%PROJFILE%' on %COMPUTERNAME% failed.") + vbCrLf + vbCrLf + vbCrLf
case else
objMacro.Value = Application.ExpandMacrosAndScript("At %DATETIME%, the build '%PROJFILE%' on %COMPUTERNAME% exit with unknow status: '") + CStr(status) + "'" + vbCrLf + vbCrLf + vbCrLf
end Select

msgbox "Test 6, objMacro.Value = " & objMacro.Value, vbOK, "CreateXmlLogHandlingProject"

' add a "Group" step and set its properties
With CreateStep(vbldStepMain, "Group", "XML log handling", 0)
.Property("condcomparison") = 6
.Property("condexpr") = "[Len(%QUOTE_STR(%XmlFilePath%)%) > 0 And ""%LogFormat%"" = ""XML""]"
.Property("description") = "Show extra capabilities for XML log files only, processed only if log format is XML"
End With

msgbox "Test 7", vbOK, "CreateXmlLogHandlingProject"

' add a "Transform XML Log" step and set its properties
With CreateStep(vbldStepMain, "Transform XML Log", "Generate HTML log", 1)
.Property("Build0") = -1
.Property("Build1") = -1
.Property("Build2") = -1
.Property("CloseTags") = -1
.Property("InputFile") = "%XmlFilePath%"
.Property("Log0") = -1
.Property("Log1") = -1
.Property("Log2") = -1
.Property("Log3") = -1
.Property("Log4") = -1
.Property("LogNested") = -1
.Property("OutputFile") = "%HtmlFilePath%"
.Property("ShowFile") = -1
.Property("Step0") = -1
.Property("Step1") = -1
.Property("Step2") = -1
.Property("Step3") = -1
.Property("Step4") = -1
.Property("Step5") = -1
.Property("Step6") = -1
.Property("XSLTFile") = "%VISBUILDDIR%\Style\TransformLog.xslt"
.Property("description") = "Perform transform on log file, converting to formatted HTML log with summary, uses built-in XSLT stylesheet"
End With

msgbox "Test 8", vbOK, "CreateXmlLogHandlingProject"

' add a "Send Mail" step and set its properties
With CreateStep(vbldStepMain, "Send Mail", "Send Log File", 1)
.Property("Attachments") = "%HtmlFilePath%"
.Property("Domain") = "%USERDNSDOMAIN%"
.Property("From") = "%USERNAME%@%USERDNSDOMAIN%"
.Property("Message") = "%EmailContent%"
.Property("Port") = 25
.Property("Server") = "%Server%"
.Property("Subject") = "%EmailSubject%"
.Property("Timeout") = 10
.Property("To") = "%TO_EMAIL%"
.Property("description") = "Send the log file via email"
End With


' save the project to disk to build in following step
'objApp.Project.Save "TEMP\dynamic.bld"

'MsgBox "Dynamic file location: TEMP\dynamic.bld", vbOkOnly, "Visual Build Pro"

' build the dynamic project
objBld.SyncBuild



End Function


' add a step to the project and return
Function CreateStep(typ, action, name, indent)
Set objStep = objApp.Project.Steps(typ).Add(action)
objStep.Name = name
objStep.Indent = indent
Set CreateStep = objStep
End Function

kinook
03-04-2010, 11:45 PM
It looks like you have extra double quotes here:

Select case status
case vbldBuildCompDone
objMacro.Value = ""%myEmail%"
case vbldBuildCompAborted
objMacro.Value = ""%myEmail%"
case vbldBuildCompFailed
objMacro.Value = "%myEmail%"
case else
objMacro.Value = ""%myEmail%"
end Select

which should be

Select case status
case vbldBuildCompDone
objMacro.Value = "%myEmail%"
case vbldBuildCompAborted
objMacro.Value = "%myEmail%"
case vbldBuildCompFailed
objMacro.Value = "%myEmail%"
case else
objMacro.Value = "%myEmail%"
end Select

citect
03-05-2010, 01:10 AM
The extra quotes are a typo mistake. They do not exist in my real script.
The function now seems to work for failed and done status but it is still not working for the abort status.

kinook
03-05-2010, 10:32 AM
I'm not sure -- Changing the event code to:

Function vbld_BuildDone(status)
CreateXmlLogHandlingProject(vbldBuildCompDone)
CreateXmlLogHandlingProject(vbldBuildCompFailed)
CreateXmlLogHandlingProject(vbldBuildCompAborted)
End Function

and building succeeds in our tests. Please send the info requested here:
http://www.kinook.com/Forum/showthread.php?threadid=3044

citect
03-07-2010, 05:17 PM
1) The info from Help | About | Install Info:

Visual Build Professional 7.2a
Registered to: Citect by Schneider Electric (5-computer license)
Windows Version: 5.1.2600.3.0
Install path: C:\Program Files\VisBuildPro7
HideConsole.exe version 1.0.0.0
SftPrintPreview_IX86_U_20.dll version 2.02
VisBuildCmd.exe version 7.2.1.1
VisBuildPro.exe version 7.2.1.3
VisBuildAct.dll version 7.2.1.3
VisBuildCore.dll version 7.2.1.2
VisBuildDotNET.dll version 7.2.1.0
VisBuildExt.dll version 7.2.1.2
VisBuildMisc.dll version 7.2.1.2
VisBuildMS.dll version 7.2.1.1
VisBuildMS2.dll version 7.2.1.0
VisBuildNet.dll version 7.2.1.2
VisBuildSvr.dll version 7.2.1.3
VisBuildSvr.Interop.dll version 1.0.0.0
VisBuildVCS.dll version 7.2.1.1

2) Configuration Files:
See attached zip file

3) Other program Info:
Not Applicable

4) Problem Description:
See previous post. Also I attached the full bld file. The project is run from VisBuildPro.exe.

5) Detailed steps to reproduce the problem:
a) Failed Status(script works)
Run the bld project then press cancel when asked to enter a value to the macro.
b) Abort Status(script does not work)
Step the first step and then press the abort buton

6) bld file to reproduce the problem:
You will need to change the following line:
.Property("Server") = "AMAUSYD2.au.schneider-electric.com"

7) Log files:
Please not that when the bld project is aborted then there is no log file generated. I attached the log file when the bld project failed. I attached the trace from the output window from both scenarios(Failed status & Abort status).

kinook
03-08-2010, 10:09 AM
I don't see a .bld file in the attachment.

citect
03-08-2010, 04:31 PM
Sorry do not know what happened. re-attached with the bld proj

kinook
03-08-2010, 04:57 PM
When I build the project, I get a prompt for CompileDir undefined macro, and after canceling the prompt:


Deleting log file 'C:\Users\user\DriverBuild.xml' from vbld_BuildStarting event (go to Script Editor, Project tab to view script code).

3/8/2010 2:53:08 PM: -------------------- Starting Build: 'DriverBuild.bld' --------------------
3/8/2010 2:53:08 PM: Building project step 1 - Project steps...
3/8/2010 2:53:08 PM: Building project step 2 - usage issue...
3/8/2010 2:53:08 PM: Building project step 3 - Exit...
Error expanding macros or script in property Message: VisBuildCmd.exe DriverListFile="path" InstallerOutputDir="path" [SignCommonName="name" EULA="path"] VisualBuildProjectFile

Required Properties:
DriverListFile - XML file containing the list of drivers to be included
InstallerOutputDir - Folder where the Diver Pack will be copied into
Optional Properties:
SignCommonName - Common name for certificate to use for signing. Default "Schneider Electric"
EULA - End Usr License Agreement to use in the Driver Pack Installer. Default checked in at
<Undefined macro CompileDir>
3/8/2010 2:53:46 PM: Build ended (elapsed = 00:00:38).

status = 1


Test 1


Test 2, objMacro.Value = <email addresses>


Test 3


Test 4, objMacro.Value = Nightly Build Result (FAILED)


Test 5


Test 6, objMacro.Value = At 3/8/2010 2:53:46 PM, the build 'D:\Temp\support\DriverBuild.bld' on XYZ failed.





Test 7


Test 8



I also tried adding an Exit step (status of Cancel) at the beginning of the project, which results in:

3/8/2010 2:55:02 PM: -------------------- Starting Build: 'DriverBuild.bld' --------------------
3/8/2010 2:55:02 PM: Building project step 1 - Project steps...
3/8/2010 2:55:02 PM: Building project step 2 - Exit...
3/8/2010 2:55:02 PM: Build canceled by user (elapsed = 00:00:00).

status = 2


Test 1


Test 2, objMacro.Value = <email address>


Test 3


Test 4, objMacro.Value = Nightly Build Result (ABORTED)


Test 5


Test 6, objMacro.Value = At 3/8/2010 2:55:02 PM, the build 'D:\Temp\support\DriverBuild.bld' on XYZ was canceled by the user.





Test 7


Test 8


A log file is created in both cases.

citect
03-08-2010, 05:25 PM
To abort the script I used the "stop (ctrl+break)" button, the status is still abort but the project does not seem to complete.

If I run the bld project from visualcmd and the user press ctrl+break, will the project run to the end. I would like to receive an email when the user abort the project.

kinook
03-08-2010, 06:08 PM
A couple problems with this:
1) The file loggers are currently disposed of before the vbld_BuildDone script event fires.
2) When the build is canceled, if the vbld_BuildDone event takes very long to run, it will be aborted (to handle the situation of a build being aborted while script code is executing, but it should wait for this particular event to finish).

We'll investigate explicitly supporting this in the future (there's also a request to support building failure steps if the build is canceled, which would provide another way to achieve this).

For now, you might try shortening the event script code (maybe just call Builder.RunProgram to invoke a pre-defined send mail project, passing dynamic parameters on the command-line).

citect
03-08-2010, 06:18 PM
thanks for that. How can I be notified when you implemented point 2)?

kinook
03-08-2010, 06:41 PM
We'll notify on this thread and also see http://www.kinook.com/Forum/showthread.php?threadid=2985

kinook
03-11-2010, 10:21 AM
These are implemented in v7.5.
http://www.kinook.com/Forum/showthread.php?threadid=4415

citect
03-24-2010, 12:38 AM
Hi

I installed the visualbuild 7.5 and one of my step is not working anymore.

1) See attached file
2) See attached file
3) N/A
4) The step "148 - Source-index The Driver PDBs..." in my project is not working anymore when using VisBuilCmd.exe. The step is just a "command" step This step used to work with 7.2a. Also this step is working if I use VisBuildPro.exe, not sure what is the difference!!
Attached the log file for both command "VisBuilCmd.exe" and "VisBuildPro.exe" of 7.5
5) Reproduceable with my project but required special structure.
6) See attached file
7) See attached file

citect
03-24-2010, 01:26 AM
I find a way for you to reproduce it using the attached file. The project works if using VisBuildPro but not with VisProCmd. You will need to change the path of the bat file in step 2.


The output expected should be:

echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\DrvGrp\NonODC\Utilities\DriverPackBuilder>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\DrvGrp\NonODC\Utilities\DriverPackBuilder>echo "/Debug=1"
"/Debug=1"

rem D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

kinook
03-24-2010, 08:55 AM
I get the same result for Pro and Cmd:

"D:\Temp\support\forum\DriverPack.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"
Getting latest version of driver pack builder script.
'tf' is not recognized as an internal or external command,
operable program or batch file.
Calling driver pack builder.
The system cannot find the path specified.
Press any key to continue . . .
Press any key to continue . . .


Try prefixing the Command field with

%DOSCMD% call

http://www.kinook.com/VisBuildPro/Manual/programtab.htm

If that doesn't help, please try uninstalling Visual Build and downloading+installing http://www.kinook.com/Download/Temp/VisBuildProTest.exe

Thanks.

citect
03-24-2010, 04:09 PM
Try the last project(sourceindex.bld) I attached. The project just run a batch file. The batch file has on only echo command in it. I can see the echo lines if I use VisBuildPro but I cannot see them if I used VisBuildcmd. It looks like batch file are not run with VisBuildCmd!!!

kinook
03-24-2010, 04:20 PM
I *did* build sourceindex.bld. The contents of DriverPack.bat are:

@echo off
echo Getting latest version of driver pack builder script.
tf get /force /noprompt $/Drivers/Utilities/DriverPackBuilder

echo Calling driver pack builder.
"C:\Program Files\VisBuildPro7\VisBuildCmd.exe" DLLPATHS=%1 "D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\Drive rPack.bld"
pause
pause


and the output from both VisBuildCmd.exe and VisBuildPro.exe are the same (shown in my earlier post). Did you try my suggestions?

citect
03-24-2010, 04:23 PM
I tried VisBuildProTest.exe but I get the same result. My project was working fine with 7.1 and 7.2. It stops working when I upgraded to 7.5.

citect
03-24-2010, 04:29 PM
sourceIndex.bld has just a command step that call the batch file tfsindex.bat.

Sorry I put the wrong batch file. please find the correct one attached. you will need to rename the file to .bat

kinook
03-24-2010, 04:44 PM
Your sourceIndex.bld was calling DriverPack.bat, not tfsindex.bat. I changed it to call tfsindex.bat and saved tfsindex.txt as tfsindex.bat (attached). With both cmd and pro, I get output of

3/24/2010 3:40:23 PM: -------------------- Starting Build: 'sourceIndex.bld' --------------------
3/24/2010 3:40:23 PM: Building project step 1 - Project steps...
3/24/2010 3:40:23 PM: Building project step 2 - Source-index The Driver PDBs...
"D:\Temp\support\forum\tfsindex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

D:\Temp\support\forum>echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\Temp\support\forum>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\Temp\support\forum>echo "/Debug=1"
"/Debug=1"

D:\Temp\support\forum>D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"
The system cannot find the path specified.

Process completed with exit code 1
Step failed, retry #1
Pausing 5 seconds...
"D:\Temp\support\forum\tfsindex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

D:\Temp\support\forum>echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\Temp\support\forum>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\Temp\support\forum>echo "/Debug=1"
"/Debug=1"

D:\Temp\support\forum>D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"
The system cannot find the path specified.

Process completed with exit code 1
Step failed, retry #2
Pausing 5 seconds...
"D:\Temp\support\forum\tfsindex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

D:\Temp\support\forum>echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\Temp\support\forum>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\Temp\support\forum>echo "/Debug=1"
"/Debug=1"

D:\Temp\support\forum>D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"
The system cannot find the path specified.

Process completed with exit code 1
3/24/2010 3:40:33 PM: Step '2 - Source-index The Driver PDBs' failed
3/24/2010 3:40:33 PM: Build ended (elapsed = 00:00:09).


Did you try prefixing with %DOSCMD% call?

citect
03-24-2010, 04:53 PM
I tried prefixing with %DOSCMD% call but I get the result

citect
03-24-2010, 05:08 PM
I put REM in the last line of the batch file and I remove the retry in the bld project and I get the following:

VisBuildPro
Trial version: 30 days remaining
3/25/2010 9:04:35 AM: -------------------- Starting Build: 'sourceIndex.bld' --------------------
3/25/2010 9:04:35 AM: Building project step 1 - Project steps...
3/25/2010 9:04:35 AM: Building project step 2 - Source-index The Driver PDBs...
Step default property 'command' = 'C:\WINDOWS\system32\cmd.exe /C call "D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"'
C:\WINDOWS\system32\cmd.exe /C call "D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

D:\DrvGrp\NonODC\Utilities\DriverPackBuilder>echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\DrvGrp\NonODC\Utilities\DriverPackBuilder>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\DrvGrp\NonODC\Utilities\DriverPackBuilder>echo "/Debug=1"
"/Debug=1"

D:\DrvGrp\NonODC\Utilities\DriverPackBuilder>REM D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"
3/25/2010 9:04:35 AM: Build successfully completed (elapsed = 00:00:00).


VisBuildCmd

VisBuildCmd, Version 7.5.0.2
Copyright (C) 1999-2010 Kinook Software, Inc. All rights reserved.
Trial version: 30 days remaining

3/25/2010 9:09:05 AM: Starting Build: 'D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\sour ceIndex.bld'
3/25/2010 9:09:05 AM: Building project step 'Project steps'...
3/25/2010 9:09:05 AM: Building project step 'Source-index The Driver PDBs'...
Step default property 'command' = 'C:\WINDOWS\system32\cmd.exe /C call "D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products
\Drivers\DNPR\4.02.24.001" "/Debug=1"'
C:\WINDOWS\system32\cmd.exe /C call "D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=
1"
3/25/2010 9:09:05 AM: Build successfully completed (elapsed = 00:00:00).



It looks like the batch file is not fired up. How can I get hold of 7.2a

citect
03-24-2010, 06:15 PM
I replied to your email directly. Did you received them?

How can I get hold of 7.2a?

We are using the build project quite a lot and I will be on leave tomorrow night. I need to restore a working system by then.

thanks

Gilles

kinook
03-24-2010, 06:33 PM
http://www.kinook.com/Download/Old/VisBuildPro72a.exe

citect
03-24-2010, 06:58 PM
I am very puzzled now. I uninstalled 7.5 and re-installed 7.2a and the batch file is still not working when using VisBuildCmd. I am pretty sure the batch files were working before the installation of 7.5.

I do not think I uninstalled the system files. May be there are the problem.

Please can you which file where put in c:\windows\system by vis build installer?

kinook
03-24-2010, 07:56 PM
None of the files installed to the system folder have changed since v7.2a, and I'm pretty sure they wouldn't affect this issue, but they are:
csftpav6.dll
cshtpav6.dll
csmsgav6.dll
csmtpav6.dll
csnwsav6.dll
cspopav6.dll
cstntav6.dll
cstrace6.dll
cstshav6.dll
capicom.dll
dzgt32.dll
dzips32.dll
dunzips32.dll

It appears the problem is that when a Run Program step calls your cmd file (or a bat file, which in turn calls the cmd file), no output is captured for the step? That is a strange one -- we couldn't reproduce that problem here with cmd/bat files like this and sourceIndex.bld:

-- tfsindex.bat --
echo %1
echo %2
echo %3
%~dp0\tfsindex.cmd %1 %2 %3

-- tfsindex.cmd --
echo %1
echo %2
echo %3

which results in output of:

3/24/2010 6:54:36 PM: -------------------- Starting Build: 'sourceIndex.bld' --------------------
3/24/2010 6:54:36 PM: Building project step 1 - Project steps...
3/24/2010 6:54:36 PM: Building project step 2 - Source-index The Driver PDBs...
Step default property 'command' = '"D:\Temp\support\forum\tfsindex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"'
"D:\Temp\support\forum\tfsindex.bat" "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

D:\Temp\support\forum>echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\Temp\support\forum>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\Temp\support\forum>echo "/Debug=1"
"/Debug=1"

D:\Temp\support\forum>D:\Temp\support\forum\\tfsindex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"

D:\Temp\support\forum>echo "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"
"/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2"

D:\Temp\support\forum>echo "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"
"/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001"

D:\Temp\support\forum>echo "/Debug=1"
"/Debug=1"

D:\Temp\support\forum>rem D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd "/Source=D:\DrvGrp\NonODC\VC8\Drivers\DNPr\Developme nt\Branch2" "/Symbols=\\syd-file01\volatile\TDG\Release Symbols\Products\Drivers\DNPR\4.02.24.001" "/Debug=1"


Can you isolate the problem to a cmd file we can build here that reproduces the behavior?

citect
03-24-2010, 08:16 PM
Any batch file is not working on my system. I get the same log (we can see the echo command of the batch file) as you when using VisBuildPro but not with VisBuildCmd.

You do not need to call a cmd or a bat file in the batch file called by Run Program step. The echo command is enough. I do not see the echo on my system.

How can we progress further?

kinook
03-24-2010, 09:36 PM
It is odd -- both apps call the very same component that actually performs the build. And going back to 7.2a, which was working, now doesn't. What is the output when building the attached project with a command of

"C:\Program Files\VisBuildPro7\VisBuildCmd.exe" test.bld

? And what gets written to the log file C:\Documents and Settings\All Users\Application Data\Kinook Software\Visual Build Professional 7\VisBuildPro.log?

Thanks.

citect
03-24-2010, 10:03 PM
I can see the time and the string abc when using VisBuildPro but I get the following output if I use VisBuildCmd (the time and "abc" are missing):

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test.bld

VisBuildCmd, Version 7.5.0.3
Copyright (C) 1999-2010 Kinook Software, Inc. All rights reserved.
Registered to: Citect by Schneider Electric (5-computer license)

25/03/2010 1:45:36 PM: Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test.bld'
25/03/2010 1:45:36 PM: Building project step 'Project steps'...
25/03/2010 1:45:36 PM: Building project step 'Create batch file'...
Step default property 'Filename' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat'
Creating file C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat
25/03/2010 1:45:36 PM: Building project step 'Run Program'...
Step default property 'command' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat abc'
25/03/2010 1:45:36 PM: Building project step 'Show exit code'...
0
25/03/2010 1:45:36 PM: Build successfully completed (elapsed = 00:00:00).

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>




See attachment for VisBuildPro.log. This is using 7.5. Also if an exe is called from the Run Program step it is working fine. I do not know what is the difference.
I installed 7.5 before I found out about this issue on a third machine and I get the same output as above (no time and "abc" shown).

kinook
03-25-2010, 06:50 AM
What is the result with the attached test2.bld?

Also, please send/post your current C:\Documents and Settings\All Users\Application Data\Kinook Software\Visual Build Professional 7\VisBuildPro.config file.

And what is the result with v7.1 (uninstall, then download+install http://www.kinook.com/Download/Old/VisBuildPro71.exe).

Thanks.

citect
03-25-2010, 04:26 PM
Do you want me to try test.bld and not test2.bld on 7.1?

The result of test2.bld is as follow when using 7.5:

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test2.bld

VisBuildCmd, Version 7.5.0.3
Copyright (C) 1999-2010 Kinook Software, Inc. All rights reserved.
Registered to: Citect by Schneider Electric (5-computer license)

26/03/2010 8:21:52 AM: Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test2.bld'
26/03/2010 8:21:52 AM: Building project step 'Project steps'...
26/03/2010 8:21:52 AM: Building project step 'Run Program'...
Step default property 'command' = 'C:\WINDOWS\system32\cmd.exe /C echo 26/03/2010 8:21:52 AM abc'
26/03/2010 8:21:52 AM abc
26/03/2010 8:21:52 AM: Building project step 'Show exit code'...
Exit code = 0

Output = Step default property 'command' = 'C:\WINDOWS\system32\cmd.exe /C echo 26/03/2010 8:21:52 AM abc'
26/03/2010 8:21:52 AM abc
26/03/2010 8:21:52 AM: Build successfully completed (elapsed = 00:00:00).

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>

citect
03-25-2010, 04:46 PM
I ve got the following result when 7.1 is installed, Test.bld is still not working:


TEST.BLD result:

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test.bld

VisBuildCmd, Version 7.1.0.1
Copyright (C) 1999-2009 Kinook Software, Inc. All rights reserved.
Evaluation Version: 30 days remaining

26/03/2010 8:44:15 AM: --------------------Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test.bld'--------------------
26/03/2010 8:44:15 AM: Building project step 'Project steps'...
26/03/2010 8:44:15 AM: Building project step 'Create batch file'...
Step default property 'Filename' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat'
Creating file C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat
26/03/2010 8:44:15 AM: Building project step 'Run Program'...
Step default property 'command' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat abc'
26/03/2010 8:44:15 AM: Building project step 'Show exit code'...
0
26/03/2010 8:44:15 AM: Build successfully completed.

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>






TEST2.BLD result:

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test2.bld

VisBuildCmd, Version 7.1.0.1
Copyright (C) 1999-2009 Kinook Software, Inc. All rights reserved.
Evaluation Version: 30 days remaining

26/03/2010 8:48:26 AM: --------------------Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test2.bld'------------------
26/03/2010 8:48:26 AM: Building project step 'Project steps'...
26/03/2010 8:48:26 AM: Building project step 'Run Program'...
Step default property 'command' = 'C:\WINDOWS\system32\cmd.exe /C echo 26/03/2010 8:48:26 AM abc'
26/03/2010 8:48:26 AM abc
26/03/2010 8:48:26 AM: Building project step 'Show exit code'...
Exit code = 0

Output = Step default property 'command' = 'C:\WINDOWS\system32\cmd.exe /C echo 26/03/2010 8:48:26 AM abc'
26/03/2010 8:48:26 AM abc
26/03/2010 8:48:26 AM: Build successfully completed.

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>

citect
03-25-2010, 05:33 PM
I might have some useful info:


After re-installing 7.1 and 7.2a the TEST.bld would still not work. But I was using the same cmd window as 7.5 to run the VisBuildCmd.

After opening a new cmd window and run VisBuildCmd on 7.1 then test.bld works fine.

Then I re-installed 7.5 and run VisBuildCmd on the same cmd window, TEST.bld is not working. Actually the bat file is not working anymore if I run it directly on the cmd window. It looks like the output are disabled for this cmd window but not entirely sure because I pretty sure that batch file is not executed at all.

Open a new cmd windows and run the same batch file directly from the window then the batch file works fine.


See the results:

*** Batch file run directly on a new cmd window (Works fine):

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>tfsindex.bat

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>echo
ECHO is on.

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>echo
ECHO is on.

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>echo
ECHO is on.

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>rem D:\DrvGrp\NonODC\Utilities\DriverPackBuilder\tfsin dex.cmd



*** test.bld using 7.1 on the same cmd window (works fine):

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test.bld

VisBuildCmd, Version 7.1.0.1
Copyright (C) 1999-2009 Kinook Software, Inc. All rights reserved.
Evaluation Version: 30 days remaining

26/03/2010 9:05:38 AM: --------------------Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test.bld'--------------------
26/03/2010 9:05:38 AM: Building project step 'Project steps'...
26/03/2010 9:05:38 AM: Building project step 'Create batch file'...
Step default property 'Filename' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat'
Creating file C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat
26/03/2010 9:05:38 AM: Building project step 'Run Program'...
Step default property 'command' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat abc'

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>echo 26/03/2010 9:05:38 AM abc
26/03/2010 9:05:38 AM abc
26/03/2010 9:05:39 AM: Building project step 'Show exit code'...
0
26/03/2010 9:05:39 AM: Build successfully completed.




*** test.bld using 7.5 on the same cmd window (Does not work):

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test.bld

VisBuildCmd, Version 7.5.0.3
Copyright (C) 1999-2010 Kinook Software, Inc. All rights reserved.
Trial version: 30 days remaining

26/03/2010 9:12:35 AM: Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test.bld'
26/03/2010 9:12:35 AM: Building project step 'Project steps'...
26/03/2010 9:12:35 AM: Building project step 'Create batch file'...
Step default property 'Filename' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat'
Creating file C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat
26/03/2010 9:12:35 AM: Building project step 'Run Program'...
Step default property 'command' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat abc'
26/03/2010 9:12:35 AM: Building project step 'Show exit code'...
0
26/03/2010 9:12:36 AM: Build successfully completed (elapsed = 00:00:01).

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>



*** Batch file run directly on the same cmd window (Does not work):

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>tfsindex.bat

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>

kinook
03-25-2010, 05:42 PM
Please build the attached init.bld project in the GUI and exit Visual Build, then in a new Command Prompt, build test3.bld (and also post VisBuildPro.config again). Thanks.

citect
03-25-2010, 05:57 PM
To run init.bld project I had to install 7.5.0.4 (This version is not available for download, is it?)


Run the test.bld on a new cmd window and it works file, see result below:

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>"c:\Program Files\VisBuildPro7\VisBuildCmd.exe" test.bld

VisBuildCmd, Version 7.5.0.4
Copyright (C) 1999-2010 Kinook Software, Inc. All rights reserved.
Trial version: 30 days remaining

26/03/2010 9:52:47 AM: Starting Build: 'C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test\test.bld'
26/03/2010 9:52:47 AM: Building project step 'Project steps'...
26/03/2010 9:52:47 AM: Building project step 'Create batch file'...
Step default property 'Filename' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat'
Creating file C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat
26/03/2010 9:52:47 AM: Building project step 'Run Program'...
Step default property 'command' = 'C:\DOCUME~1\GILLES~1.FAU\LOCALS~1\Temp\test.bat abc'

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>echo 26/03/2010 9:52:47 AM abc
26/03/2010 9:52:47 AM abc
26/03/2010 9:52:47 AM: Building project step 'Show exit code'...
0
26/03/2010 9:52:47 AM: Build successfully completed (elapsed = 00:00:00).

C:\Documents and Settings\gilles.faure\My Documents\temp\kinook test>

kinook
03-25-2010, 07:08 PM
Ok, it looks like the issue was with a change to improve capturing of Unicode text from console apps (apparently this only works on Windows Vista and later). Disabling that option (what init.bld does) in the 7.5.0.4 build will work. We have also backed that change out, and the main download should now work as expected (VisBuildCmd.exe 7.5.0.2 -- uninstall the current version first) from a new Command Prompt. Thanks.

citect
03-25-2010, 07:45 PM
thanks for that, it seems to work. Your effort are appreciated