install.ps1 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. $ErrorActionPreference = "Stop"
  2. try {
  3. & git submodule --quiet update --init --recursive
  4. Write-Host -ForegroundColor Green "`n### CMake and Python pre-installed AppVeyor Windows build VMs ###`n"
  5. Write-Host -ForegroundColor Green "`n### Installing sphinx ###`n"
  6. & cinst sphinx --source python
  7. Write-Host -ForegroundColor Green "`n### Installing mbedtls ###`n"
  8. if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
  9. # pacman may complain that the directory does not exist, thus create it.
  10. # See https://github.com/open62541/open62541/issues/2068
  11. & C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
  12. & C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-mbedtls
  13. } elseif ($env:CC_SHORTNAME -eq "vs2015" -or $env:CC_SHORTNAME -eq "vs2017") {
  14. # we need the static version, since open62541 is built with /MT
  15. # vcpkg currently only supports VS2015 and newer builds
  16. & vcpkg install mbedtls:x86-windows-static
  17. }
  18. if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
  19. Write-Host -ForegroundColor Red "`n`n*** Installing mbedtls failed. Exiting ... ***"
  20. exit $LASTEXITCODE
  21. }
  22. if ($env:CC_SHORTNAME -eq "vs2015" -or $env:CC_SHORTNAME -eq "vs2017") {
  23. Write-Host -ForegroundColor Green "`n### Installing libcheck ###`n"
  24. & appveyor DownloadFile https://github.com/Pro/check/releases/download/0.12.0_dbg/check.zip
  25. & 7z x check.zip -oc:\ -bso0 -bsp0
  26. Write-Host -ForegroundColor Green "`n### Installing DrMemory ###`n"
  27. & cinst --no-progress drmemory.portable
  28. $env:Path = 'C:\Program Files (x86)\Dr. Memory\bin;' + $env:Path
  29. }
  30. } catch {
  31. # Print a detailed error message
  32. $FullException = ($_.Exception|format-list -force) | Out-String
  33. Write-Host -ForegroundColor Red "`n------------------ Exception ------------------`n$FullException`n"
  34. [Console]::Out.Flush()
  35. # Wait a bit to make sure appveyor shows the error message
  36. Start-Sleep 10
  37. throw
  38. }