32 lines
1.0 KiB
PowerShell
32 lines
1.0 KiB
PowerShell
# EveryPublish Windows 构建前环境自检(PowerShell)
|
||
Write-Host "=== EveryPublish Windows 构建自检 ===" -ForegroundColor Cyan
|
||
|
||
function Check($name, $cmd) {
|
||
try {
|
||
$out = Invoke-Expression $cmd 2>&1 | Out-String
|
||
$first = ($out.Trim() -split "`n")[0]
|
||
Write-Host "[OK] $name : $first" -ForegroundColor Green
|
||
return $true
|
||
} catch {
|
||
Write-Host "[FAIL] $name 未安装或不可用" -ForegroundColor Red
|
||
return $false
|
||
}
|
||
}
|
||
|
||
$ok = $true
|
||
$ok = (Check "dotnet SDK" "dotnet --version") -and $ok
|
||
$ok = (Check "Go 工具链" "go version") -and $ok
|
||
|
||
# 版本校验:.NET 需 8.x,Go 需 1.23+
|
||
$dotnetVer = (dotnet --version 2>$null)
|
||
if ($dotnetVer -and -not $dotnetVer.StartsWith("8.")) {
|
||
Write-Host "[WARN] dotnet 版本 $dotnetVer,建议 .NET 8 SDK" -ForegroundColor Yellow
|
||
}
|
||
|
||
if (-not $ok) {
|
||
Write-Host "请先安装依赖(见 client/ui/README.md)后重试" -ForegroundColor Red
|
||
exit 1
|
||
}
|
||
|
||
Write-Host "环境就绪:可运行 Packaging\build-installer.ps1 打包" -ForegroundColor Green
|