install.ps1 2.2 KB

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