microsoft / microsoft/winget-cli
if winget-cli is installed from unelevated terminal with scope currentuser, necessary license is not installed
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Relevant area(s)
WinGet CLI
Relevant command(s)
winget install
Brief description of your issue
Install winget-cli from an unelevated PowerShell commandline with scope CurrentUser.
The installer will install all necessary dependencies, then winget-cli.
It then reports success.
But executing winget from a commandline just tells it is not executable.
Steps to reproduce
Install winget-cli from an unelevated PowerShell commandline with scope CurrentUser.
The installer will install all necessary dependencies, then winget-cli.
It then reports success.
Now trying to execute winget.exe windows only tells it cant execute winget.exe. Looking where the installer installed winget.exe there are two locations:
%LOCALAPPDATA%\Microsoft\WindowsApps\winget.exe
%LOCALAPPDATA%\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\winget.exe
Both binaries are length 0 and seem to be links to a real binary:
winget.exe -> '/c/Program Files/WindowsApps/Microsoft.DesktopAppInstaller_1.29.160.0_x64__8wekyb3d8bbwe/winget.exe'*
Now trying to repair this install with Repair-WinGetPackageManager -Force -Verbose gives:
PS[5.1.17763.316] Repair-WinGetPackageManager -Force -Verbose
AUSFÜHRLICH: Creating MTA thread
AUSFÜHRLICH: Running winget.exe with --version
AUSFÜHRLICH: 'winget.exe' Win32Exception Es wurden keine anwendbaren App-Lizenzen gefunden
AUSFÜHRLICH: Fehler beim Ausführen des Programms "winget.exe": Es wurden keine anwendbaren App-Lizenzen gefunden.
AUSFÜHRLICH: Integrity category type: AppInstallerNoLicense
Repair-WinGetPackageManager : Failed to repair winget. Try running with -AllUsers in administrator mode.
In Zeile:1 Zeichen:1
+ Repair-WinGetPackageManager -Force -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Repair-WinGetPackageManager], WinGetRepairException
+ FullyQualifiedErrorId : RuntimeException,Microsoft.WinGet.Client.Commands.RepairWinGetPackageManagerCmdlet
The mentioned missing license is not installed at all. Trying to install it just tells lack of missing rights to add a license.
Expected behavior
The installer should install winget-cli within scope CurrenUser without any hassles and without missing licenses if it reports success.
Actual behavior
The installer seems to install winget-cli with missing files but reports success -- even if this application is unusable afterwards.
Environment
> winget --info
Das angegebene Programm kann nicht ausgeführt werden.
> ver
Microsoft Windows [Version 10.0.17763.316]
PS[5.1.17763.316] Get-InstalledModule
Version Name Repository Description
------- ---- ---------- -----------
1.12.440 Microsoft.WinGet.Client PSGallery PowerShell Module for the Windows Package Manager Client.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the unelevated PowerShell winget install with --scope CurrentUser, then run Repair-WinGetPackageManager -Force -Verbose and winget --info as shown. Trace the current-user installation and license handling; done means the installer reports success only when the license is present and winget.exe runs successfully afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, powershell
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100