Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0x80070091 - Error deleting directory: C:\Users\UserName\AppData\Local\Temp\{GUID}: The directory is not empty. #88

Open
icnocop opened this issue Jun 4, 2015 · 3 comments
Assignees

Comments

@icnocop
Copy link
Collaborator

icnocop commented Jun 4, 2015

Sometimes when the dotNetInstaller setup bootstrapper terminates, an error message similar to the following is displayed:

[Setup Title]
0x80070091 - Error deleting directory: C:\Users\UserName\AppData\Local\Temp\{5D6ADB09-8C3A-4E67-A987-E4200838CF54}: The directory is not empty.
[OK]

The dotNetInstallerLog.txt indicates messages similar to the following:

2015-06-03 15:19:49 All required components installed: yes
2015-06-03 15:19:49 All optional components installed: yes
2015-06-03 15:19:49 All checked components installed: yes
2015-06-03 15:19:49 --- Complete Command
2015-06-03 15:19:49 Deleting CAB folder: C:\Users\UserName\AppData\Local\Temp\{5D6ADB09-8C3A-4E67-A987-E4200838CF54}
2015-06-03 15:19:49 Error terminating dotNetInstaller: 0x80070091 - Error deleting directory: C:\Users\UserName\AppData\Local\Temp\{5D6ADB09-8C3A-4E67-A987-E4200838CF54}: The directory is not empty.

I have verified that the directory is empty and it can be deleted manually.

I expect the dotNetInstaller setup bootstrapper to retry deleting the directory after a little delay in case there's an open handle to the directory that hasn't quite closed yet.

@icnocop icnocop self-assigned this Jun 4, 2015
@dblock
Copy link
Collaborator

dblock commented Jun 4, 2015

I don't think the problem is an unclosed handle. There's something in that directory while DNI is terminating, possibly a running setup or something like that. Retrying seems optimistic, you should be able to resolve this fully, just track down what that something is?

@icnocop
Copy link
Collaborator Author

icnocop commented Jun 10, 2015

It seems that this is caused by Windows Defender.
It only happens once in a while, until I disable Windows Defender in Windows 10 Pro Preview x86, and then I don't get this error message.
Windows Defender is enabled by default in Windows 10.
For reference, this is how to permanently disable Windows Defender in Windows 10: http://www.tenforums.com/antivirus-firewalls-system-security/5879-permanently-disable-windows-defender.html#post234396.

I'm sure it could happen with other anti-virus solutions.
Here is a thread from a different project reporting a similar issue caused by ESET Anti-Virus for example: isaacs/rimraf#25 (comment)

In order to try and troubleshoot the issue, I tried to enumerate and find all open handles on the directory and get the name of the process by using and slightly modifying the code from here:
http://www.codeguru.com/cpp/w-p/system/processesmodules/article.php/c2827/Examine-Information-on-Windows-NT-System-Level-Primitives.htm
But it wasn't able to find any open handles for that directory.

I can't seem to enable verbose logging in Windows Defender to see if it outputs any information about scanning the directory around the time we are trying to delete it.

Any ideas?

Should I just reapply the retry logic, or is there a better solution?

For example, should the retry logic behavior and its parameters be exposed as optional attributes in the dotNetInstaller xml configuration file?
For example, retry_delete_directory="false" retry_delete_directory_maximum_retries="10" retry_delete_directory_wait_between_retries="100'

Or maybe the message box that is displayed should have Retry and Continue buttons?

Thank you.

@dblock
Copy link
Collaborator

dblock commented Jun 11, 2015

I would be down for a feature that retries a maximum amount of times with settings. I would hard-code a second wait time or something instead of giving people the opportunity to put endlessly long times in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants