install.ps1 2.0 KB

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