Skip to content

if winget-cli is installed from unelevated terminal with scope currentuser, necessary license is not installed #6212

@tps800

Description

@tps800

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-InstallIssue related to WinGet InstallIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-TriageIssue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions