Subject: bug#68756: Uninstalling emacs does not remove Start Menu entries created during the installation

From: Corwin Brust <[email-masked]>
Date: Sun, 11 Feb 2024 16:56:17 -0600

tags 68756 + patch
thanks

Дилян,  I have created an installer based on the attached patch and
posted it to my own site.  If you try that out please let me know what
you think.

https://bru.st/i/emacs-29.2.50_bug%2358756-installer.exe

Note, this is based on the "tip" of the emacs-29 branch, and not built
from the release sources for no other reason than expediency: I am
running a CI locally so I can easily test changes to the NSI installer
without (especially) compiling other things.  And that also means I'm
quite open to trying things, if we come up with more adventurous
changes than those proposed here.

Reprising your original expectations:

> • Uninstalling emacs should remove the Start Menu directories, created during installing emacs.

This is fixed, I believe, however a bug remains (I will file a new bug
given we wind up taking things in pieces, as I'm suggesting):
customizing the name of the Start Menu folder isn't working for me
with or without this patch.  Meanwhile:

> • Installing emacs should ask to first remove the previously installed emacs version, as long as it does not do inplace upgrade (substitution).

Per this patch I did not add any Sections or controls, however a given
uninstaller will no-longer delete any other versions beside the one it
installed.

I am open to better and more dramatic changes, but I think it might
make sense to work in stages, perhaps under quite granular bug
reports.  In any event, I expect to "work my way up" to any more
complex changes needed to the NSI script incrementally.

Stefan,

I think the attached minimal change, plus the other patch for not
needing to "accept" licensing in 67667 (which tracker I've added in
CC), would be a good basis for making a 29.2_2.  Ideally, we could
push these two and then I will create a 29.2_2 set.  From there, I'll
probably focus on improving things for the 30.1 series pre-tests
notwithstanding "show stoppers" with the top-of-stack 29.x binaries.
I can work on (each of) this smaller changes as much as needed, but
I'd like to keep the installer simple while we do. (E.g. defer adding
any new Sections/pages or controls we can live without until Emacs
30.)

As an example of something not addressed by the patch, only the mostly
recently installed Emacs can be uninstalled.  To address that will
require giving each uninstaller a unique name as part of creating it
under the installation target directory.  I'm fairly confident I'll
get that right, but I'm not as confident as I am of the one attached.
Moreover, I would prioritize fixing the issue of (potentially)
deleting several installed versions without mentioning (which, Дилян,
thank you again for reporting that that is happening).

Corwin