diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 03def3e0768..2ed2a83a29e 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -28,6 +28,21 @@ jobs: fail-fast: false steps: + - run: vswhere + continue-on-error: true + - run: | + $path = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath + if ($path) { + $path = join-path $path 'Common7\Tools\vsdevcmd.bat' + if (test-path $path) { + cmd /s /c """$path"" $args && set" | where { $_ -match '(\w+)=(.*)' } | foreach { + $null = new-item -force -path "Env:\$($Matches[1])" -value $Matches[2] + } + } + } + continue-on-error: true + - run: vswhere -? + continue-on-error: true - name: Set git to use LF run: | git config --global core.autocrlf false