mirror of
https://github.com/NickeManarin/ScreenToGif.git
synced 2026-04-25 15:15:51 +03:00
[GH-ISSUE #876] Setup fails because the file is locked #682
Labels
No labels
copy cats
duplicated
future feature
pull-request
⬜ Accepted
⬜ Completed
⬜ Help Wanted 💪
⬜ In Progress
⬜ Missing Details
⬜ Pending
⬜ Waiting For Answer ⏳
🆕 feature preview
🔷 Bug 🐛
🔷 Out Of Scope
🔷 Out Of Scope
🔷 Question
🔷Enhancement
🔷Enhancement
🔷Invalid / External
🔷Knowledge Base
🔷Won't Fix
🕑 High
🕑 High
🕑 High
🕕 Medium
🕙 Low
🕛 Critical
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ScreenToGif#682
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KirillOsenkov on GitHub (May 3, 2021).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/876
Originally assigned to: @NickeManarin on GitHub.
I keep my ScreenToGif.exe in my Dropbox folder, and when I updated today the setup failed with this message in the log:
I'm guessing Dropbox takes some kind of a lock on files intermittently so perhaps consider adding a retry a few times?
To help with diagnosing locked files, consider using https://github.com/cklutz/LockCheck (here's a sample of how it's used in MSBuild: https://source.dot.net/#Microsoft.Build.Tasks.Core/LockCheck.cs,726a666e72008c9b)
Thanks again for the fantastic tool!
@NickeManarin commented on GitHub (May 8, 2021):
Looks like that you are using the portable variant, is that right?
The update process calls the installer to run a custom action.
It looks like doable.
Thanks for the feedback and the proposed solution.
@NickeManarin commented on GitHub (May 25, 2021):
The installer will try to copy/remove files multiple (~4).
@KirillOsenkov commented on GitHub (May 27, 2021):
Hmm, I've tried to update to 2.30.1 and got Setup failed again.
Here's the log:
https://gist.github.com/KirillOsenkov/41d202ebb71cab3ed31c6ef8d28b4413
For some reason it tries to access the folder
D:\Dropbox\MS\Tools\ProgramFilesFolder\ScreenToGif, which I don't remember creating.Now it has two files:

I'd saved ScreenToGif.exe to
D:\Dropbox\MS\Tools\ScreenToGif.exeand that's where I'm running it from.But later I did try run ScreenToGif.exe and it started the version 2.30.1 so it must have updated successfully (mostly).
@KirillOsenkov commented on GitHub (May 27, 2021):
Consider also adding more logging, like which process is running (
Process.GetCurrentProcess().MainModule.FileName), etc.@KirillOsenkov commented on GitHub (May 27, 2021):
@NickeManarin commented on GitHub (May 28, 2021):
Ohh, Ok.
I'm going to change my approach.
Thank you for the log.
The installer in
/amode creates that folder when unpacking the files.I just erase it after getting the necessary files from it.
@NickeManarin commented on GitHub (May 29, 2021):
I changed the process, now it waits indefinitely until the process releases the file.
I'm using some simple Ntdll calls.
@KirillOsenkov commented on GitHub (Jun 5, 2021):
Thanks! Out of curiosity, where's the logic that checks for blocking files? I couldn't find it in the repo. Curious which ntdll calls you're using.
@NickeManarin commented on GitHub (Jun 6, 2021):
It's closed source.
I'm using something similar to LockCheck (but way more simple).
It's similar enough that I should add a license info. (I just added now, it will be available with v2.32)
@KirillOsenkov commented on GitHub (Jun 6, 2021):
I'm just intrigued because I don't know of any other solution other than LockCheck, and I don't see how I would simplify it. If you can't share, that's OK, but if you can post a sample I'd be very curious to learn about it.