# TMS UpdateBuilder Compiler Issue

**URL:** https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562
**Category:** Bugs
**Created:** [May 27, 2015, 4:37am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562 "2015-05-27T04:37:04Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 27, 2015, 4:37am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/1 "2015-05-27T04:37:04Z")

</div>

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

&nbsp;Compiling with parameters :&nbsp; /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:

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

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

'Context.SendLogMessage Data

res = Left(Data, 1)

if StrComp(res, "@") = 0 then  
&nbsp; Context.SendProgressMessage "Total progress", CInt(Trim(Right(Left(Data, 10), 3)))  
else  
&nbsp; 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

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 27, 2015, 11:56am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/2 "2015-05-27T11:56:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 28, 2015, 10:53am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/3 "2015-05-28T10:53:44Z")

</div>

Thanks. However, I added Context.ExpandExpression([%SkylogProFolder%\skylgpro\_605.UBProj) in the Action’s BeforeAction script and I get error:&nbsp;  
  
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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 28, 2015, 12:22pm UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/4 "2015-05-28T12:22:28Z")

</div>

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

&nbsp;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

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 28, 2015, 3:17am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/5 "2015-05-28T03:17:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 28, 2015, 3:58am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/6 "2015-05-28T03:58:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 29, 2015, 11:34am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/7 "2015-05-29T11:34:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 29, 2015, 4:06am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/8 "2015-05-29T04:06:04Z")

</div>

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]  
&nbsp;&nbsp;&nbsp; Status: Completed  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date: 29/05/2015  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Time: 14:51:47:188  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End: 14:51:47:375  
&nbsp; Duration: 00:00:00:187

Action Messages:  
Compiling with parameters :&nbsp; /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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 29, 2015, 4:31am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/9 "2015-05-29T04:31:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [May 30, 2015, 8:47am UTC](https://www.finalbuilder.com/forums/t/tms-updatebuilder-compiler-issue/3562/10 "2015-05-30T08:47:59Z")

</div>

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
