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

From: Sylvan <[email-masked]>
Date: Fri, 23 Aug 2024 22:06:59 +0000

Hello! I've encountered an issue with the uninstaller for Emacs 29 for Windows.

Description:
When using Uninstall.exe, which is provided by the installation wizard, all files/folders in its folder are deleted. I would expect Uninstall.exe to only delete the emacs-29.something folder and itself.
When I encountered the bug with Emacs 29.1_2, Uninstall.exe was in my home directory, and deleted all its contents but not my home directory itself. When I tested Emacs 29.4 to see if the bug was still present, I installed Emacs 29.4 into a test folder (containing a test file). This time, the uninstaller deleted the test folder it was in
There is a reddit thread from January 2023 about this issue, with some comments from March and July this year reporting the same thing: https://reddit.com/r/emacs/comments/10ickog/tried_to_uninstall_emacs_destruction_happened/

Emacs version information:
Emacs 29.1_2 and 29.4 for Windows, as installed with emacs-29.x-installer.exe (I have not tested other versions of Emacs 29.x or installation methods).

System information:
Edition: Windows 11 Home
Version: 22H2
OS build: 22621.4037
System type: 64-bit operating system, x64-based processor

Steps to reproduce (with Emacs 29.4):
1. Create a new folder somewhere within your home directory (I haven't tested outside of it).
2. Within this folder, create a test file and/or folder, which will eventually be deleted by the uninstaller.
3. Download emacs-29.4-installer.exe from https://ftp.gnu.org/gnu/emacs/windows/emacs-29/
4. Go through the setup wizard. When choosing the install location, save it in the folder you made in step 1.
5. Allow Emacs to install. In your step 1 folder, you should now have:
- A folder named emacs-29.4
- Uninstall.exe
- Any test files and folders you added
6. Run Uninstall.exe (just by double-clicking the file and pressing Uninstall)
7. Go up one folder.

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."

Yours faithfully,
Sylvan (they/them)