2

Is there a way that I can check, from a CMD whether a PC has Cygwin or MSYS (MSYS2, MINGW, MINGW-64...) installed?

Note that I need to be able to differentiate Cygwin from MSYS.

Thanks!

j4x
  • 267
  • 3
  • 13

1 Answers1

1

You can try to search for some specific files installed by Cygwin/MSYS with the where command and inspect the output folders: for instance, you could search in cmd for these files

  • msys2.exe, mingw64.exe, mingw32.exe, Cygwin.bat

In my case,

Microsoft Windows [Version 10.0.18362.418]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users> where msys2
C:\msys64\msys2.exe

C:\Users> where mingw64
C:\msys64\mingw64.exe

C:\Users> where mingw32
C:\msys64\mingw32.exe

C:\Users> where cygwin
C:\tools\cygwin\Cygwin.bat

But beware, maybe some users have just some files with those names and not the entire installation files(i.e., maybe someone has C:\msys64\msys2.exe but there's nothing else inside C:\msys64): that's why I told you to inspect the output folders.

Try to identify some important files that should absolutely exist after the Cygwin/MSYS installation and search for them so that you can be mostly sure about the installation(create a batch file to automatically identify all the needed files).