File size: 811 Bytes
e9d46fc 1c117c2 e9d46fc 1c117c2 e9d46fc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | $ErrorActionPreference = "Stop"
# Define paths
$projectPath = Join-Path $PSScriptRoot "..\WpfEditor\EchoDict.csproj"
$publishDir = Join-Path $PSScriptRoot "..\WpfEditor\bin\Release\net8.0-windows\win-x64\publish"
# 1. Publish the application
Write-Host "Publishing EchoDict..."
dotnet publish $projectPath -c Release -r win-x64 --self-contained false -o $publishDir
if ($LASTEXITCODE -ne 0) {
Write-Error "Publish failed with exit code $LASTEXITCODE"
}
# 2. Build the WiX project
# Note: This requires internet access to restore WixToolset.Sdk
Write-Host "Building MSI Installer..."
dotnet build (Join-Path $PSScriptRoot "Setup.wixproj") -c Release
if ($LASTEXITCODE -ne 0) {
Write-Error "WiX Build failed with exit code $LASTEXITCODE"
}
Write-Host "Build Complete. MSI should be in bin\Release\"
|