Install Haskell development environment fo all users in Windows

On windows, GHCup does not install into the users directory. It installs into e.g. C:\ghcup.

So all you have to do is set the right global environment variables (and possibly file permissions).

  • GHCUP_MSYS2 (to e.g. C:\ghcup\msys64)
  • GHCUP_INSTALL_BASE_PREFIX (to e.g. C:\)
  • PATH to include C:\ghcup\bin

Then the only caveat is: cabal directory. Make sure CABAL_DIR env var is not set. Now… if your users need msys2 C libraries, they have to each adjust their cabal.config accordingly. Also make sure you enable long path behavior.

Also check:

3 Likes