Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,32 @@ $ErrorActionPreference = 'Stop'
$workingDir = $pwd
Write-Output "Working directory: $workingDir"

# Find MSBuild.
$msBuildPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe `
-prerelease | Select-Object -First 1
Write-Output "MSBuild: $((Get-Command $msBuildPath).Path)"
# Find MSBuild. vswhere is preferred, but older bundled versions don't recognize
# newer VS lines (e.g. Dev18 / VS 2026), so we fall back to scanning known install paths.
function Find-MSBuildPath {
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if (Test-Path $vswhere) {
$found = & $vswhere -latest -prerelease `
-requires Microsoft.Component.MSBuild `
-find 'MSBuild\**\Bin\MSBuild.exe' |
Select-Object -First 1
if ($found) { return $found }
}
$roots = @($env:ProgramFiles, ${env:ProgramFiles(x86)})
$editions = 'BuildTools','Community','Professional','Enterprise'
foreach ($r in $roots) {
foreach ($ver in '18','2026','2022','17') {
foreach ($ed in $editions) {
$p = Join-Path $r "Microsoft Visual Studio\$ver\$ed\MSBuild\Current\Bin\MSBuild.exe"
if (Test-Path $p) { return $p }
}
}
}
throw 'MSBuild not found via vswhere or known paths.'
}

$msBuildPath = Find-MSBuildPath
Write-Output "MSBuild: $msBuildPath"

# Load current Git tag.
$tag = $(git describe --tags)
Expand Down