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
22.5k stars 1.39k forks source link

where are windows server 2022 installation instructions? #4502

Open greyltc opened 1 month ago

greyltc commented 1 month ago

Hi. The readme says:

https://github.com/microsoft/winget-cli/blob/f1ae1267c330f7ec463a58fc6c7b0e2ea6f44a16/README.md?plain=1#L16

I'm glad to hear that installation on windows server 2022 "may be possible." What steps should I take to test if it's possible for me?

greyltc commented 1 month ago

After doing some more searching, I think this issue is a duplicate of https://github.com/microsoft/winget-cli/issues/438 which has seemingly been closed as a "won't fix" if I understand correctly (issue marked closed & docs are non-existent).

I think it's a bit strange to dangle the possibility of installation on windows server 2022 in the readme, then make it a secret out of how to actually do it.

denelon commented 1 month ago

There are a couple of different options. Users should also be aware that WinGet distributed through the App Installer is considered a Windows System component which means once it's been added to Windows Server 2022, removal is not supported.

One method is the instructions at Microsoft Learn for bootstrapping WinGet in the Windows Sandbox. The other method is using the Repair-WinGetPackageManager PowerShell cmdlet inside the Microsoft.WinGet.Client PowerShell module.

$progressPreference = 'silentlyContinue'
Write-Information "Downloading WinGet and its dependencies..."
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
tristanbarcelon commented 3 days ago

Hi @denelon I followed your suggestion above and received an error about missing license.

image