diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 7765da75..9c89a3bf 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -51,6 +51,42 @@ "panel": "shared" }, "problemMatcher": [] + }, + { + "label": "Copy Staging Web Interface to Runtime", + "type": "shell", + "command": "powershell.exe", + "args": [ + "-NoLogo", + "-NoProfile", + "-ExecutionPolicy", + "Bypass", + "-Command", + "& { $workspace = \"${workspaceFolder}\"; $runtime = Join-Path $workspace 'Engine\\web-interface'; $runtimeSrc = Join-Path $runtime 'src'; $stagingSrc = Join-Path $workspace 'Data\\Engine\\web-interface\\src'; if (Test-Path $runtimeSrc) { Remove-Item $runtimeSrc -Recurse -Force }; if (-not (Test-Path $runtime)) { New-Item -ItemType Directory -Path $runtime | Out-Null }; Copy-Item $stagingSrc -Destination $runtime -Recurse }" + ], + "presentation": { + "reveal": "always", + "panel": "shared" + }, + "problemMatcher": [] + }, + { + "label": "Copy Runtime Web Interface into Staging", + "type": "shell", + "command": "powershell.exe", + "args": [ + "-NoLogo", + "-NoProfile", + "-ExecutionPolicy", + "Bypass", + "-Command", + "& { $workspace = \"${workspaceFolder}\"; $runtime = Join-Path $workspace 'Engine\\web-interface'; $runtimeSrc = Join-Path $runtime 'src'; $stagingRoot = Join-Path $workspace 'Data\\Engine\\web-interface'; $stagingSrc = Join-Path $stagingRoot 'src'; if (Test-Path $stagingSrc) { Remove-Item $stagingSrc -Recurse -Force }; if (-not (Test-Path $stagingRoot)) { New-Item -ItemType Directory -Path $stagingRoot | Out-Null }; Copy-Item $runtimeSrc -Destination $stagingRoot -Recurse }" + ], + "presentation": { + "reveal": "always", + "panel": "shared" + }, + "problemMatcher": [] } ] } diff --git a/Data/Agent/Roles/role_DeviceAudit.py b/Data/Agent/Roles/role_DeviceAudit.py index d5bd7151..ffd1cfdb 100644 --- a/Data/Agent/Roles/role_DeviceAudit.py +++ b/Data/Agent/Roles/role_DeviceAudit.py @@ -58,6 +58,7 @@ def detect_agent_os(): build_number = _get("CurrentBuildNumber", "") or _get("CurrentBuild", "") ubr = _get("UBR", None) edition_id = _get("EditionID", "") + installation_type = _get("InstallationType", "") wmi_info = {} try: @@ -119,16 +120,20 @@ def detect_agent_os(): if not isinstance(product_type_val, int): product_type_val = 0 + def _contains_server(text) -> bool: + try: + return isinstance(text, str) and 'server' in text.lower() + except Exception: + return False + is_server = False if product_type_val not in (0, 1): is_server = True - elif product_type_val == 1: - is_server = False - else: - if isinstance(product_name, str) and 'server' in product_name.lower(): - is_server = True - elif wmi_caption and 'server' in wmi_caption.lower(): - is_server = True + if not is_server: + for hint in (product_name, wmi_caption, edition_id, installation_type): + if _contains_server(hint): + is_server = True + break if is_server: if build_int >= 26100: