Subject: Re: bug#72781: Emacs 29 for Windows: Uninstall.exe deletes everything in the same folder as it.

From: Corwin Brust <[email-masked]>
Date: Sat, 24 Aug 2024 10:06:11 -0500

Tags: 72781
Merge: 68756
thank you

On Sat, Aug 24, 2024 at 1:27 AM Eli Zaretskii <[email-masked]> wrote:
>
> > Date: Fri, 23 Aug 2024 22:06:59 +0000
> > From:  Sylvan via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <[email-masked]>
> >
> >
> > Expected behaviour after Step 6:
> > The emacs-29.4 folder and Uninstall.exe are gone, but any other files or folders remain.
> > Actual behaviour after Step 6:
> > All files and folders in your test file are gone.
> >
> > Expected behaviour after Step 7:
> > The test folder made in Step 1 still exists.
> > Actual behaviour after Step 7:
> > The test folder made in Step 1 has been deleted.
> > Upon pressing the back button in Windows Explorer, I received an error message saying
> > "C:\Users\redacted\Downloads\testfolder is unavailable. If the location is on this PC, make sure the device or
> > drive is connected or the disc is inserted, and then try again. If the location is on a network, make sure you're
> > connected to the network or Internet, and then try again. If the location still can't be found, it might have been
> > moved or deleted."
>
> Adding Corwin, who provided the Windows installer.
>

Sylvan,

I believe this is the same problem as reported in bug#68756, hence I
am merging them.  That bug report contains a patch which was tested
(but not installed) back in Feburary, one of three patch-sets for the
Windows installer/uninstaller that have been awaiting my attention far
too long.   I plan to retest these (starting with this one) this
morning with intent to apply as soon as I can confirm they appear to
resolve the (most important, incorrect file deletion) problem;
apologies I wasn't able to resolve this before you were bitten.
Here's a link to the other report, containing the patch to avoid
uninstaller deleting versions other than that from the corresponding
installer:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68756

Are you able to build Emacs locally to test?

I would normally upload a set of binaries incorporating my patches to
my own website to make it easier for others who are not in a position
to compile Emacs for Windows; however, if you plan to build your own
Emacs to test my fixes in this case, I might skip that in name of
moving a little more quickly.  (I have a Windows machine separate from
my "development environment" where I'm able to test myself however
both of these machines are Windows 10 - I don't have anything running
Windows 11 at my disposal.  It would be lovely to get confirmation the
fix works under Windows 11 (although I see no reason it should not).

Eli,

I would like to install this directly to the release branch.  I
believe we had discussed doing so when the release branch was for
Emacs 29 but please tell me if this must go to the development branch,
instead.   As I suspect you are aware, the change here is specifically
to the NSIS script within admin/nt/dist-build and thus cannot affect
other than the installer for Windows.  Moreover, as this issue
potentially causes Emacs to unexpectedly delete files I think it is
rather serious.  If my changes cause further problems I expect to "fix
and fall forward"; so, while I'm confident -existing patch, previously
tested- it's possible this will not be the "one-and-done" I expect.

Please let me know I must apply to the main branch (for Emacs 31), instead.