Skip to content

Commit c5355e0

Browse files
authored
Get Version from NETworkManager executable (#447)
Rather than hardcode the version, get it from the NETworkManager executable
1 parent 643391c commit c5355e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
$Version = "2021.1.0"
21
$IsPreview = $false
32

43
$BuildPath = "$PSScriptRoot\Build"
@@ -21,6 +20,9 @@ if(-not(Test-Path -Path "$BuildPath\NETworkManager\NETworkManager.exe"))
2120
Write-Error "Could not find dotnet release build. Is .NET SDK 5.0 or later installed?" -ErrorAction Stop
2221
}
2322

23+
# Get NETworkManager File Version
24+
$Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$BuildPath\NETworkManager\NETworkManager.exe").FileVersion
25+
2426
# Cleanup WebView2Loader.dll (https://github.com/MicrosoftEdge/WebView2Feedback/issues/461)
2527
Remove-Item "$BuildPath\NETworkManager\arm64" -Recurse
2628
Remove-Item "$BuildPath\NETworkManager\x64" -Recurse
@@ -54,4 +56,4 @@ else {
5456

5557
Get-ChildItem -Path $BuildPath | Where-Object {$_.Name.EndsWith(".zip") -or $_.Name.EndsWith(".exe")} | Get-FileHash
5658

57-
Write-Host "Build finished! All files are here: $BuildPath" -ForegroundColor Green
59+
Write-Host "Build finished! All files are here: $BuildPath" -ForegroundColor Green

0 commit comments

Comments
 (0)