microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23k stars 1.43k forks source link

Cannot install anything under user account without administrative permissions #2665

Open AlexDe74 opened 1 year ago

AlexDe74 commented 1 year ago

Brief description of your issue

When installing under an user account without an administrative permissions, any applications requiring an elevated privileges are failed to install with Installer failed with exit code: 1223

Steps to reproduce

  1. create c:\temp and give a full permissions to Users and Administrators of local Windows
  2. set TMP=C:\TEMP
  3. winget install onenote --source msstore
  4. Confirm
  5. Enter an Administrator account password

Installation is failed

Expected behavior

The application can be installed under an user account, when entering an administrative permissions

Actual behavior

Installation is failed with "Windows cannot access c:\temp\winget...\download.exe

The permission analyse shows following: before installing, c:\temp is empty with following permissions:

PS C:\Users\alex> get-acl C:\temp | Format-list

Path : Microsoft.PowerShell.Core\FileSystem::C:\temp Owner : BUILTIN\Administrators Group : WINPC\alex Access : BUILTIN\Administrators Allow FullControl BUILTIN\Users Allow FullControl

After installing (with an error message, described above) c:\temp\winget has the following permissions:

PS C:\Users\alex> get-acl C:\temp\winget | Format-list

Path : Microsoft.PowerShell.Core\FileSystem::C:\temp\winget Owner : WINPC\alex Group : WINPC\alex Access : NT AUTHORITY\SYSTEM Allow 268435456 NT AUTHORITY\SYSTEM Allow FullControl WINPC\alex Allow 268435456 WINPC\alex Allow FullControl

Cancelling of the installation process shows this error

image

Environment

winget --info

Windows Package Manager (Preview) v1.4.2161-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22623.875
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.2161.0
mdanish-kh commented 1 year ago

Admin access to TEMP folder was granted in PR https://github.com/microsoft/winget-cli/pull/2945

Can you please check to see if it's resolved in the latest preview version of WinGet? (aka.ms/getwingetpreview)