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

UnauthorizedAccessException updating file #35

Closed
tverona opened this issue Jan 25, 2013 · 4 comments
Closed

UnauthorizedAccessException updating file #35

tverona opened this issue Jan 25, 2013 · 4 comments
Assignees
Labels
Milestone

Comments

@tverona
Copy link

tverona commented Jan 25, 2013

Hi, I hit the following error:
Debug Creating Temp directory C:\Users\Tomer\AppData\Local\Temp\149a22f3-9195-4577-aab9-43f79a89c9d0
Debug FileUpdateTask: Downloading foo.exe with BaseUrl of http://localhost:8888 to C:\Users\Tomer\AppData\Local\Temp\149a22f3-9195-
Debug FileUpdateTask: Prepared successfully; destination file: C:\Users\Tomer\bar\foo.exe
Debug Starting to process cold updates...
Debug Update process name: 'NAppUpdateProcess'
Debug Loading C:\Users\Tomer\AppData\Local\Temp\149a22f3-9195-4577-aab9-43f79a89c9d0\foo.exe
Debug Skipping (part of current execution)
Debug Loading C:\Users\Tomer\AppData\Local\Temp\149a22f3-9195-4577-aab9-43f79a89c9d0\NAppUpdate.Framework.dll
Debug Skipping (part of current execution)
Debug The application has terminated (as expected)
Debug Got 1 task objects
Debug Task "": RequiresAppRestart
Debug Executing...
Error
Could not replace the file
System.UnauthorizedAccessException: Access to the path 'C:\Users\Tomer\bar\foo.exe' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Delete(String path)
at NAppUpdate.Framework.Tasks.FileUpdateTask.Execute(Boolean coldRun)
Debug Task execution failed
Error Update failed
Debug Re-launching process C:\Users\Tomer\bar\foo.exe with working dir C:\Users\Tomer\bar

I am using the latest sources from github.

Thanks,
Tomer

@synhershko
Copy link
Owner

I think this is related to the IPC stuff I'm mid-way fixing. Try using the latest sources, I just pushed a partial fix.

@robinwassen
Copy link
Collaborator

The problem seems to be when updater is faster to try to replace files than the OS is to release locks on the files after the mutex has been released.

I have proposed a fix in #86

@robinwassen robinwassen added this to the 0.5.1.0 milestone Jul 5, 2016
@robinwassen
Copy link
Collaborator

This fix has been merged and will be released in 0.5.1.0

@synhershko
Copy link
Owner

Awesome, looks great! Thanks!

@robinwassen robinwassen self-assigned this Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants