install.ps1 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. $ErrorActionPreference = "Stop"
  2. try {
  3. & git submodule --quiet update --init --recursive
  4. Write-Host -ForegroundColor Green "`n### Installing CMake and python ###`n"
  5. & cinst --no-progress cmake python2
  6. & C:\Python27\python.exe -m pip install --upgrade pip
  7. & C:\Python27\Scripts\pip.exe install six
  8. Write-Host -ForegroundColor Green "`n### Installing sphinx ###`n"
  9. & C:\Python27\Scripts\pip.exe install --user sphinx sphinx_rtd_theme
  10. # Write-Host -ForegroundColor Green "`n### Installing Miktex ###`n"
  11. # if (-not (Test-Path "c:\miktex\texmfs\install\miktex\bin\pdflatex.exe")) {
  12. # & appveyor DownloadFile https://ftp.uni-erlangen.de/mirrors/CTAN/systems/win32/miktex/setup/windows-x86/miktex-portable-2.9.6753.exe
  13. # & 7z x miktex-portable-2.9.6753.exe -oc:\miktex -bso0 -bsp0
  14. # # Remove some big files to reduce size to be cached
  15. # Remove-Item -Path c:\miktex\texmfs\install\doc -Recurse
  16. # Remove-Item -Path c:\miktex\texmfs\install\miktex\bin\biber.exe
  17. # Remove-Item -Path c:\miktex\texmfs\install\miktex\bin\a5toa4.exe
  18. # }
  19. # Write-Host -ForegroundColor Green "`n### Installing graphviz ###`n"
  20. # & cinst --no-progress graphviz
  21. # if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
  22. # Write-Host -ForegroundColor Red "`n`n*** Installing graphviz failed. Exiting ... ***"
  23. # exit $LASTEXITCODE
  24. # }
  25. Write-Host -ForegroundColor Green "`n### Installing mbedtls ###`n"
  26. if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
  27. # pacman may complain that the directory does not exist, thus create it.
  28. # See https://github.com/open62541/open62541/issues/2068
  29. & C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
  30. & C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-mbedtls
  31. } elseif ($env:CC_SHORTNAME -eq "vs2015") {
  32. # we need the static version, since open62541 is built with /MT
  33. # vcpkg currently only supports VS2015 and newer builds
  34. & vcpkg install mbedtls:x86-windows-static
  35. }
  36. if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
  37. Write-Host -ForegroundColor Red "`n`n*** Installing mbedtls failed. Exiting ... ***"
  38. exit $LASTEXITCODE
  39. }
  40. if ($env:CC_SHORTNAME -eq "vs2015") {
  41. Write-Host -ForegroundColor Green "`n### Installing libcheck ###`n"
  42. & appveyor DownloadFile https://github.com/Pro/check/releases/download/0.12.0_win/check.zip
  43. & 7z x check.zip -oc:\ -bso0 -bsp0
  44. Write-Host -ForegroundColor Green "`n### Installing DrMemory ###`n"
  45. & cinst --no-progress drmemory.portable
  46. }
  47. } catch {
  48. # Print a detailed error message
  49. $FullException = ($_.Exception|format-list -force) | Out-String
  50. Write-Host -ForegroundColor Red "`n------------------ Exception ------------------`n$FullException`n"
  51. [Console]::Out.Flush()
  52. # Wait a bit to make sure appveyor shows the error message
  53. Start-Sleep 10
  54. throw
  55. }