Installing MSYS2 - Overview

· 4 minute read · 0 Comments

Overview of Installation

In order to get MinGW 64-Bit installed, I will first need to download and install MSYS2. This provides a package manager pacman, which is a port from Arch Linux.

If you would like a more in-depth guide for the installation process, please view my full guide .

Downloading and Installing MSYS2

I recommend having a Windows Command Prompt open (or your preferred Windows Console Emulator) to assist in the installation process for there are some things you cannot do from within MSYS2 Shell.

  1. Downloaded the 64-Bit Installer Binaries

    1. I chose msys2-x86_64-20161025.exe.

    Note: From this version of MSYS2, it cannot be installed on FAT* partitions, and cannot be installed on Windows XP.

  2. Installed using the Installation Wizard.

    1. Installation folder: C:\Apps\msys64
    2. Left default Start Menu Shortcut.

    See full guide for a step-by-step walkthrough of the installation wizard.

  3. Moved my /home/Brian directory to another part on the harddrive and created a junction. MSYS2 will keep all files within its installation directory, this includes the users /home/ directories. For reasons like if you ever uninstall MSYS2, part of the uninstallation process will remove everything within the installation directory thus removing your /home/ directory.
    Because creating symlinks within MSYS2 is not a fully supported feature1, I chose instead to use Windows CMD Prompt.

    1. Within a CMD Prompt and navigate to C:\Apps\msys64\home.
    2. Move Brian directory using Robocopy.
      example: robocopy Brian C:\slash\home\Brian /MOVE
    3. Create a junction mklink /J Brian C:\slash\home\Brian

    See full guide for more information about moving /home/Brian/ and creating a junction.

  4. Restrict access to /home/Brian/ Because I did not put my home directory within my Users directory, as in C:\Users\Brian, creating a directory as what was done in the previous step would use the default permission. Unless you or your administrator has changed the policy, by default everyone who has access to the machine will be able to view these files.

    1. From your Command Prompt, run:

      icacls Brian /inheritance:r /grant:r Administrators:(OI)(CI)(IO)F^
      /grant:r Administrators:F /grant:r Brian:(OI)(CI)(IO)F /grant:r Brian:F /T
      

    See full guide for more information on icacls.

  5. Added icons for MSYS2’s shortcuts. To add a bit of colour to the shortcuts, I added the provided MSYS2’s icons for each.

    Shortcut
                 Icon
    MSYS2 MinGW 32-bit: C:\Apps\msys64\msys2_shell.cmd -mingw32
    MSYS2 MinGW 64-bit: C:\Apps\msys64\msys2_shell.cmd -mingw64
    MSYS2 MSYS: C:\Apps\msys64\msys2_shell.cmd -msys

    See full guide for more information on adding icons to shortcuts.

  6. Added exclusion to Anti-virus/malware programs.

    1. Added an exclusion in Malwarebytes Premium for:
      C:\Apps\msys64\usr\bin\pacman.exe

    Note: I am only adding the exception to Malwarebytes for I’ve run into issues with it. Since we will be adding a way of backing up and restore our system I figure it’s better to only add exclusions if we need it.
    See full guide for a walkthrough on adding an exclusion to Malwarebytes.

  7. Updated the core packages using pacman.

    1. Open a MSYS2 Subsystem shell.
    2. Run pacman -Sy to synchronize local database with latest repositories.
    3. Run pacman --needed -S bash pacman pacman-mirrors msys2-runtime to update the the core packages.
      Important: If any packages are updated, you must restart MSYS2.
    4. After completing, we had packages that were upgraded, so now we need to kill the process and relaunch the shell.
      1. Within your CMD Prompt, run taskkill /IM mintty.exe /T
      2. Re-launch your MSYS2 Subsystem shell.
    See full guide for an example of updating the core packages.

  8. Updated the remaining packages.

    1. Open a MSYS2 Subsystem shell.
    2. Run pacman --needed -Suu which updates the remaining packages on my system that may need updating.
    See full guide for an example of updating the remaining packages.

MSYS2 Installation Complete

Running pacman --needed -Suu shows that everything is up to date.

Brian@Brian-PC MSYS ~
$ pacman --needed -Suu
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
 there is nothing to do

Our installation of MSYS2 is complete. Next we will be setting up your development environment using pacman to install the required packages.

Please [let me know][linkContact] if you ran into any issues with the installationthe installation.

What is MinGW?

MinGW stands for Minimalist GNU for Windows. MinGW-w64 is a fork from the original MinGW project. From MinGW’s own description, it should be noted that “MinGW, being minimalist, does not, and never will attempt to provide a POSIX runtime environment for POSIX application deployment on MS-Windows.”

What is MSYS2?

From their webpage, MSYS2 is a software distro and building platform for Windows.

At its core 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. It provides a bash shell, Autotools, revisiion control systems and the like for building native Windows applications using the MinGW-w64 toolchains.


  1. A minor correction is that following the instructions that were responded within the issue, if you modify msys2_shell.cmd and always run the shell as Administrator, you can properly create symlinks. Due to me not liking to always be working as Administrator, I prefer to just use a CMD Prompt instead. [return]

Contents


Please contact me at if you have any questions or comments.