(#46) Fix issues when lock files are attempted to be written in restricted directories #47
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.
Description Of Changes
THe changes in this PR are related to the changes that was made in 3.4.1.
Among these changes it corrects the location to write lock files to when a package gets extracted. It was incorrectly using the directory of a nupkg file, which caused issues when the file gets downloaded to this location as NuGet.Client attempts to clean out the directory first, which would cause a process denied exception due to the lock file being there.
Additionally, the use of the BasePath in the ConcurrentUtility has also been fixed by not using the Property that may cause an exception to occur when it is set to a restricted directory, and instead use the field that have no additional logic behind it.
Motivation and Context
To fix non-admins not being able download packages, and to fix the bug in 3.4.1 that causes certain installation operations to fail due to the incorrect folder being used for lock files.
Testing
choco config set cacheLocation "$env:ChocolateyInstall\choco-cache"
choco install pester --version 5.3.0
(or a lower version if 5.3.0 is latest on your sources)choco upgrade pester
choco uninstall pester
$env:ChocolateyInstall\choco-cache\ChocolateyScratch
choco dowload pester --version 5.3.0
(or a lower version if 5.3.0 is latest on your sources)choco download pester --force
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #46