-
Notifications
You must be signed in to change notification settings - Fork 900
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
Warn on access denied errors when deleting from lib-bkp during uninstall #263
Comments
Is there a service or something locking the file? |
Can you include the full log please? |
We tend to move the files over to lib-bkp, which allows locked files to go because they are not being deleted. Then when it tries to delete the file, something is still holding a lock on it. Perhaps it would be better to warn in that folder... |
|
Found that you need admin rights to delete the DLL. Didn't notice it earlier since I was in admin PowerShell. When I'm trying to delete the file in Explorer, it shows the dialog asking for permissions, and then remove the file. So, I created
And I call it from uninstall script like so:
It finishes w/o any errors, but then same stuff happens. Choco can't remove the file in lib-bkp, and afterwards I can see the files just like nobody was removing them. It's sooo strange. Here's the full log for this one. |
I almost gave up on getting rid of the error messages, but noticed that the uninstall script doesn't remove Here's my |
I have the exact same problem with a ZIP app containing a read-only file. I get warning during install and uninstall processes, but after the installation is finished, everything seems to be OK. But after uninstall, the read-only file is still present in both lib and lib-bkp. |
@qzo The stop process - how does that work with upgrades? |
Is it possible that the process isn't fully stopped yet, so it's still locking the files. You may want to insert about a second or two of sleep in there to ensure that the process is fully stopped. |
And do a try catch instead of silently continuing, so you can log out any errors that are found, like the process not shutting down. |
But the application process isn't running at all - it can't run before the installation and I also checked it didn't run before uninstall, but I got the warnings anyway. I'm 99 % sure it has to do with the file in question having read-only attribute. The Stop-Process isn't really relevant - I just didn't want upgrade / uninstall to fail due to the application still running. But I just found out uninstall causes the process to close, so maybe it's not necessary after all. |
Good point on read only attributes. Let's file a new issue on that. |
Here you go: #338 |
Looks like this was switched to a warning awhile ago - 217e8fa#diff-03afb4ba12230f0f345a29a934727585R356 |
I'm going to close this one as part of #338 fixes. If this comes back up as not fixed in 0.9.9.9, please feel free to comment and we can reopen. |
It happens after my
chocolateyUninstall.ps1
is finished. I've tried to log handles, didn't find the file there. I can remove it manually after uninstalling is finished.The text was updated successfully, but these errors were encountered: