Getting the versionnumber from an assembly.cs info a Finalbuilder variable

Hello,

I’m trying to get the versionnumber from an assembly.cs file. I do this with an Powershell script and I can get and print the version or put it in a variable.

But how do I the Powershell variable into Finalbuilder?

Thanks for any help,
Marius

If you are using the Execute Powershell script action, getting the value into a variable is complicated - you would have to use the Output Monitors feature.

The alternative to using powershell is to use the Text Find/Replace action with some regex, e.g

\s*\[assembly\s*:\s*AssemblyVersion\(\"(.*)\"\)\]

You may need to tweak the regex a bit, the above regex worked for me but I only tested it with a single file

Then in the OnMatchGroup script event for the action use some javascript to set the FB variable (in this case mine is called FileVersionStr)

if (GroupIndex > 0) { //group 0 is always the full match
   FBVariables.FileVersionStr = Text
}

Hello Vincent,

The Find/Replace seems more promising than the PowerShell Script so I opted for that, I just cannot seem to find the OnMatchGroup event in the Find/Replace action? Not sure where this event should be or how it is called in the FB userinterface (what am I overlooking?)

Could you please point me in the right direction?

Using Finalbuilder 8.0.0.3104
Thanks/Bedankt,
Marius

Select the action in the target, then go to the Script Editor tab (use the View menu)

Hello Vincent,

Ah thanks, in the the tabs in the lower part instead of popup options!

Thanks/Bedankt/Regards,
Marius