Add managed Windows remote audio stack

This commit is contained in:
2026-09-20 17:26:36 +01:00
commit baa48c10b6
9 changed files with 650 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot '..\deps.ps1')
$originalManifest = $script:depsManifest
$originalDownloadDir = $script:depsDownloadDir
$originalInstallDir = $script:depsInstallDir
$testRoot = Join-Path $script:depsProjectRoot ('.runtime\bootstrap-test-' + [guid]::NewGuid().ToString('n'))
try {
$script:depsDownloadDir = Join-Path $testRoot 'downloads'
$script:depsInstallDir = Join-Path $testRoot 'deps'
$source = Join-Path $testRoot 'source'
New-Item -ItemType Directory -Force -Path $source, $script:depsDownloadDir | Out-Null
Set-Content -LiteralPath (Join-Path $source 'jacktrip.exe') -Value 'test fixture'
$zip = Join-Path $script:depsDownloadDir 'fixture.zip'
Compress-Archive -LiteralPath (Join-Path $source 'jacktrip.exe') -DestinationPath $zip
$script:depsManifest = [pscustomobject]@{
jacktrip = [pscustomobject]@{
version = 'test'
file = 'fixture.zip'
url = 'https://invalid.example/fixture.zip'
sha256 = (Get-FileHash -LiteralPath $zip -Algorithm SHA256).Hash.ToLowerInvariant()
}
}
$resolved = Install-ManagedJackTrip
if (-not (Test-Path -LiteralPath $resolved -PathType Leaf)) { throw 'JackTrip extraction failed' }
if (-not $resolved.StartsWith($script:depsInstallDir, [StringComparison]::OrdinalIgnoreCase)) { throw 'JackTrip path escaped dependency directory' }
Write-Host 'Bootstrap cache verification and extraction OK'
} finally {
$script:depsManifest = $originalManifest
$script:depsDownloadDir = $originalDownloadDir
$script:depsInstallDir = $originalInstallDir
$runtimeRoot = [System.IO.Path]::GetFullPath((Join-Path $script:depsProjectRoot '.runtime')).TrimEnd('\') + '\'
$testPath = [System.IO.Path]::GetFullPath($testRoot)
if (-not $testPath.StartsWith($runtimeRoot, [StringComparison]::OrdinalIgnoreCase)) { throw 'Refusing to remove test files outside .runtime' }
if (Test-Path -LiteralPath $testPath) { Remove-Item -LiteralPath $testPath -Recurse -Force }
}