Open playday3008 opened 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Steps (using my example):
C:\Program Files\WinGet\Packages\zigtools.zls_Microsoft.Winget.Source_8wekyb3d8bbwe
.Security
tab.Advanced
button.Change permissions
button.Replace all child object permission entries with inheritable permission entries from this object
.OK
button.Yes
.OK
button.$winget_machine_package_roots = $(winget --info) -match '^Portable Package Root (?:\(x86\))? +(.+)$'
$winget_machine_package_roots = $winget_machine_package_roots | Select-String '^Portable Package Root (?:\(x86\))? +(.+)$'
$winget_machine_package_roots = $winget_machine_package_roots | ForEach-Object {$_.Matches.Groups[1].Value}
$winget_machine_package_roots | ForEach-Object {
$acl = Get-Acl $_
$acl.SetAccessRuleProtection($true, $true)
Get-ChildItem -Path $_ -Directory | ForEach-Object {
Set-Acl -Path $_.FullName -AclObject $acl
}
}
Brief description of your issue
Using
zigtools.zls
as an example. Folder where winget unpacks files itself have correct permissions, but all files inside that folder, doesn't. Files and folders inside will incorrectly inherit (or do not inherit at all, IDK) permissions.That will cause for non admin users inability to access/use anything what was installed in “machine” scope, which breaks whole purpose of installing machine-wide
Steps to reproduce
winget install --scope machine -e --id zigtools.zls
Expected behavior
Full permission inheritance (achieved manually by disabling and enabling back inheritance):![image](https://github.com/microsoft/winget-cli/assets/18056374/c7acbc0e-833f-402f-b745-47ffea64e9ed)
Actual behavior
Partial permission inheritance:![image](https://github.com/microsoft/winget-cli/assets/18056374/f315acd6-e622-4733-bd06-b029fa62c5fd)
Environment