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:
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.
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.
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!
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.
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.