-
-
Notifications
You must be signed in to change notification settings - Fork 757
/
build.ps1
36 lines (26 loc) · 1.25 KB
/
build.ps1
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
26
27
28
29
30
31
32
33
34
35
36
$wingetVersion = & winget --version 2>$null
if ($wingetVersion -eq $null) {
Write-Output "winget is not installed. Starting installation..."
Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/v1.6.3482/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
Add-AppxPackage -Path "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
Write-Output "winget has been installed."
}
$dotnetVersion = & dotnet --version 2>$null
if ($dotnetVersion -eq $null) {
Write-Output ".NET SDK is not installed."
winget install Microsoft.DotNet.SDK.8
} else {
$majorVersion = $dotnetVersion.Split('.')[0]
if ($majorVersion -ge 8) {
Write-Output ".NET SDK version is $dotnetVersion, which is 8.0.0 or newer."
} else {
Write-Output ".NET SDK version is $dotnetVersion, which is older than 8.0.0."
winget install Microsoft.DotNet.SDK.8
}
}
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
dotnet restore Wpf.Ui.sln /tl
dotnet build src\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj --configuration Release --no-restore --verbosity quiet /tl
} else {
Write-Host "Not in the x64 desktop environment."
}