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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use copy instead of rename for moving extracted archive directories #3003

Merged
merged 9 commits into from Mar 14, 2023

Conversation

ryfu-msft
Copy link
Contributor

@ryfu-msft ryfu-msft commented Feb 22, 2023

Fixes #2931

Special thanks to @farag2 for the extremely thorough investigation on this one. 馃槃

Issue:
When specifying a specific --location that points to a different drive, the installation fails with an access denied error. The issue is caused when trying to rename a directory across a different drive which isn't supported as rename is not a "move/copy" operation. The correct way to handle moving directories is to explicitly copy the directory recursively over to the intended install location.

Changes:
Replaced Rename with Copy operation for directory file types during archiveinstallation.

Tests:
Verified that the following command identified from the issue bug successfully installed. All existing tests should continue to pass.
winget install --id=TeamSophia.SophiApp --exact --accept-source-agreements --location "D:\test"

Microsoft Reviewers: Open in CodeFlow

@ryfu-msft ryfu-msft requested a review from a team as a code owner February 22, 2023 19:44
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Feb 22, 2023
@ryfu-msft ryfu-msft merged commit 8eb1228 into microsoft:master Mar 14, 2023
8 checks passed
@ryfu-msft ryfu-msft deleted the renameFilesystemBug branch March 14, 2023 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
3 participants