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

From: Corwin Brust <[email-masked]>
Date: Thu, 11 Jan 2024 23:53:10 -0600

On Thu, Jan 11, 2024 at 2:58 PM Stefan Kangas <[email-masked]> wrote:
>
> Eli Zaretskii <[email-masked]> writes:
>
> >> 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?
> >>
> >
> > 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]