microsoft / microsoft/winget-cli

Standard user cannot use globally installed zipped portable package installed by another user

Open
#2,993 5 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

When a zipped portable package is installed with --scope machine, only the user installed that package is granted access to the extracted folder. however unlike the parent, it does not have the "Users" group granted.

This resulting standard users cannot use these packages:

PS C:\> & "C:\Program Files\WinGet\Links\rclone.exe"
ResourceUnavailable: Program 'rclone.exe' failed to run: An error occurred trying to start process 'C:\Program Files\WinGet\Links\rclone.exe' with working directory 'C:\'. No application is associated with the specified file for this operation.At line:1 char:1
+ & "C:\Program Files\WinGet\Links\rclone.exe"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
PS C:\> Get-ChildItem -Path "C:\Program Files\WinGet\Packages\Rclone.Rclone_Microsoft.Winget.Source_8wekyb3d8bbwe\rclone-v1.61.1-windows-amd64\"
Get-ChildItem: Access to the path 'C:\Program Files\WinGet\Packages\Rclone.Rclone_Microsoft.Winget.Source_8wekyb3d8bbwe\rclone-v1.61.1-windows-amd64' is denied.
Steps to reproduce
  1. Create an administrator account.
  2. Login to that account, open the terminal with "Terminal (Admin)" option in Start button context menu.
  3. Install a zipped portable package (e.g. winget install --scope machine Rclone.Rclone) in that terminal.
  4. Login back to the original account, open another terminal with "Terminal" option in Start button context menu.
  5. Run the installed package (e.g. & "C:\Program Files\WinGet\Links\rclone.exe").
Expected behavior

The installed package should run in step 5.

Actual behavior

Got the ResourceUnavailable error instead.

Environment
PS C:\> winget --info
Windows Package Manager (Preview) v1.5.441-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1265
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.441.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

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

Reproduce the issue using the documented winget install --scope machine Rclone.Rclone command, then inspect access to the extracted package under C:\Program Files\WinGet\Packages and its link under C:\Program Files\WinGet\Links. Done means a standard user can run the globally installed zipped portable package after another user installs it with machine scope.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.