$ErrorActionPreference = "Stop" $root = Split-Path -Parent $PSScriptRoot $dist = Join-Path $root "dist" $packageRoot = Join-Path $dist "edge-agent-windows" $zipPath = Join-Path $dist "edge-agent-windows.zip" if (Test-Path $packageRoot) { Remove-Item -LiteralPath $packageRoot -Recurse -Force } if (Test-Path $zipPath) { Remove-Item -LiteralPath $zipPath -Force } New-Item -ItemType Directory -Path $packageRoot | Out-Null New-Item -ItemType Directory -Path $dist -Force | Out-Null Copy-Item -LiteralPath (Join-Path $root "app") -Destination $packageRoot -Recurse Copy-Item -LiteralPath (Join-Path $root "README.md") -Destination $packageRoot Copy-Item -LiteralPath (Join-Path $root "pyproject.toml") -Destination $packageRoot Copy-Item -LiteralPath (Join-Path $PSScriptRoot "start-windows.ps1") -Destination $packageRoot Compress-Archive -Path (Join-Path $packageRoot "*") -DestinationPath $zipPath -Force Write-Output $zipPath