FileSystemWatcher, strange answer

I created a FileSystemWatcher (as a Windows service) to watch plugins uninstall in a directory (as ZIP files), so I can automatically unzip them, set some registry keys, and install them in my application. This works great.

I also have a FileSystemWatcher that wants to see when the ZIP file is deleted, so I can uninstall the installation, delete registry keys, etc. This works great too ... except for one catch.

When I do the delete, the file is completely deleted, but it looks like another ZIP file has been added, but it has a really weird name. Also, the contents in the registry are the same as the file I just deleted. Here's an example:

Install
-------
File: Example.zip
Extracts to: C:\Plugins\Example\*.*
Registry Key: HKLM\Software\MySoftware\Plugins\Example\[keys]

Delete
------
File: Example.zip
Directory Deletes
Registry Deletes
Creation of Folder: C:\Plugins\ER\S-1-52359402-2823975235\202\*.* where the files are the same as Example.zip files.
Registry Key: HKLM\Software\MySoftware\Plugins\ER\S-1-52359402-2823975235\202\[keys] where the keys are the same as Example.zip's.

      

Those last two steps don't have to happen. I'm really confused about what's going on here. Is it a virus scanner that does this? Any help would be much appreciated.

Update: In response to one answer from Jon Skeet, it looks like it's a rework issue causing this issue (I'm looking at subdirectories). Is there a way to consistently ignore these directories (hidden trash bin? Anything else?).

+2


source to share


1 answer


Could it be a basket? How do you delete the file? If you do it manually from Explorer, is there a difference between "normal" selection and deletion and the "delete at once" behavior of Shift + Delete?



+2


source







All Articles