Utopia-Canteen-System/scripts/publish-client.ps1

29 lines
924 B
PowerShell

# Publish UtopiaCanteen.Client (WPF scanner) to a folder (default C:\UtopiaCanteenClient).
param(
[string]$OutputPath = "C:\UtopiaCanteenClient",
[ValidateSet("Debug", "Release")]
[string]$Configuration = "Release"
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot
$Project = Join-Path $Root "UtopiaCanteen.Client\UtopiaCanteen.Client.csproj"
if (-not (Test-Path $Project)) {
throw "Project not found: $Project"
}
Write-Host "Publishing client ($Configuration) -> $OutputPath"
dotnet publish $Project -c $Configuration -o $OutputPath --self-contained false
if ($LASTEXITCODE -ne 0) {
throw "dotnet publish failed with exit code $LASTEXITCODE"
}
Write-Host @"
Done. Run: $(Join-Path $OutputPath 'UtopiaCanteen.Client.exe')
First run: open Settings and set Backend base URL (e.g. http://192.168.1.10:5000).
Config file: %LocalAppData%\UtopiaCanteenClient\appsettings.json
"@