diff options
author | Michal Čihař <nijel@debian.org> | 2016-10-18 14:37:06 +0200 |
---|---|---|
committer | Michal Čihař <nijel@debian.org> | 2016-10-18 14:37:06 +0200 |
commit | 85b8cdaaa4870f65a24fae9b195b79807520099f (patch) | |
tree | 2c73fbe5d06ddeb6258d9378490d3b6f975a4b88 /admin/install_opencppcoverage.ps1 | |
parent | 69153b508b7834038c9be40e4e8b7e87a35345a1 (diff) |
New upstream version 1.37.90
Diffstat (limited to 'admin/install_opencppcoverage.ps1')
-rw-r--r-- | admin/install_opencppcoverage.ps1 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/admin/install_opencppcoverage.ps1 b/admin/install_opencppcoverage.ps1 new file mode 100644 index 0000000..431cd02 --- /dev/null +++ b/admin/install_opencppcoverage.ps1 @@ -0,0 +1,32 @@ +#todo: convert this into a chocolatey package... + +$downloadUrl = "http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=opencppcoverage&DownloadId=1594912&FileTime=131138681432830000&Build=21031" + +$installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe") +$installPath = [System.IO.Path]::Combine(${Env:ProgramFiles}, "OpenCppCoverage") +$openCppCoverageExe = [System.IO.Path]::Combine($installPath, "OpenCppCoverage.exe") + +if(-Not (Test-Path $installerPath)) +{ + Write-Host -ForegroundColor White ("Downloading OpenCppCoverage from: " + $downloadUrl) + Start-FileDownload $downloadUrl -FileName $installerPath +} + +Write-Host -ForegroundColor White "Installing OpenCppCoverage..." + +$installProcess = (Start-Process $installerPath -ArgumentList '/VERYSILENT' -PassThru -Wait) +if($installProcess.ExitCode -ne 0) +{ + throw [System.String]::Format("Failed to install OpenCppCoverage, ExitCode: {0}.", $installProcess.ExitCode) +} + +$env:Path="$env:Path;$installPath" + +# Redirect from stderr +(& $openCppCoverageExe -h) 2>&1 | Select -First 1 | Write-Host -ForegroundColor White + +# OpenCppCoverage returns 1 with no passed options... +if($LASTEXITCODE -ne 1) +{ + throw [System.String]::Format("Failed to check the OpenCppCoverage version, ExitCode: {0}.", $LASTEXITCODE) +} |