install.ps1 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
  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. } elseif ($env:CC_SHORTNAME -eq "vs2015" -or $env:CC_SHORTNAME -eq "vs2017") {
  15. Write-Host -ForegroundColor Green "`n### Installing mbedtls via vcpkg ###`n"
  16. & vcpkg install mbedtls:x86-windows-static
  17. Write-Host -ForegroundColor Green "`n### Installing libcheck via vcpkg ###`n"
  18. & vcpkg install check:x86-windows-static
  19. Write-Host -ForegroundColor Green "`n### Installing DrMemory ###`n"
  20. & cinst --no-progress drmemory.portable
  21. $env:Path = 'C:\Program Files (x86)\Dr. Memory\bin;' + $env:Path
  22. }
  23. if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
  24. Write-Host -ForegroundColor Red "`n`n*** Installing dependencies failed. Exiting ... ***"
  25. exit $LASTEXITCODE
  26. }
  27. } catch {
  28. # Print a detailed error message
  29. $FullException = ($_.Exception|format-list -force) | Out-String
  30. Write-Host -ForegroundColor Red "`n------------------ Exception ------------------`n$FullException`n"
  31. [Console]::Out.Flush()
  32. # Wait a bit to make sure appveyor shows the error message
  33. Start-Sleep 10
  34. throw
  35. }