From b28c62d3f17b3d565be8738cba029c8f8c03cc2b Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Sat, 31 Jul 2021 17:24:54 +0300 Subject: [PATCH] [Windows] Use default msys2 installer (#3819) * Use default msys2 installer * Use default msys2 installer * Revert "[Windows] cargo-audit 0.15.0 is broken, stick to 0.14.1 (#3822)" This reverts commit 0b37a50b575f440a515b8f4163fdab9098843317. * merge --- .../win/scripts/Installers/Install-Msys2.ps1 | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/images/win/scripts/Installers/Install-Msys2.ps1 b/images/win/scripts/Installers/Install-Msys2.ps1 index 1a7f2a9a3..a47808c25 100644 --- a/images/win/scripts/Installers/Install-Msys2.ps1 +++ b/images/win/scripts/Installers/Install-Msys2.ps1 @@ -8,43 +8,25 @@ # https://packages.msys2.org/group/ $dash = "-" * 40 - $origPath = $env:PATH -$gitPath = "$env:ProgramFiles\Git" $msys2_release = "https://api.github.com/repos/msys2/msys2-installer/releases/latest" - $msys2Uri = ((Invoke-RestMethod $msys2_release).assets | Where-Object { - $_.name -match "x86_64" -and $_.name.EndsWith("tar.xz") }).browser_download_url + $_.name -match "^msys2-x86_64" -and $_.name.EndsWith(".exe") }).browser_download_url # Download the latest msys2 x86_64, filename includes release date Write-Host "Starting msys2 download using $($msys2Uri.split('/')[-1])" $msys2File = Start-DownloadWithRetry -Url $msys2Uri Write-Host "Finished download" -# nix style path for tar -$msys2FileU = "/$msys2File".replace(':', '').replace('\', '/') - -# Git tar needs exe's from mingw64\bin -$env:PATH = "$gitPath\usr\bin;$gitPath\mingw64\bin;$origPath" - -$tar = "$gitPath\usr\bin\tar.exe" - # extract tar.xz to C:\ -Write-Host "Starting msys2 extraction" -&$tar -xJf $msys2FileU -C /c/ +Write-Host "Starting msys2 installation" +& $msys2File in --confirm-command --accept-messages --root C:/msys64 Remove-Item $msys2File -Write-Host "Finished extraction" # Add msys2 bin tools folders to PATH temporary $env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$origPath" -Write-Host "`n$dash bash pacman-key --init" -bash.exe -c "pacman-key --init 2>&1" - -Write-Host "bash pacman-key --populate msys2" -bash.exe -c "pacman-key --populate msys2 2>&1" - Write-Host "`n$dash pacman --noconfirm -Syyuu" pacman.exe -Syyuu --noconfirm taskkill /f /fi "MODULES eq msys-2.0.dll" @@ -53,7 +35,6 @@ pacman.exe -Syuu --noconfirm taskkill /f /fi "MODULES eq msys-2.0.dll" $toolsetContent = (Get-ToolsetContent).MsysPackages - Write-Host "`n$dash Install msys2 packages" $msys2Packages = $toolsetContent.msys2 pacman.exe -S --noconfirm --needed --noprogressbar $msys2Packages