install.ps1 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $ErrorActionPreference = "Stop"
  2. try {
  3. Write-Host -ForegroundColor Green "`n### Installing sphinx ###`n"
  4. & choco install -y sphinx --no-progress --source python
  5. if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
  6. Write-Host -ForegroundColor Green "`n### Installing msys64 ###`n"
  7. & choco install -y msys2 --no-progress --params="/InstallDir:$env:MSYS2_ROOT /NoUpdate /NoPath"
  8. Write-Host -ForegroundColor Green "`n### Installing mbedtls via PacMan ###`n"
  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. Write-Host -ForegroundColor Green "`n### Installing clang via PacMan ###`n"
  14. & C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-clang mingw-w64-i686-clang
  15. } elseif ($env:CC_SHORTNAME -eq "vs2015" -or $env:CC_SHORTNAME -eq "vs2017") {
  16. Write-Host -ForegroundColor Green "`n### Installing mbedtls via vcpkg ###`n"
  17. & vcpkg install mbedtls:x86-windows-static
  18. Write-Host -ForegroundColor Green "`n### Installing libcheck via vcpkg ###`n"
  19. & vcpkg install check:x86-windows-static
  20. Write-Host -ForegroundColor Green "`n### Installing DrMemory ###`n"
  21. & choco install -y --no-progress drmemory.portable
  22. $env:Path = 'C:\Program Files (x86)\Dr. Memory\bin;' + $env:Path
  23. }
  24. if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
  25. Write-Host -ForegroundColor Red "`n`n*** Installing dependencies failed. Exiting ... ***"
  26. exit $LASTEXITCODE
  27. }
  28. } catch {
  29. # Print a detailed error message
  30. $FullException = ($_.Exception|format-list -force) | Out-String
  31. Write-Host -ForegroundColor Red "`n------------------ Exception ------------------`n$FullException`n"
  32. [Console]::Out.Flush()
  33. # Wait a bit to make sure appveyor shows the error message
  34. Start-Sleep 10
  35. throw
  36. }