<# .SYNOPSIS Packages the RenderWorker for installation on another machine. .DESCRIPTION Produces a self-contained single-file build (no .NET runtime needed on the target) plus the headless AE build script, and zips it for copying. .EXAMPLE .\publish.ps1 .\publish.ps1 -Zip #> [CmdletBinding()] param( [string]$OutDir = "", [switch]$Zip ) $ErrorActionPreference = "Stop" $root = Split-Path $PSScriptRoot -Parent if (-not $OutDir) { $OutDir = Join-Path $root "publish\win-x64" } Write-Host "Publishing self-contained worker..." -ForegroundColor Cyan & dotnet publish (Join-Path $root "VFXReviewWorker\VFXReviewWorker.csproj") ` -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o $OutDir if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed" } # The exe reads scripts\vfxr_build_preview.jsx from its own folder at runtime. $scriptOut = Join-Path $OutDir "scripts\vfxr_build_preview.jsx" if (-not (Test-Path $scriptOut)) { throw "Preview build script missing from output: $scriptOut" } Remove-Item (Join-Path $OutDir "*.pdb") -ErrorAction SilentlyContinue Write-Host "" Write-Host "Package contents:" -ForegroundColor Green Get-ChildItem $OutDir -Recurse -File | ForEach-Object { Write-Host (" {0,-40} {1,8:N0} KB" -f $_.FullName.Substring($OutDir.Length).TrimStart('\'), ($_.Length / 1KB)) } if ($Zip) { $zipPath = Join-Path $root ("VFXReviewWorker_{0}.zip" -f (Get-Date -Format "yyyyMMdd")) if (Test-Path $zipPath) { Remove-Item $zipPath } Compress-Archive -Path (Join-Path $OutDir "*") -DestinationPath $zipPath Write-Host "" Write-Host "Zipped to: $zipPath" -ForegroundColor Green } Write-Host "" Write-Host "Next on the target machine:" -ForegroundColor Cyan Write-Host " 1. Copy this folder to e.g. C:\pipeline\VFXReviewWorker" Write-Host " 2. Create C:\ProgramData\VFXReviewWorker\config.json (see README)" Write-Host " 3. Verify: .\VFXReviewWorker.exe --check" Write-Host " 4. Install: sc.exe create VFXReviewRenderWorker binPath= ... start= auto obj= ... password= ..."