Subject: Re: bug#68160: 29.1; Windows installer: add Emacs bin directory to PATH

From: Eli Zaretskii <[email-masked]>
Date: Sun, 31 Dec 2023 09:29:46 +0200

> Date: Sat, 30 Dec 2023 23:59:55 +0000
> From: "Michael Hoffman" <[email-masked]>
> 
> Could the Windows installer add $INSTDIR\emacs-${VERSION_BRANCH}\bin to
> PATH?
> 
> I've started installing Emacs on Windows via WinGet, which is very nice,
> and so much works out of the box, but Emacs commands are not added to
> PATH like they are with Chocolatey. Currently, WinGet does not support
> adding to PATH for packages with an installer, like Emacs.
> 
> If not, would it be possible to add an option to the installer to do
> this? A WinGet package could include that as a custom installer option
> <https://github.com/microsoft/winget-pkgs/blob/master/doc/manifest/schema/1.5.0/installer.md>.

This is up to the person who maintains the Windows install kit for
Emacs, but IMO this should be an optional feature.  On many Windows
systems, changing the environment variables is a privileged operation,
dictated by policy, and will be rejected.  Moreover, modern Windows
systems maintain two lists of Path values: one for the current user
and another that is system-wide, and there are various limitations
about changing each one.

When I install software via an installer, I generally don't want it to
modify my PATH, because those installers have no idea how I manage my
PATH.  For starters, should the Emacs's bin directory be prepended or
appended to the existing PATH value?  That is not a trivial question
to answer, since the Emacs installer comes with DLLs and executables
other than Emacs, and those might interfere with other software
installed on the system.

There be dragons!

OTOH, manually adding the bin directory to your PATH, if you have that
privilege, is easy enough.