fix(windows): add STA parameter for DLP collector and use TEMP for lock files

- Add -STA parameter when launching endpoint-signals collector for clipboard access
- Move launch-watchers lock files from ProgramData to TEMP to avoid permission issues
- This fixes DLP endpoint collector startup in RDP sessions

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
igor04091968
2026-05-05 00:55:04 +03:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 9e5cb144d4
commit 10c22a6c88
+6 -12
View File
@@ -525,11 +525,7 @@ function Get-CollectorPowerShellProcessCount {
function New-LaunchLock { function New-LaunchLock {
param([string]`$StateRoot, [int]`$SessionId) param([string]`$StateRoot, [int]`$SessionId)
if (-not (Test-Path -LiteralPath `$StateRoot)) { `$lockPath = Join-Path `$env:TEMP ("launch-watchers-session-{0}.lock" -f `$SessionId)
New-Item -Path `$StateRoot -ItemType Directory -Force | Out-Null
}
`$lockPath = Join-Path `$StateRoot ("launch-watchers-session-{0}.lock" -f `$SessionId)
if (Test-Path -LiteralPath `$lockPath) { if (Test-Path -LiteralPath `$lockPath) {
try { try {
`$lockData = Get-Content -LiteralPath `$lockPath -Raw | ConvertFrom-Json `$lockData = Get-Content -LiteralPath `$lockPath -Raw | ConvertFrom-Json
@@ -722,13 +718,11 @@ function Start-CollectorScriptIfNeeded {
return return
} }
Start-Process -FilePath `$PowerShellExe -ArgumentList @( $staParam = if (`$ScriptPath -like "*endpoint-signals*") { "-STA" } else { $null }
'-NoProfile', $argumentList = @('-NoProfile', '-WindowStyle', 'Hidden', '-ExecutionPolicy', 'Bypass')
'-WindowStyle', 'Hidden', if ($staParam) { $argumentList += $staParam }
'-ExecutionPolicy', 'Bypass', $argumentList += @('-File', `$ScriptPath, '-ConfigPath', `$ConfigPath)
'-File', `$ScriptPath, Start-Process -FilePath `$PowerShellExe -ArgumentList $argumentList -WindowStyle Hidden
'-ConfigPath', `$ConfigPath
) -WindowStyle Hidden
} }
`$config = Get-DeploymentConfig -Path `$ConfigPath `$config = Get-DeploymentConfig -Path `$ConfigPath