Actionscript Parameters Not Working: Microsoft Visual C++ 2012

I am trying to use nested relevance in actionscript, and since the relevance has a curly brace in it, I have that portion separated into a parameter that is then pulled in to the relevance. When I run the script in the fixlet debugger it works fine, however when I run the fixlet on a machine the status shows as “error” and looking at the results the first if statement has “failed” next to it. My script is below, any thoughts would be appreciated.Thanks!

parameter "Cregkey64" = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{37B8F9C7-03FB-3253-8781-2517C99D7C00}" 
parameter "Cregkey32" = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{B175520C-86A2-35A7-8619-86DC379688B9}" 
if {((value "DisplayVersion" of key (parameter "Cregkey64") of native registry) < "11.0.61030")} 
wait __download\vcredist_x64.exe /quiet /norestart /log c:\c++64log.txt 
elseif {((value "DisplayVersion" of key (parameter "Cregkey32") of native registry) < "11.0.61030")} 
wait __download\vcredist_x86.exe /quiet /norestart /log c:\c++32log.txt 
endif

The key, in this fashion, is being output as string so it doesn’t know how to compare the value to a version like you’re trying to do. Try this:

if {((value "DisplayVersion" of key (parameter "Cregkey64") of native registry as version) < "11.0.61030")} 
wait __download\vcredist_x64.exe /quiet /norestart /log c:\c++64log.txt 
elseif {((value "DisplayVersion" of key (parameter "Cregkey32") of native registry as version) < "11.0.61030")}

Can you tell me what program this uninstall key is for? What is it’s DisplayName?

Microsoft Visual C++ 2012 x64 Additional Runtime - 11.0.61030 and
Microsoft Visual C++ 2012 x86 Additional Runtime - 11.0.61030

So this actionscript is to handle the case where Microsoft Visual C++ 2012 is installed, but it is older than version 11.0.61030, at which point the actionscript updates it to version 11.0.61030?

There are definitely better ways to write this, and I would recommend 2 separate tasks/fixlets. One only for the 64bit version, and one only for the 32bit version, and then take action on both together… either manually or with a baseline. Additionally, you have an error in your elseif relevance. Also, I wouldn’t recommend logging to C:… you should instead log to the BES Client Log folder or C:\Windows\Temp .

Can you provide the links to the downloads for these on Microsoft’s site?

Thanks for the idea, when I put as version it fails as a valid relevance statement. As I understand it the number “11.0.61030” can be evaluated in string form, and from my tests seems to work that way (evaluating version of regapp “winword.exe” as string > “15” evaluates properly even though the result is a string for example). Am I missing something?

This is not a string:

value "DisplayVersion" of key (parameter "Cregkey64") of native registry

This is:

(it as string) of value "DisplayVersion" of key (parameter "Cregkey64") of native registry

Do this: ( relevance is right to left, and I like to keep it that way )

"11.0.61030" > (it as version) of (it as string) of value "DisplayVersion" of key (parameter "Cregkey64") of native registry

This will throw an error:

(it as version) of value "DisplayVersion" of key (parameter "Cregkey64") of native registry

These libraries (http://www.microsoft.com/en-us/download/details.aspx?id=30679) are prerequisites for another program I am installing, so these lines are actually part of a much larger fixlet that first checks for the necessary C++ libraries, installs them if they don’t exist, and then installs the actual software package that the main goal of the fixlet. The C: logs are just for my testing to make them easy to find, they won’t be present in the final version.

I would not recommend this approach.

The actual software package you are trying to install that has this prerequisite should have relevance to only install on computers that already have these C++ libraries installed.

Then have separate tasks/fixlets that install the C++ libraries. Take them all as a group / baseline, and as long as the relevance is written correctly, they will only install where they are needed automatically, and the software package you are trying to install will only install after the libraries are installed.

It is always best to make your fixlets/tasks as simple as possible for maintenance reasons, but also because these libraries are likely prerequisites for other software as well.


Fixlets/Tasks should do the smallest amount of work possible and be validated by the relevance going from true to false once that work is completed. If you follow this principle, then you will have much greater success, and when things go wrong, you will know exactly where the problems are.


This is an example of a prereq: http://bigfix.me/fixlet/details/3767
This is an example of software that needs the prereq before being installed: http://bigfix.me/fixlet/details/3778

I understand the value of keeping fixlets simple, however based on my environment that really isn’t an option. That being said, I had completely forgotten that the output of value wasn’t a string (and am irritated that it didn’t throw an error in the debugger), I’ll test out the it as string relevance and let you know. Thanks!

1 Like

Why isn’t it an option in your environment?

Can’t really get in to it, but on the fixlet front here is the result:

Failed     if {"11.0.61030" > ((it as version) of (it as string) of (value "DisplayVersion" of key (parameter "Cregkey64") of native registry))}

I’m fairly sure this is an error due to non existence, not the version comparison.

Try This:

if { not exists ((it as version) whose(it >= "11.0.61030") of (it as string) of (values "DisplayVersion" of keys (parameter "Cregkey64") of native registries)) }
1 Like

Wow, relevance 101… I talk about that when I do relevance training and here I am forgetting it. I need a vacation. Thanks for the second set of eyes.

1 Like