-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Manually" install MSI dependencies instead of using choco install (#…
…5553) * Add "install MSI" helper for pipeline * Install cppcheck using MSI directly * TESTING cppcheck * Install Azure functions using the MSI instead of chocolatey * Revert "TESTING cppcheck" This reverts commit 5603b4b.
- Loading branch information
1 parent
d5ac9e9
commit 53a2313
Showing
3 changed files
with
63 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
parameters: | ||
- name: url | ||
type: string | ||
|
||
- name: filename | ||
type: string | ||
|
||
- name: msiParams | ||
type: string | ||
default: '' | ||
|
||
- name: addToPath | ||
type: string | ||
default: '' | ||
|
||
- name: retries | ||
type: number | ||
default: 3 | ||
|
||
steps: | ||
- powershell: | | ||
$ErrorActionPreference = 'Stop' | ||
$url = "${{ parameters.url }}"; | ||
$file = "$(Agent.TempDirectory)\${{ parameters.filename }}" | ||
Write-Host "Downloading from $url to $file"; | ||
Invoke-WebRequest -Uri $url -OutFile $file | ||
$installArgs = "/i $file ${{ parameters.msiParams }} /norestart" | ||
Write-Host "Installing using msiexec $installArgs"; | ||
Start-Process msiexec $installArgs -Wait | ||
Write-Host "Installed"; | ||
if("${{ parameters.addToPath }}") { | ||
Write-Host "Adding to PATH"; | ||
Write-Host "##vso[task.setvariable variable=PATH;]${env:PATH};${{ parameters.addToPath }}"; | ||
} | ||
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | ||
refreshenv | ||
displayName: Installing ${{ parameters.filename }} | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) # TODO: error on non-windows? | ||
retryCountOnTaskFailure: ${{ parameters.retries }} | ||
timeoutInMinutes: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters