14 lines
735 B
PowerShell
14 lines
735 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$projectRoot = Split-Path $PSScriptRoot -Parent
|
|
$releaseDir = Join-Path $projectRoot 'release'
|
|
$compiler = Join-Path $env:WINDIR 'Microsoft.NET\Framework64\v4.0.30319\csc.exe'
|
|
if (-not (Test-Path -LiteralPath $compiler)) {
|
|
throw 'Der C#-Compiler fuer .NET Framework 4.x wurde nicht gefunden.'
|
|
}
|
|
New-Item -ItemType Directory -Path $releaseDir -Force | Out-Null
|
|
$source = Join-Path $PSScriptRoot 'TapUploader.cs'
|
|
$output = Join-Path $releaseDir 'TAP-Uploader.exe'
|
|
& $compiler /nologo /target:winexe /optimize+ /out:$output /reference:System.Windows.Forms.dll /reference:System.Drawing.dll $source
|
|
if ($LASTEXITCODE -ne 0) { throw 'Der EXE-Build ist fehlgeschlagen.' }
|
|
Write-Output "Erstellt: $output"
|