-
Notifications
You must be signed in to change notification settings - Fork 81
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
Clean up temp files from installer download #56
Conversation
Looks like we have a bug, in DownloadFileAsync, if the file already exists, but with a different length, we download the new one, but looks like that doesn't replace the old one, it just writes overwrites it. Meaning, if the previous one is larger, we'll download a smaller one and write those bytes over the old one, creating a bogus file. The fix is simple, and I think sufficient to protect us here, add a File.Delete:
What do you think? |
100% agree. This is a much better solution. I added your suggested changes and removed mine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this pull request ensure that the temp files from the downloaded installer are deleted before the end of the command execution. This should fix #40, where the installer hash does not match due to old installer files not being cleaned up from the %TEMP% directory.
Microsoft Reviewers: Open in CodeFlow