microsoft / microsoft/winget-cli

Permission Denied when installed via --scope machine

Open
#4,172 9 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Install Issue-Bug Portable
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

Tried installing zoxide via winget install --scope machine ajeetdsouza.zoxide via PowerShell and git-bash.
Both resulted in this error bash: /c/Program Files/WinGet/Links/zoxide: Permission denied when run by another non admin user.

image
If i manually add the Users principal here it works.

Steps to reproduce
  1. Open a Admin Windows Terminal or use an Admin Account
  2. Run winget install --scope machine ajeetdsouza.zoxide via PowerShell or git-bash
  3. Open a non admin Windows Terminal on a non Admin Account
  4. Try to run zoxide via PowerShell or git-bash
Expected behavior

The package installed via scope should be runnable by all users

Actual behavior

in git-bash:

bash: /c/Program Files/WinGet/Links/zoxide: Permission denied

in PowerShell

PS C:\WINDOWS\system32> zoxide
Fehler beim Ausführen des Programms "zoxide.exe": Der angegebenen Datei ist keine Anwendung zugeordnetIn Zeile:1
Zeichen:1
+ zoxide
+ ~~~~~~.
In Zeile:1 Zeichen:1
+ zoxide
+ ~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
Environment
Windows-Paket-Manager v1.6.3482
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.

Windows: Windows.Desktop v10.0.22631.3155
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.21.3482.0

WinGet-Verzeichnisse
-----------------------------------------------------------------------------------------------------------------------------------------
Protokolle                                   %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Benutzereinstellungen                        %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Verzeichnis für portierbare Links (Benutzer) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portables Linkverzeichnis (Computer)         C:\Program Files\WinGet\Links
Portierbarer Paketstamm (Benutzer)           %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portierbarer Paketstamm                      C:\Program Files\WinGet\Packages
Portierbares Paketstamm (x86)                C:\Program Files (x86)\WinGet\Packages
Installationsprogrammdownloads               D:\Users\Arbeit\Downloads

Links
-----------------------------------------------------------------------------------------
Datenschutzerklärung              https://aka.ms/winget-privacy
Lizenzvereinbarung                https://aka.ms/winget-license
Hinweise von Drittanbietern       https://aka.ms/winget-3rdPartyNotice
Startseite                        https://aka.ms/winget
Windows Store-Nutzungsbedingungen https://www.microsoft.com/en-us/storedocs/terms-of-sale

Administratoreinstellung                  Status
-----------------------------------------------------
LocalManifestFiles                        Deaktiviert
BypassCertificatePinningForMicrosoftStore Deaktiviert
InstallerHashOverride                     Deaktiviert
LocalArchiveMalwareScanOverride           Deaktiviert

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing winget install --scope machine ajeetdsouza.zoxide as an administrator, then inspect access permissions for C:\Program Files\WinGet\Links and the installed portable package as a non-admin user. Done means the installed zoxide command runs successfully for another non-admin user in both PowerShell and git-bash.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, cpp, powershell
Domain
cli, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.