HOWTO install ‘winget’ from command line

Sometimes we might need to use the amazing ‘winget’ command where it isn’t available (for example from a Windows Sandbox, …).

The few steps below will solve this problem.

The installation process

To install ‘winget’ command, you will need to download C++ Runtime framework packages for Desktop Bridge from MS, selecting the proper package (x86, x64, …) from the ‘How to install and update Desktop Framework packages’ section.

    • current x64 package link: https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx
    • current x86 package link: https://aka.ms/Microsoft.VCLibs.x86.14.00.Desktop.appx

Then download ‘Microsoft.UI.Xaml’ framework, following these steps:

    • go to https://www.nuget.org,
    • look for ‘Microsoft.UI.Xaml‘,
    • click on ‘Microsoft.UI.Xaml‘,
    • click ‘Download Package’ on the right side,
    • if needed, rename the downloaded .nupkg file as .zip, and extract the proper .appx package from one of the folders below:
      • x64 package: .\tools\AppX\x64\Release\
      • x86 package: .\tools\Appx\x86\Release\

Then download ‘winget’ client package from its Github repository.

    • current package link: https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

Open a PowerShell Prompt with administrative rights in the folder where you saved the files and:

    • install Desktop Framework package by typing:
      Add-AppxPackage <downloaded file name: Microsoft.VCLibs…>.appx
    • install UI.Xaml Framework package by typing:
      Add-AppxPackage <downloaded file name: Microsoft.UI.Xaml…>.appx
    • finally install ‘winget’ client package by typing:
      Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

It’s done.