installOpenCppCoverage.ps1 1020 B

12345678910111213141516171819
  1. # Downloads are done from the official github release page links
  2. $downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.7.0/OpenCppCoverageSetup-x64-0.9.7.0.exe"
  3. $installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe")
  4. if(-Not (Test-Path $installerPath)) {
  5. Write-Host -ForegroundColor White ("Downloading OpenCppCoverage from: " + $downloadUrl)
  6. Start-FileDownload $downloadUrl -FileName $installerPath
  7. }
  8. Write-Host -ForegroundColor White "About to install OpenCppCoverage..."
  9. $installProcess = (Start-Process $installerPath -ArgumentList '/VERYSILENT' -PassThru -Wait)
  10. if($installProcess.ExitCode -ne 0) {
  11. throw [System.String]::Format("Failed to install OpenCppCoverage, ExitCode: {0}.", $installProcess.ExitCode)
  12. }
  13. # Assume standard, boring, installation path of ".../Program Files/OpenCppCoverage"
  14. $installPath = [System.IO.Path]::Combine(${Env:ProgramFiles}, "OpenCppCoverage")
  15. $env:Path="$env:Path;$installPath"