GNU bug report logs - #68160
29.1; Windows installer: add Emacs bin directory to PATH

Previous Next

Package: emacs;

Reported by: "Michael Hoffman" <emacs-hoffman <at> snkmail.com>

Date: Sun, 31 Dec 2023 00:01:02 UTC

Severity: normal

Found in version 29.1

To reply to this bug, email your comments to 68160 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#68160; Package emacs. (Sun, 31 Dec 2023 00:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Michael Hoffman" <emacs-hoffman <at> snkmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 31 Dec 2023 00:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Michael Hoffman" <emacs-hoffman <at> snkmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.1; Windows installer: add Emacs bin directory to PATH
Date: Sat, 30 Dec 2023 23:59:55 +0000
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>.

In GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02 built on
 AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Home (v10.0.2009.19045.3803)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation=aot
 --without-compress-install --with-tree-sitter CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
  value of $LANG: en_US
  locale-coding-system: utf-8-unix

Major mode: Special




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68160; Package emacs. (Sun, 31 Dec 2023 07:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 68160 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Michael Hoffman" <emacs-hoffman <at> snkmail.com>
Cc: 68160 <at> debbugs.gnu.org
Subject: Re: bug#68160: 29.1;
 Windows installer: add Emacs bin directory to PATH
Date: Sun, 31 Dec 2023 09:29:46 +0200
> Date: Sat, 30 Dec 2023 23:59:55 +0000
> From: "Michael Hoffman" <emacs-hoffman <at> snkmail.com>
> 
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68160; Package emacs. (Thu, 11 Jan 2024 20:59:02 GMT) Full text and rfc822 format available.

Message #11 received at 68160 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Michael Hoffman <emacs-hoffman <at> snkmail.com>, Corwin Brust <corwin <at> bru.st>,
 68160 <at> debbugs.gnu.org
Subject: Re: bug#68160: 29.1;
 Windows installer: add Emacs bin directory to PATH
Date: Thu, 11 Jan 2024 12:58:50 -0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sat, 30 Dec 2023 23:59:55 +0000
>> From: "Michael Hoffman" <emacs-hoffman <at> snkmail.com>
>>
>> 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.

Corwin, any comments here?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68160; Package emacs. (Fri, 12 Jan 2024 05:54:02 GMT) Full text and rfc822 format available.

Message #14 received at 68160 <at> debbugs.gnu.org (full text, mbox):

From: Corwin Brust <corwin <at> bru.st>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Michael Hoffman <emacs-hoffman <at> snkmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 68160 <at> debbugs.gnu.org
Subject: Re: bug#68160: 29.1;
 Windows installer: add Emacs bin directory to PATH
Date: Thu, 11 Jan 2024 23:53:10 -0600
On Thu, Jan 11, 2024 at 2:58 PM Stefan Kangas <stefankangas <at> gmail.com> wrote:
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Date: Sat, 30 Dec 2023 23:59:55 +0000
> >> From: "Michael Hoffman" <emacs-hoffman <at> snkmail.com>
> >>
> >> Could the Windows installer add $INSTDIR\emacs-${VERSION_BRANCH}\bin to
> >> PATH?
> >>
> >
> > There be dragons!
> >
> > OTOH, manually adding the bin directory to your PATH, if you have that
> > privilege, is easy enough.
>
> Corwin, any comments here?
>

I tend to agree with Eli.  That said, adding a page with some Modify
my path options (defaulting to doing nothing) sound like a nice way to
become closer friends with nt/admin/dist-build/emacs.nsi, so I will
try to provide a patch to consider.  If we don't end up merging
anything I won't be offended; however, I'd be fine to see this
included: it doesn't seem actively harmful, although I haven't started
thinking about what new uninstaller options this might imply yet.

Here's is a sketch of my first thought as to what a new page
("section", in NewSoft Installer semantics) might look like:

== Modify Path?  (New section, follows displaying the license)

By default setup will not modify your Windows system PATH.  We
recommend doing so manually to ensure you fully understand and control
the changes made to your operating environment.  You may do so
manually using the "Edit the system environment variables" control
provided by Windows 10 and later.

To leave PATH unchanged press NEXT. If you prefer the setup process to
automatically update the system PATH while installing Emacs, first
choose from the options below and then press next.

✅ Add Emacs' bin folder to my PATH (checkbox, starts unchecked)

[  The above is defaults to unchecked, if it is checked the other
options are enabled ]

Changes to make to PATH:
  🔘 Add to the end of my current path (radio, starts checked)
  🔘 Add at the start to my current path (radio, starts unchecked)
  ✅ Remove other entries in the form \emacs*\bin from my PATH
(checkbox, starts unchecked)

Modify PATH for
  🔘 The current system user (radio, starts checked)
  🔘 All users (default profile) [radio, starts unchecked

[BACK]  [NEXT]




This bug report was last modified 1 year and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.