Notices: This section not yet converted to new layout. Download stats are rolling back out.

This is not the latest version of MSYS2 available.

MSYS2

20160719.1.1

Package test results are passing.

This package was approved by moderator flcdrg on 10/15/2016.

From https://sourceforge.net/p/msys2/wiki/MSYS2%20introduction/ :

"MSYS2 is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 with the aim of better interoperability with native Windows software."

You should read the full official introduction before using MSYS2.

Chocolatey MSYS2 is not affiliated with the MSYS2 project and does not include a copy of MSYS2. It just automatically downloads and installs MSYS2 and adds some extra tools for better integration into CMD shell (and PowerShell in future releases).

NOTES

The Chocolatey MSYS2 versioning scheme uses the current MSYS2 archive version as first component and tracks further changes in the Chocolatey package with the second and third component.

Chocolatey MSYS2 automatically installs either 32bit or 64bit MSYS2. It does NOT work with choco install -x86 (forced 32bit installation) under 64bit Windows. There is usually no need to install a 32bit MSYS2 under 64bit Windows, because MSYS2 always contains a MINGW32 and a MINGW64 environment.

The MSYS2 archive will be extracted to Chocolatey's BinRoot (usually C:\Tools\). The 32bit variant uses an msys32\ root folder and the 64bit variant uses msys64\ respectively. The MSYS2 root folder will be appended to %PATH%. It contains the msys2_shell.bat, mingw32_shell.bat, and mingw64_shell.bat scripts. No bin\ folders will be added to %PATH%. After unpacking, MSYS2 will be automatically initialized and updated with Pacman according to the official instructions.

MSYS2 itself will not be removed on uninstalling the Chocolatey package and will not be downloaded and extracted again (even if the MSYS2 archive version has changed) on updating or reinstalling the Chocolatey package. The existing MSYS2 will just be updated with Pacman.

Chocolatey MSYS2 offers an extra msystem.bat script in its package folder (which will also be appended to %PATH%). The script can be used to activate and switch MSYS, MINGW32, and MINGW64 environments inside a CMD shell without running Bash. It will prepend the appropriate bin\ folders to %PATH%. MSYS mode additionally provides bash.bat and pacman.bat wrapper scripts and according auto-completion scripts for Clink. Call msystem /? after installation or look at the top of the script file for more details. These extra features and even more (like better integration with other shell environments, a better bash.bat, and more wrapper scripts for tools like makepkg, ..., and an according PowerShell module) will be moved from the Chocolatey MSYS2 package to separate projects, which will then be installable as MSYS2 packages, of course auto-installed by Chocolatey MSYS2 :)

To install MSYS2, run the following command from the command line or from PowerShell:

C:\> choco install msys2 --version 20160719.1.1

To upgrade MSYS2, run the following command from the command line or from PowerShell:

C:\> choco upgrade msys2 --version 20160719.1.1

Files

