Unexplained effect when deleting a file

This has happened to me before, but the first time I ignored it as finger trouble. I had upgraded from V1.4.0 to V1.5.0 (not necessarily significant). The Chia GUI is running on Windows 11. It’s farming and the CLI is plotting with madmax. All sync’d up and working.
In Windows File explorer I come across the previous V1.4.0 .exe installation file. Thinking it’s no longer needed I attempt to delete it (Shift+Del). A warning message appears: Can’t delete as the program (or something) is running. I click “Cancel”.
The GUI on the screen disappears. All the application files are deleted. Fortunately not the directory where all the database and wallet stuff are stored. (And no apparant corruption)
It’s as if I had tried to run the file rather than delete it. I then successfully did delete the old installation file and reinstalled V 1.5.0.
So no harm done, but a bit scary when the unexpected happens.
Anyone else experienced this?

You’re likely telling windows to uninstall the chia application. Every version upgrade uses the same .chia folder. So when you tell windows to uninstall Chia 1.4, it will likely remove the .chia folder. Thereby uninstalling your latest Chia install (1.5 in this case).

1 Like

Except Windows doesn’t, every time I’ve uninstalled Chia it’s left all the folders behind, including the two in the appdata folders, and I have to manually delete them.

Possibly some other software running that uninstalls it?

Virtually every app these days is using a separate binary and user data folders. When you upgrade, the data folder is either not touched, or only needed modifications are done, and Chia is no exception. So, .chia folder is never deleted (only config.yaml, etc. may be modified, still not deleted).

The program folder is removed during the installation, but not at root, but rather at version branch. Although, if you run some CLI directly from that folder, or Chia did not exit properly, there will be locks on some of those files, and some manual action usually after a reboot will be required.

As Chia is rather crap at exiting cleanly, the best way to have a smooth upgrade is to stop the old version, and then reboot. This should kill all the eventually running processes and remove locks that prevent some of those files to be deleted. This is also making sure that the start_node process is not sitting on the bc db, thus making db corruption less of a case.

It seems to leave only the previous version behind from my experience, and even that folder is laregly empty with a ‘dead’ marker in there.

I always use Process Explorer from Sysinternals to check if all the processes have exited, if not just kill them if they are hanging around.

Yes, I think you are correct. The only explanation is that I must have inadvertently double clicked on the old .exe filename, which started it to run, then did the delete, which brought up the message about it being in use. So, must be careful in future when deleting the old .exe files.