param( [string]$PublishRoot = ".\artifacts\publish\net472", [string]$OutputRoot = ".\artifacts\deploy\net472", [string]$PackageName = "biztalk-endpoint-monitor-net472-deployment" ) Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' function Ensure-Path { param([string]$Path) if (-not (Test-Path -LiteralPath $Path)) { throw "Pfad nicht gefunden: $Path" } } $repoRoot = Split-Path -Parent $PSScriptRoot $publishRootFull = [System.IO.Path]::GetFullPath((Join-Path $repoRoot $PublishRoot)) $outputRootFull = [System.IO.Path]::GetFullPath((Join-Path $repoRoot $OutputRoot)) $stagingRoot = Join-Path $outputRootFull $PackageName $zipPath = Join-Path $outputRootFull ($PackageName + '.zip') Ensure-Path -Path $publishRootFull Ensure-Path -Path (Join-Path $publishRootFull 'HostAvailabilityMonitor') Ensure-Path -Path (Join-Path $publishRootFull 'BizTalkMonitorConfigGenerator') if (Test-Path -LiteralPath $stagingRoot) { Remove-Item -LiteralPath $stagingRoot -Recurse -Force } if (Test-Path -LiteralPath $zipPath) { Remove-Item -LiteralPath $zipPath -Force } New-Item -Path $stagingRoot -ItemType Directory -Force | Out-Null New-Item -Path (Join-Path $stagingRoot 'monitor') -ItemType Directory -Force | Out-Null New-Item -Path (Join-Path $stagingRoot 'generator') -ItemType Directory -Force | Out-Null New-Item -Path (Join-Path $stagingRoot 'scripts') -ItemType Directory -Force | Out-Null New-Item -Path (Join-Path $stagingRoot 'installers') -ItemType Directory -Force | Out-Null New-Item -Path (Join-Path $stagingRoot 'docs') -ItemType Directory -Force | Out-Null Copy-Item -Path (Join-Path $publishRootFull 'HostAvailabilityMonitor\*') -Destination (Join-Path $stagingRoot 'monitor') -Recurse -Force Copy-Item -Path (Join-Path $publishRootFull 'BizTalkMonitorConfigGenerator\*') -Destination (Join-Path $stagingRoot 'generator') -Recurse -Force Copy-Item -Path (Join-Path $repoRoot 'scripts\*') -Destination (Join-Path $stagingRoot 'scripts') -Recurse -Force Copy-Item -Path (Join-Path $repoRoot 'installers\*') -Destination (Join-Path $stagingRoot 'installers') -Recurse -Force Copy-Item -Path (Join-Path $repoRoot 'README.md') -Destination (Join-Path $stagingRoot 'docs\README.md') -Force Copy-Item -Path (Join-Path $repoRoot 'Dokumentation.md') -Destination (Join-Path $stagingRoot 'docs\Dokumentation.md') -Force Copy-Item -Path (Join-Path $repoRoot 'Documentation.en.md') -Destination (Join-Path $stagingRoot 'docs\Documentation.en.md') -Force $deployNotes = @" Deployment package: $PackageName Created: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') Typical installation order: 1. Install generator 2. Adjust generator-settings.json 3. Generate monitor JSON 4. Install monitor 5. Configure Task Scheduler PowerShell installers: - installers\powershell\Install-HostAvailabilityMonitor.ps1 - installers\powershell\Install-BizTalkMonitorConfigGenerator.ps1 - installers\powershell\Install-Both.ps1 Optional MSI sources: - installers\wix\HostAvailabilityMonitor.wxs - installers\wix\BizTalkMonitorConfigGenerator.wxs - installers\wix\build-msi.ps1 "@ $deployNotes | Set-Content -Path (Join-Path $stagingRoot 'deploy-notes.txt') -Encoding UTF8 Compress-Archive -Path (Join-Path $stagingRoot '*') -DestinationPath $zipPath -CompressionLevel Optimal Write-Host "Deployment package created: $zipPath"