-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix issues updating Windows binaries on non-C: drives. #69
Conversation
@t-mw after this change, running the example on my windows machine is giving me a permissions error
Any ideas? |
Looks like it's failing on the |
interestingly, it works if I revert only the first copy back to a rename |
seems like the removal of |
Sorry, I see the same error and thought I'd fixed it after testing with my own project. Reverting to rename is fine, but it prevents the temporary file from being cleaned up. I think |
released in 0.25.0 |
Thanks. Not ideal that those temp folders build up on Windows now. Reading around it seems like the only way to avoid that is to delete them when the updated executable runs. I could work on that if that sounds ok. |
Fixes #67.
I'm not sure why
TEMP
is required on Windows, but it might've been to force the temp file to be cleaned up by the OS. Thetempfile
crate should have been doing this even outside theTEMP
directory, but couldn't because the running executable was still referencing the temp file at the time thattempfile::TempDir
was dropped. I've tested on Windows and this PR seems to fix those issues, andfs::rename(self.source, dest);
still works when overwriting the file of the running executable.