What would be the best way to go about merging these two items into one?
if exists folder (value of variable “ProgramFiles” of environment & “\Citrix\PNAgent”) whose (exists file “wfica32.exe” of it) then version of file (value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”) as string else “not installed”
and
if exists folder (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client”) whose (exists file “wfica32.exe” of it) then version of file (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”) as string else “not installed”
Is this the question you want to solve: "Check that file A is there and, if it is, then check if file B is there. If file B is there return the version of B (and not A). If only file A exists return the version of A. If neither exists return “not installed.”
if exists file “c:\A.exe” then (if exists file “c:\B.exe” then version of file “c:\B.exe” as string else version of file “c:\A.exe” as string) else “not installed”
Problem with this though. If PNAgent\ doesn’t exist, it ignores the rest of it (\ICA Client).
#1)
q: if exists file (value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”) then (if exists file (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”) then version of file (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”) as string else version of file (value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”) as string) else “not installed”
A: not installed
but this one works:
#2)
if (number of files (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”; value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”) > 0 ) then ((maxima of versions of files (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”; value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”)) as string) else “not installed”
My only thought is that if they both exists (PNagent and ICA client), #2 does not show both versions.
This will give you both versions separated by a comma if both versions exist. If only one of the file exists it will give you only one of the versions:
if (number of files (“c:\A.exe”; “c:\B.exe”) > 1) then (version of file “c:\A.exe” as string & ", " & version of file “c:\B.exe” as string) else (if (number of files (“c:\A.exe”; “c:\B.exe”) > 0) then (if exists file “c:\A.exe” then version of “c:\A.exe” else version of file “c:\B.exe”) else “not installed”)
q: if (number of files (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”); (value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”) > 1) then (version of file (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”) as string & ", " & version of file (value of variable “ProgramFiles” of environment & “\Citrix\PNagent\wfica32.exe”) as string) else (if (number of files (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”); (value of variable “ProgramFiles” of environment & “\Citrix\PNAgent\wfica32.exe”) > 0) then (if exists file (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”) then version of (value of variable “ProgramFiles” of environment & “\Citrix\ICA Client\wfica32.exe”) else version of file (value of variable “ProgramFiles” of environment & “\Citrix\PNagent\wfica32.exe”)) else “not installed”)
E: The operator “less than” is not defined.
q: if (number of files (“c:\A.exe”; “c:\B.exe”) > 1) then (version of file “c:\A.exe” as string & ", " & version of file “c:\B.exe” as string) else (if (number of files (“c:\A.exe”; “c:\B.exe”) > 0) then (if exists file “c:\A.exe” then version of “c:\A.exe” else version of file “c:\B.exe”) else “not installed”)
Instead of specifiying the path to file A and file B and file C, can bigfix just search a folder (and all subfolders) for said file, then display the version(s)?
i understand that there may be several Citrix clients installed on the same computer; i am only interested in the version of the client which opens the Citrix web interface published applications, which is located in the registry key “HKEY_CLASSES_ROOT\Applications\wfcrun32.exe\shell\open\command”.
my problems are as follows:
the said registry key shows the resault as "“C:\Program Files\Citrix\ICA Client\wfcrun32.exe” “%1"”; how can i remove the “%1” part?
q: value “” of key “HKEY_CLASSES_ROOT\Applications\wfcrun32.exe\shell\open\command” of registry
A: “C:\Program Files\Citrix\ICA Client\wfcrun32.exe” “%251”
using the combined solution from Jessewk and cstobeba, (or another solution), how can i find the version of the file in #1?