Fix E_ACCESSDENIED during download if temp is hidden#40708
Open
chemwolf6922 wants to merge 7 commits into
Open
Fix E_ACCESSDENIED during download if temp is hidden#40708chemwolf6922 wants to merge 7 commits into
chemwolf6922 wants to merge 7 commits into
Conversation
…ownloading-to-hidden-temp
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses E_ACCESSDENIED failures during wsl --update / wsl --install downloads when the user’s temp directory has the Hidden/System attributes set, by switching WinRT file operations to a newly-created temp subfolder with those attributes cleared.
Changes:
- Refactors the existing modern distro install unit test logic into a helper so it can be reused by multiple test cases.
- Adds a new unit test that exercises modern distro installation when the temp folder is hidden.
- Updates the WinRT download path selection to use a
wsl-downloadssubfolder under%TEMP%, explicitly clearing Hidden/System attributes before callingStorageFolder::GetFolderFromPathAsync.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/windows/UnitTests.cpp | Refactors the ModernDistroInstall test and adds a regression test for hidden temp folders. |
| src/windows/common/wslutil.cpp | Routes WinRT-based downloads through a temp subfolder with Hidden/System attributes cleared. |
benhillis
reviewed
Jun 4, 2026
benhillis
reviewed
Jun 4, 2026
Member
benhillis
left a comment
There was a problem hiding this comment.
Looks good maybe just drop the set when it is not needed.
…ownloading-to-hidden-temp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
The
winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsyncfunction does not accept folders with hidden or system attributes. To solve that, this PR creates a sub folder under temp without those attributes and use that for the winrt functions.PR Checklist
wsl --updateto update WSL, nor usewsl --installto install a Linux distribution #40662Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Add test UnitTests::UnitTests::ModernDistroInstallWithHiddenTempFolder