diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-07-27 00:36:34 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2024-01-30 00:26:40 +0530 |
commit | f55f5a5fe8f8ef40bab4ec772a9dd0a7529bb142 (patch) | |
tree | 1cbcf0a3e54d9b5f006603401b15b495b419f9aa | |
parent | 4ab8e00e028b480832a0c55863fb6fa907ff5238 (diff) |
bootstrap-windows.ps1: Fix check for existing choco install
choco is not in PATH by default when installed by us.
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1239>
-rw-r--r-- | tools/bootstrap-windows.ps1 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/bootstrap-windows.ps1 b/tools/bootstrap-windows.ps1 index 8b60018c..8df2c967 100644 --- a/tools/bootstrap-windows.ps1 +++ b/tools/bootstrap-windows.ps1 @@ -89,14 +89,17 @@ function Install-VS { Get-Date -if (!(Is-Newer 'choco' '0.0')) { - Write-Host "Installing Chocolatey" - Invoke-Expression ((New-Object System.Net.WebClient).DownloadString($choco_url)) - Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1" +$choco_psm = "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1" +if (Test-Path $choco_psm) { + Import-Module $choco_psm Update-SessionEnvironment -} else { Write-Host "Found Chocolatey, upgrading it first" choco upgrade -y chocolatey +} else { + Write-Host "Installing Chocolatey" + Invoke-Expression ((New-Object System.Net.WebClient).DownloadString($choco_url)) + Import-Module $choco_psm + Update-SessionEnvironment } choco feature enable --name="'useEnhancedExitCodes'" |