Merge pull request #9052 from Icinga/bugfix/github-actions-windows-builds-don-t-abort-if-installing-dependencies-fails-8935

doc/win-dev.ps1: actually utilize ThrowOnNativeFailure
This commit is contained in:
Julian Brost 2021-11-19 13:47:29 +01:00 committed by GitHub
commit 16d1ddb87f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -51,6 +51,8 @@ function Install-Exe {
}
Start-Process -Wait -FilePath $ExeFile -ArgumentList @('/VERYSILENT', '/INSTALL', '/PASSIVE', '/NORESTART', "/DIR=${Dir}")
ThrowOnNativeFailure
Remove-Item -Recurse -Path $TempDir
}
@ -59,6 +61,7 @@ try {
Get-Command choco
} catch {
Invoke-Expression (New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')
ThrowOnNativeFailure
$RegEnv = 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
$ChocoPath = ";$(Join-Path $Env:AllUsersProfile chocolatey\bin)"
@ -69,19 +72,41 @@ try {
choco install -y "visualstudio${VsVersion}community"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-netcoretools"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-vctools"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-manageddesktop"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-nativedesktop"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}-workload-universal"
ThrowOnNativeFailure
choco install -y "visualstudio${VsVersion}buildtools"
ThrowOnNativeFailure
choco install -y git
ThrowOnNativeFailure
choco install -y cmake
ThrowOnNativeFailure
choco install -y winflexbison3
ThrowOnNativeFailure
choco install -y windows-sdk-8.1
ThrowOnNativeFailure
choco install -y wixtoolset
ThrowOnNativeFailure
Install-Exe -Url "https://packages.icinga.com/windows/dependencies/boost_$($BoostVersion -join '_')-msvc-${MsvcVersion}-${Env:BITS}.exe" -Dir "C:\local\boost_$($BoostVersion -join '_')-Win${Env:BITS}"