Blame misc/installOpenCppCoverage.ps1

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