(
if
(
not exists setting "_BESClient_ComputerType" whose
(
exists value of it
)
of client
)
then ERROR "not set" else
(
value of setting "_BESClient_ComputerType" whose
(
exists value of it
)
of client
)
)
=
(
if name of operating system = "Mac OS X" then
(
if
(
(
exists key whose
(
it as string as lowercase contains "battery"
)
of entries of dictionaries of nodes of it
)
or
(
exists node "AppleACPIPlatformExpert/SMB0/AppleECSMBusController/AppleSmartBatteryManager" of service plane of iokit registry
)
of it
)
of service plane of iokit registry then "Laptop" else "Workstation"
)
else
(
if
(
name of operating system as lowercase starts with "win"
)
then
(
if
(
name of operating system = "Win95" OR name of operating system = "Win98" or name of operating system = "WinME"
)
then "Workstation" else
(
if
(
(
exists wmi
)
and
(
(
(
exists selects "* from win32_Battery" of wmi
)
and
(
exists descriptions whose
(
it as string as lowercase = "Microsoft ACPI-Compliant Control Method Battery" as lowercase
)
of active devices
)
)
OR exists
(
(
(
8; 9; 10; 11; 12; 14; 18; 21
)
,
(
integer values of selects "ChassisTypes from Win32_SystemEnclosure" of wmi
)
)
whose
(
item 0 of it = item 1 of it
)
)
)
)
then "Laptop" else
(
if
(
value "ProductType" of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" of registry = "WinNT"
)
then "Workstation" else "Server"
)
)
)
else "Unknown"
)
)
(if (not exists setting "_BESClient_ComputerType" whose (exists value of it) of client) then ERROR "not set" else (value of setting "_BESClient_ComputerType" whose (exists value of it) of client)) = (if name of operating system = "Mac OS X" then( if ((exists key whose (it as string as lowercase contains "battery") of entries of dictionaries of nodes of it) or (exists node "AppleACPIPlatformExpert/SMB0/AppleECSMBusController/AppleSmartBatteryManager" of service plane of iokit registry) of it) of service plane of iokit registry then "Laptop" else "Workstation" ) else (if (name of operating system as lowercase starts with "win") then (if (name of operating system = "Win95" OR name of operating system = "Win98" or name of operating system = "WinME") then "Workstation" else (if ((exists wmi) and (((exists selects "* from win32_Battery" of wmi) and (exists descriptions whose (it as string as lowercase = "Microsoft ACPI-Compliant Control Method Battery" as lowercase) of active devices)) OR exists (( (8; 9; 10; 11; 12; 14; 18; 21), (integer values of selects "ChassisTypes from Win32_SystemEnclosure" of wmi) ) whose (item 0 of it = item 1 of it)))) then "Laptop" else (if (value "ProductType" of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" of registry = "WinNT") then "Workstation" else "Server"))) else "Unknown"))