Skip to content

Instantly share code, notes, and snippets.

@FeodorFitsner
Created September 3, 2018 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save FeodorFitsner/a7a5fdf8f3160a8f286ad2231aadadfc to your computer and use it in GitHub Desktop.
Save FeodorFitsner/a7a5fdf8f3160a8f286ad2231aadadfc to your computer and use it in GitHub Desktop.
Installing MSYS2
Write-Host "Installing MSYS2..." -ForegroundColor Cyan
if(Test-path C:\msys64) {
del C:\msys64 -Recurse -Force
}
# download installer
$zipPath = "$($env:TEMP)\msys2-x86_64-latest.tar.xz"
$tarPath = "$($env:TEMP)\msys2-x86_64-latest.tar"
Write-Host "Downloading MSYS installation package..."
(New-Object Net.WebClient).DownloadFile('http://repo.msys2.org/distrib/msys2-x86_64-latest.tar.xz', $zipPath)
Write-Host "Untaring installation package..."
7z x $zipPath -y -o"$env:TEMP" | Out-Null
Write-Host "Unzipping installation package..."
7z x $tarPath -y -oC:\ | Out-Null
del $zipPath
del $tarPath
function bash($command) {
Write-Host $command -NoNewline
cmd /c start /wait C:\msys64\usr\bin\sh.exe --login -c $command
Write-Host " - OK" -ForegroundColor Green
}
[Environment]::SetEnvironmentVariable("MSYS2_PATH_TYPE", "inherit", "Machine")
# install latest pacman
#bash 'pacman -Sy --noconfirm pacman pacman-mirrors'
# update core packages
bash 'pacman -Syuu --needed --noconfirm --ask=20'
bash 'pacman -Syu --noconfirm'
bash 'pacman -Syu --noconfirm'
# install packages
bash 'pacman --sync --noconfirm VCS'
bash 'pacman --sync --noconfirm base-devel'
bash 'pacman --sync --noconfirm msys2-devel'
bash 'pacman --sync --noconfirm mingw-w64-{x86_64,i686}-toolchain'
Write-Host "MSYS2 installed" -ForegroundColor Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment