TMS UpdateBuilder Compiler Issue

I have an FB7 UpdateBuilder Compiler action using Project Name: %SkylogProFolder%\skylgpro_605.UBProj. When I run it, I get an error:

 Compiling with parameters :  /C"%SkylogProFolder%\skylgpro_605.UBProj"
The file %SkylogProFolder%\skylgpro_605.UBProj does not exist
Success

The action is not 'translating' the project name. If I change the Project Name to the actual path: 'E:\Skylog Project\Skylog Pro\V650\Install\skylgpro_605.UBProj', it runs but I get a debugger error:

 'An Unhandled exception ('Type mismatch: CInt'') occurred in FinalBuilder7.exe [5996]. Debugger:

Sub OnStdOut(Context, Data)
'Parameters : Context - Provides access to the properties
'             Data - The text from StdOut.

'Context.SendLogMessage Data

res = Left(Data, 1)

if StrComp(res, "@") = 0 then
  Context.SendProgressMessage "Total progress", CInt(Trim(Right(Left(Data, 10), 3)))
else
  WScript.Echo(Data)
end if
End Sub

'Any script in here is available to the other script events for this action

Building directly with UpdateBuilder works fine. I'm using FB 7.0.0.3319 with Windows 7 Ultimate. The UpdateBuilder version is 1.0.9.6 - the latest.

Any ideas? Andrew

 

 

 

You need to expand variables yourself in the action using Context.ExpandExpression.


Also, you shoud not use WScript.Echo, WScript is an object provided by the windows script host program and not available in FinalBuilder. Use Context.SendLogMessage to write output to the log.

Thanks. However, I added Context.ExpandExpression([%SkylogProFolder%\skylgpro_605.UBProj) in the Action’s BeforeAction script and I get error: 

Error In Execute Condition (VBScript) Compile UpdateBuilder Project [%SkylogProFolder%\skylgpro_605.UBProj] : List index out of bounds (0)

I’m not familiar wit using Vbscript in FB. What is the correct function call?

Andrew

Actually, I added: result=Context.ExpandExpression(%SkylogProFolder%) to the Runtime>Execute Condition entry of the Action and get the error:

 Execute Condition (VBScript)
Condition : var result=Context.ExpandExpression(%SkylogProFolder%)
Error In Execute Condition (VBScript) Compile UpdateBuilder Project [%SkylogProFolder%\skylgpro_605.UBProj] : List index out of bounds (0)

Obviously, I'm doing something wrong but extensive searches of Help and Forum messages haven't revealed the answer!

Andrew

 

Conditions need to be a boolean expression, so what you have is not valid.

The value you are expanding needs to be a string, so

[code]dim value value = Context.ExpandExpression('%SkylogProFolder%', True) [/code]

Take a look at the examples in C:\Program Files (x86)\FinalBuilder 7\ActionDefs\VSoft.ScriptExamples.fbap

Sorry to be dim, but do I have to create an OnExecute script (with your code) and assign it to the Action? If so, not sure how I assign it - in the BeforeAction script?
Regards…Andrew

Ok, looks as though the only way to fix this issue is by amending the OnValidate script in UpdateBuilder.fbap as I can’t find a way of expanding the FB variable from within FB.

Regards…Andrew

Adding the following code to any relevant UpdateBuilder.fbap scripts ie, GetExecutablePath, :GetStartDir etc

dim f 'as string
f = Context.ExpandExpression("%SkylogProFolder%",true)
Context.Properties.PropertyAsString(“PROJPATH”) = f & “\skylgpro_605.UBProj"

always gives the following error when running the Action:

Compile UpdateBuilder Project [False\skylgpro_605.UBProj]
    Status: Completed
      Date: 29/05/2015
      Time: 14:51:47:188
       End: 14:51:47:375
  Duration: 00:00:00:187

Action Messages:
Compiling with parameters :  /C"False\skylgpro_605.UBProj”
The file False\skylgpro_605.UBProj does not exist
Success

Basically, f = Context.ExpandExpression("%SkylogProFolder%",true) always returns ‘False’ wherever I use it.

Can you help please?

Regards…Andrew

Never mind, variable %SkylogProFolder% value was in fact ‘False’ for some reason! Doh…
Regards…Andrew

In case it helps anyone else, I added the following code to the UpdateBuilder.fbap GetStartDir script:

dim f 'as string
dim g 'as string

f = Context.Properties.PropertyAsString(“PROJPATH”)
Context.Properties.PropertyAsString(“Old_PROJPATH”) = f
g = Context.ExpandExpression(f,true)
Context.Properties.PropertyAsString(“PROJPATH”) = g

which fixes the issue. New property “Old_PROJPATH” is provided to reset the Project Name to the original value after the Action finishes.

Regards…Andrew