# Baut DeskCore und den Installer. # DeskCore.exe -> ..\DeskCore\ (direkt startbar) # DeskCore-Setup.exe -> ..\DeskCore-Installer\ (zum Installieren/Weitergeben) $ErrorActionPreference = "Stop" $root = $PSScriptRoot $common = @("-c", "Release", "-r", "win-x64", "-p:SelfContained=false", "-p:PublishSingleFile=true", "-p:DebugType=none", "--nologo", "-v", "q") Write-Host "1/2 DeskCore wird gebaut ..." -ForegroundColor Cyan dotnet publish "$root\DeskCore.csproj" @common -o "$root\artifacts\app" if ($LASTEXITCODE -ne 0) { throw "Build der App fehlgeschlagen" } New-Item -ItemType Directory -Force "$root\..\DeskCore" | Out-Null Copy-Item "$root\artifacts\app\*" "$root\..\DeskCore\" -Force Write-Host "2/2 Installer wird gebaut ..." -ForegroundColor Cyan dotnet publish "$root\Setup\DeskCoreSetup.csproj" @common -o "$root\..\DeskCore-Installer" if ($LASTEXITCODE -ne 0) { throw "Build des Installers fehlgeschlagen" } Get-Item "$root\..\DeskCore-Installer\DeskCore-Setup.exe" | Select-Object Name, @{n="Größe";e={"{0:N0} KB" -f ($_.Length/1KB)}} Write-Host "Fertig." -ForegroundColor Green