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
23.38k stars 1.46k forks source link

Installing APPX package from the Store as --scope machine installs to the [system] user only, not as a provisioned AppX Package as it should be #4748

Closed bthorpkt closed 3 months ago

bthorpkt commented 3 months ago

Brief description of your issue

Using PowerShell to orchestrate winget via SCCM (NT\SYSTEM) account I'd expect WinGet to download the AppX package and provision it system wide when the flag to set the scope of system is used. This would give all users access via registration of the app to the package.

Instead, from what I can tell it just installs the appx as the NT\SYSTEM user and gives up.

Steps to reproduce

PowerShell on a system with Winget installed; psexec cmd -i -s to run as system powershell to jump to powershell command prompt

$AppName = "9NTXR16HNW1T" # PowerBI Microsoft Store Edition winget install --exact $AppName --silent --accept-package-agreements --accept-source-agreements --scope machine

Expected behavior

Something similar to downloading the PowerBI AppX Package and doing this: Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath "Microsoft.MicrosoftPowerBIDesktop_2.129.1229.0_x64__8wekyb3d8bbwe.Appx"

Actual behavior

App is not provisioned system wide, nor is it registered to all users of the system past, present or future. May install in the non interactive System account on a machine.

Environment

Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4780
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

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
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

Configuration Manager Current Branch
PowerShell native build for Windows 10 22H2 / Windows 11 23H2
github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

bthorpkt commented 3 months ago

3553 is similar or the same. You can merge?

denelon commented 3 months ago

Duplicate of #3553

microsoft-github-policy-service[bot] commented 3 months ago

Hello @bthorpkt,

We've identified this as a duplicate of another issue or PR that already exists. This specific instance is being closed in favor of the linked issue. Please add your 👍 to the other issue to raise its priority. Thanks for your contribution!

Template: msftbot/duplicate/closed