I am trying to write a relevance that will identify the version of a file installed, which will help me identify and upgrade the version of VMTools installed on Virtual Machines. I have been able to identify the versions, but can’t figure out how to identify only the 3.5.0 versions and not the 4.0.0 versions. Here is the relenvance
if exists file (“C:\Program Files (x86)\VMware\VMware Tools\VMwareService.exe”) then (values “FileVersion” of version blocks of files (“C:\Program Files (x86)\VMware\VMware Tools\VMwareUser.exe”)) else (values “FileVersion” of version blocks of files (“C:\Program Files\VMware\VMware Tools\VMwareUser.exe”))
This outputs (for different VMs)…
3.5.0 build-213532
4.0.0 build-208167
I need it to identify only the ones that start with 3.5.0 and have smaller build numbers thant 213532 to be relevant for the upgrade of the VMTools.
q: (first 5 of it = “3.5.0” and following text of first “build-” of it as integer < 213532) of (“3.5.0 build-213532”; “4.0.0 build-208167”)
A: False
A: False
q: (first 5 of it = “3.5.0” and following text of first “build-” of it as integer < 213532) of (if exists file (“C:\Program Files (x86)\VMware\VMware Tools\VMwareService.exe”) then (values “FileVersion” of version blocks of files (“C:\Program Files (x86)\VMware\VMware Tools\VMwareUser.exe”)) else (values “FileVersion” of version blocks of files (“C:\Program Files\VMware\VMware Tools\VMwareUser.exe”)))
A little better way of getting the same result without using static paths
Q: (first 5 of it = “3.5.0” and following text of first “build-” of it as integer < 213532) of (if exists running application “VMwareService.exe” then values “FileVersion” of version blocks of running applications “VMwareService.exe” as string else “”)