Hide
  • clink\msystem.lua
  • clink\pacman.lua
  • LICENSE
  • msys\bash.bat Show
    @echo off
    REM Chocolatey MSYS2
    REM
    REM Copyright (C) 2015 Stefan Zimmermann <[email protected]>
    REM
    REM Licensed under the Apache License, Version 2.0
    
    setlocal
    
    set MSYSTEM=MSYS
    if "%~1" == "" (
        start bash.exe --login
    ) else (
        bash.exe --login %*
    )
    
    endlocal
    
  • msys\pacman.bat Show
    @echo off
    REM Chocolatey MSYS2
    REM
    REM Copyright (C) 2015 Stefan Zimmermann <[email protected]>
    REM
    REM Licensed under the Apache License, Version 2.0
    
    %~dp0\bash.bat -c "pacman --color auto %*"
    
  • msystem.bat Show
    @echo off
    REM Chocolatey MSYS2
    REM
    REM Copyright (C) 2015 Stefan Zimmermann <[email protected]>
    REM
    REM Licensed under the Apache License, Version 2.0
    
    
    if "%~1" == "/?" (
        echo Activates an MSYS2 environment inside a CMD shell,
        echo either in MSYS or MINGW32 or MINGW64 mode,
        echo by prepending the relevant MSYS2 bin\ paths to %%PATH%%.
        echo.
        echo MSYSTEM [MSYS ^| MINGW32 ^| MINGW64]
        echo.
        echo The MINGW modes do NOT include the MSYS mode bin\ paths.
        echo.
        echo In MSYS mode, an additional path containing wrapper scripts
        echo for BASH and PACMAN is prepended to %%PATH%%.
        echo.
        echo The root directory of the MSYS2 installation
        echo ^(usually C:\path\to\msys32 or ...\msys64^)
        echo must be defined in %%MSYS2_ROOT%% or must be in %%PATH%%.
        echo.
        echo After successful activation,
        echo the environment name will be stored in %%MSYS2_SYSTEM%%
        echo and an according ^<MSYS^> or ^<MINGW32^> or ^<MINGW64^> tag
        echo will be prepended to %%PROMPT%%.
        echo.
        echo Call MSYSTEM without an argument
        echo to show the currently active MSYS2 environment.
        echo.
        echo Call MSYSTEM /D to deactivate an MSYS2 environment.
        echo.
        echo Be careful when using MSYSTEM together with other shell environments
        echo ^(like virtual Python environments, etc...^).
        echo Due to %%PATH%% changes,
        echo the precedence of commands with same names also changes.
        echo Future versions of MSYSTEM will try to automatically avoid conflicts
        echo with certain other environment types.
        echo.
        echo Call MSYSTEM /I with any of the following specifiers
        echo to install MSYS2 features into certain shell extension frameworks.
        echo.
        echo Install CLINK auto-completion for MSYSTEM and PACMAN with:
        echo.
        echo     MSYSTEM /I CLINK [clink settings directory]
        echo.
        echo If no CLINK settings directory is given,
        echo MSYSTEM will try to automatically find it.
        exit /b 0
    )
    if "%~1" == "" (
        REM only show info and exit
        if "%MSYS2_SYSTEM%" == "" (
            echo No active MSYS2 environment.
            exit /b 1
        )
        echo %MSYS2_SYSTEM%
        exit /b 0
    )
    
    REM --------------------------------------------------------------------------
    REM Handle flags
    
    if /i "%~1" == "/D" (
        REM deactivate MSYS2 environment
        set MSYS2_SYSTEM=
        goto prepare
    )
    if /i "%~1" == "/I" (
        REM install MSYS2 features into CMD shell extension frameworks
        goto install
    )
    
    REM --------------------------------------------------------------------------
    REM Check for valid MSYS2 environment name and set %MSYS2_SYSTEM% accordingly
    
    for %%M in (MSYS MINGW32 MINGW64) do if /i "%~1" == "%%M" (
        set MSYS2_SYSTEM=%%M
        goto prepare
    )
    echo Invalid argument '%~1'. Call MSYSTEM /? for help.
    exit /b 1
    
    
    REM --------------------------------------------------------------------------
    REM Check system and create variables for MSYS2 (de)activation
    :prepare
    
    if "%MSYS2_ROOT%" == "" (
        REM try to find MSYS2 root directory in %PATH%
        for %%S in (msys2_shell.cmd) do (
            set "MSYS2_ROOT=%%~dp$PATH:S"
            REM %MSYS2_ROOT% would not be set in current context w/o goto
            REM (that often discussed strange set-in-for-loop behavior...)
            goto checkRoot
        )
        :checkRoot
        if "%MSYS2_ROOT%" == "" (
            echo Can't determine MSYS2 root directory.
            echo No %%MSYS2_ROOT%% defined and not in %%PATH%%.
            set MSYS2_SYSTEM=
            exit /b 1
        )
        REM remove trailing \
        set "MSYS2_ROOT=%MSYS2_ROOT:~0,-1%"
    )
    if not exist "%MSYS2_ROOT%\" (
        echo %%MSYS2_ROOT%% '%MSYS2_ROOT%' does not exist or is not a directory.
        set MSYS2_SYSTEM=
        exit /b 1
    )
    
    REM construct MSYS2 and MINGW32/64 bin paths
    set "MSYS2_PATH=%MSYS2_ROOT%\usr\local\bin;%MSYS2_ROOT%\usr\bin;%MSYS2_ROOT%\bin"
    set "MSYS2_MINGW32_PATH=%MSYS2_ROOT%\mingw32\bin"
    set "MSYS2_MINGW64_PATH=%MSYS2_ROOT%\mingw64\bin"
    
    
    REM --------------------------------------------------------------------------
    REM Always deactivate current MSYS2 environment before activating a new one
    :deactivate
    
    REM remove any existing MSYS2 and MINGW32/64 bin paths from %PATH%
    call set "PATH=%%PATH:%MSYS2_PATH%;=%%"
    call set "PATH=%%PATH:%MSYS2_MINGW32_PATH%;=%%"
    call set "PATH=%%PATH:%MSYS2_MINGW64_PATH%;=%%"
    REM and also remove the extra MSYS tool wrapper scripts path
    call set "PATH=%%PATH:%~dp0msys;=%%"
    
    REM remove any <MSYS> or <MINGW32/64> tags from %PROMPT%
    REM (use temporary %_msysPrompt% to avoid too many %PROMPT% changes,
    REM  which can result in strange shell behavior)
    set _cleanPrompt=%PROMPT:$LMSYS$G$S=%
    set _cleanPrompt=%_cleanPrompt:$LMINGW32$G$S=%
    set _cleanPrompt=%_cleanPrompt:$LMINGW64$G$S=%
    
    REM check if only deactivation requested (via MSYSTEM /D)
    if "%MSYS2_SYSTEM%" == "" (
        prompt %_cleanPrompt%
        set _cleanPrompt=
        exit /b 0
    )
    
    
    REM --------------------------------------------------------------------------
    :activate
    
    REM prepend MSYS2 bin paths and/or MINGW32/64 bin paths to %PATH%
    if "%MSYS2_SYSTEM%" == "MSYS" (
        REM also prepend the extra MSYS tool wrapper scripts path
        set "PATH=%~dp0msys;%MSYS2_PATH%;%PATH%"
    )
    if "%MSYS2_SYSTEM%" == "MINGW32" (
        set "PATH=%MSYS2_MINGW32_PATH%;%PATH%"
    )
    if "%MSYS2_SYSTEM%" == "MINGW64" (
        set "PATH=%MSYS2_MINGW64_PATH%;%PATH%"
    )
    
    REM prepend the appropriate <MSYS> or <MINGW32/64> tag to %PROMPT%
    prompt $L%MSYS2_SYSTEM%$G$S%_cleanPrompt%
    set _cleanPrompt=
    
    exit /b 0
    
    
    REM --------------------------------------------------------------------------
    REM Install MSYS2 features into CMD shell extension frameworks
    :install
    
    if "%2" == "" (
        echo Missing specifier. Call MSYSTEM /? for help.
        exit /b 1
    )
    if /i "%2" == "clink" goto clink
    
    
    REM --------------------------------------------------------------------------
    REM Install MSYS2 auto-completion features into CLINK
    :clink
    
    setlocal EnableDelayedExpansion
    
    if /i "%~3" == "" (
        REM no clink settings dir given ==> try to find
        set "clinkDir=%localappdata%\clink"
        if not exist "!clinkDir!\" (
            echo Could not find CLINK settings directory.
            echo Please provide it as additional argument.
            exit /b 1
        )
    ) else (
        if not exist "%~3\" (
            echo '%~3' does not exist or is not a directory.
            exit /b 1
        )
        set "clinkDir=%~3"
    )
    
    set nl=^
    
    
    set "root=%~dp0"
    REM remove trailing \
    set "root=%root:~0,-1%"
    REM create a LUA script that loads all auto-completion scripts from .\clink\
    set msysLua=                                                             !nl!^
        local root = "%root:\=\\%"                                           !nl!^
        local scripts = {}                                                   !nl!^
        local p = io.popen("dir /b " .. root .. "\\clink\\*.lua")            !nl!^
        for file in p:lines() do                                             !nl!^
            table.insert(scripts, file)                                      !nl!^
        end                                                                  !nl!^
        if p:close() then                                                    !nl!^
           for _, file in next, scripts do                                   !nl!^
               dofile(root .. "\\clink\\" .. file)                           !nl!^
           end                                                               !nl!^
        end                                                                  !nl!^
    
    
    echo Writing '%clinkDir%\msys2.lua'
    echo !msysLua! > %clinkDir%\msys2.lua
    
    endlocal
    
  • NOTICE
  • tools\chocolateyinstall.ps1 Show
    # Chocolatey MSYS2
    #
    # Copyright (C) 2015 Stefan Zimmermann <[email protected]>
    #
    # Licensed under the Apache License, Version 2.0
    
    $ErrorActionPreference = 'Stop';
    
    $packageName = 'msys2'
    
    $msysVersion = '20160719'
    
    $msys32DistName = "msys2-base-i686-$msysVersion"
    $msys64DistName = "msys2-base-x86_64-$msysVersion"
    
    $url = "http://repo.msys2.org/distrib/i686/$msys32DistName.tar.xz"
    $checksum = '2F222FA6409D2C14B97DC5197757BE387D6D12E3'
    $checksumType = 'SHA1'
    
    $url64 = "http://repo.msys2.org/distrib/x86_64/$msys64DistName.tar.xz"
    $checksum64 = '4FF1090B143DEAEDED088146E04503B9A3C15FDB'
    $checksumType64 = 'SHA1'
    
    $toolsDir = Split-Path -parent $MyInvocation.MyCommand.Definition
    
    $packageDir = Split-Path -parent $toolsDir
    Write-Host "Adding '$packageDir' to PATH..."
    Install-ChocolateyPath $packageDir
    
    $osBitness = Get-ProcessorBits
    if ($osBitness -eq 32) {
        $msysDistName = $msys32DistName
    }
    else {
        $msysDistName = $msys64DistName
    }
    
    $binRoot = Get-ToolsLocation
    # MSYS2 zips contain a root dir named msys32 or msys64
    $msysName = 'msys' + $osBitness
    $msysRoot = Join-Path $binRoot $msysName
    
    if (Test-Path $msysRoot) {
        Write-Host "'$msysRoot' already exists and will only be updated."
    }
    else {
        Write-Host "Installing to '$msysRoot'"
        Install-ChocolateyZipPackage $packageName $url $binRoot $url64 `
          -checksum $checksum -checksumType $checksumType `
          -checksum64 $checksum64 -checksumType64 $checksumType64
    
        # check if .tar.xz was only unzipped to tar file
        # (shall work better with newer choco versions)
        $tarFile = Join-Path $binRoot "$msysDistName.tar"
        if (Test-Path $tarFile) {
            Get-ChocolateyUnzip $tarFile $binRoot
            Remove-Item $tarFile
            if (-not (Test-Path $msysRoot)) {
                throw "No '$msysRoot' found after extracting."
            }
        }
        else {
            if (-not (Test-Path $msysRoot)) {
                throw "No '$tarFile' or '$msysRoot' found after unzipping."
            }
        }
    }
    
    Write-Host "Adding '$msysRoot' to PATH..."
    Install-ChocolateyPath $msysRoot
    
    # Finally initialize and upgrade MSYS2 according to https://msys2.github.io
    # and https://sourceforge.net/p/msys2/wiki/MSYS2%20installation/
    Write-Host "Initializing MSYS2..."
    
    $msysExe = Join-Path $msysRoot msys2.exe
    if (-not (Test-Path $msysExe)) {
        throw @"
    No '$msysExe' found.
    You probably have an outdated MSYS2 installation in '$msysRoot'.
    Please delete '$msysRoot' and reinstall.
    "@
    }
    
    Write-Host "Starting '$msysExe'..."
    Start-Process -Wait $msysExe -ArgumentList '-c', exit
    
    $command = 'pacman --noconfirm -Syuu'
    Write-Host "Upgrading core system packages with '$command'..."
    Start-Process -Wait $msysExe -ArgumentList '-c', "'$command'"
    
    Write-Host "Upgrading full system with '$command'..."
    Start-Process -Wait $msysExe -ArgumentList '-c', "'$command'"
    
  • tools\chocolateyuninstall.ps1 Show
    # Chocolatey MSYS2
    #
    # Copyright (C) 2015 Stefan Zimmermann <[email protected]>
    #
    # Licensed under the Apache License, Version 2.0
    
    $ErrorActionPreference = 'Stop';
    
    $packageName = 'msys2'
    
    $toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
    
    $packageDir = Split-Path -Parent $toolsDir
    if (Get-Command Uninstall-ChocolateyPath -ErrorAction SilentlyContinue) {
        Write-Host "Removing '$packageDir' from PATH..."
        Uninstall-ChocolateyPath "$packageDir"
    } else {
        Write-Host "Please remove '$packageDir' manually from PATH.",
          "This should work automatically with future 'choco' versions."
    }
    
    $osBitness = Get-ProcessorBits
    
    $binRoot = Get-ToolsLocation
    # MSYS2 root dir is named msys32 or msys64
    $msysName = "msys$osBitness"
    $msysRoot = Join-Path $binRoot $msysName
    
    Write-Host "Not removing '$msysRoot'.",
      "Please remove it manually (and also from PATH)",
      "when you don't need it anymore."
    

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Maintainer(s)

Software Author(s)

  • Alexpux
  • martell
  • mingwandroid
  • elieux
  • renatosilva
  • niXman

Copyright

MSYS2 Copyright (c) 2013, Алексей

Tags

Release Notes

https://github.com/userzimmermann/choco-packages/blob/master/msys2/CHANGES.md

Version History

Version Downloads Last updated Status
MSYS2 20160719.1.1 17359 Wednesday, October 12, 2016 approved
MSYS2 20160719.1.0 256 Monday, October 10, 2016 approved
MSYS2 20150916.0.1 2076 Sunday, November 22, 2015 approved
MSYS2 20150916.0.0 115 Sunday, September 27, 2015 approved

Discussion for the MSYS2 Package

Ground rules:

  • This discussion is only about MSYS2 and the MSYS2 package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or MSYS2, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus