if
(
name of operating system as lowercase starts with "win"
)
then
(
if
(
(
value whose
(
name of it as string as lowercase contains "version"
)
of key "HKLM\Software\BigFix\Enterprise Server\" of registry as string
)
< "7"
)
then
(
maximum of
(
(
following texts of lasts "_" of names of folders whose
(
name of it contains
(
"enterprisemirror_" &
(
preceding text of first "%22>" of following text of first "ID=%22" of line whose
(
it as lowercase contains
(
value "GatherURL" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry
)
as string as lowercase
)
of file
(
value "InboxLocation" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry as string & "\bfemapfile.xml"
)
)
& "_"
)
)
of folder "bfmirror\bfsites" of folder
(
value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string
)
)
as integer
)
)
else if
(
(
value whose
(
name of it as string as lowercase contains "version"
)
of key "HKLM\Software\BigFix\Enterprise Server\" of registry as string
)
< "8"
)
then
(
maximum of
(
(
following texts of lasts "_" of preceding texts of lasts "_" of names of folders whose
(
name of it contains
(
"manymirror_" &
(
preceding text of first "%22>" of following text of first "ID=%22" of line whose
(
it as lowercase contains
(
value "GatherURL" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry
)
as string as lowercase
)
of file
(
value "InboxLocation" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry as string & "\bfemapfile.xml"
)
)
& "_"
)
)
of folder "bfmirror\bfsites" of folder
(
value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string
)
)
as integer
)
)
else if
(
exists relay service
)
then
(
maximum of
(
following texts of lasts "_" of preceding texts of lasts "_" of names of folders whose
(
name of it starts with "manymirror_"
)
of folder "bfmirror\bfsites" of folder
(
value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string
)
as integer
)
)
else
(
maximum of items 1 of
(
(
parenthesized part 1 of it as integer, parenthesized part 2 of it as integer
)
whose
(
item 0 of it = maximum of item 0 of it
)
of
(
matches
(
regex "^actionsite_(\d+)_(\d+)$"
)
of
(
names of folders of folder "bfsites" of folder
(
value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string
)
)
)
)
)
)
else
(
maximum of
(
(
following texts of lasts "_" of preceding texts of lasts "_" of names of folders whose
(
name of it starts with "manymirror_"
)
of folder
(
(
value of setting "_BESRelay_HTTPServer_ServerRootPath" of client
)
& "/bfmirror/bfsites"
)
)
as integer
)
)
if (name of operating system as lowercase starts with "win") then (if ((value whose (name of it as string as lowercase contains "version") of key "HKLM\Software\BigFix\Enterprise Server\" of registry as string) < "7") then (maximum of ((following texts of lasts "_" of names of folders whose (name of it contains ("enterprisemirror_" & (preceding text of first "%22>" of following text of first "ID=%22" of line whose (it as lowercase contains (value "GatherURL" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry) as string as lowercase) of file (value "InboxLocation" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry as string & "\bfemapfile.xml")) & "_")) of folder "bfmirror\bfsites" of folder (value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string)) as integer)) else if ((value whose (name of it as string as lowercase contains "version") of key "HKLM\Software\BigFix\Enterprise Server\" of registry as string) < "8") then (maximum of ((following texts of lasts "_" of preceding texts of lasts "_" of names of folders whose (name of it contains ("manymirror_" & (preceding text of first "%22>" of following text of first "ID=%22" of line whose (it as lowercase contains (value "GatherURL" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\GlobalOptions" of registry) as string as lowercase) of file (value "InboxLocation" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry as string & "\bfemapfile.xml")) & "_")) of folder "bfmirror\bfsites" of folder (value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string)) as integer)) else if (exists relay service) then (maximum of (following texts of lasts "_" of preceding texts of lasts "_" of names of folders whose (name of it starts with "manymirror_") of folder "bfmirror\bfsites" of folder (value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string) as integer)) else (maximum of items 1 of ((parenthesized part 1 of it as integer, parenthesized part 2 of it as integer) whose (item 0 of it = maximum of item 0 of it) of (matches (regex "^actionsite_(\d+)_(\d+)$" ) of (names of folders of folder "bfsites" of folder (value of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\_BESRelay_HTTPServer_ServerRootPath" of registry as string)))))) else (maximum of ((following texts of lasts "_" of preceding texts of lasts "_" of names of folders whose (name of it starts with "manymirror_") of folder ((value of setting "_BESRelay_HTTPServer_ServerRootPath" of client) & "/bfmirror/bfsites")) as integer))