แก้ไข

แชร์ผ่าน


Using WinGet to Install Apps on Windows IoT Enterprise

The WinGet command line tool enables users to discover, install, upgrade, remove and configure applications on Windows 10 and Windows 11 devices. This tool is the client interface to the Windows Package Manager service.

In this tutorial, you learn how to install and utilize WinGet on Windows IoT Enterprise. This guide is useful for Windows IoT Enterprise LTSC versions as they don't support the Microsoft Store application itself, which is commonly used to install WinGet. The documentation is all tested on Windows 10 IoT Enterprise LTSC 2021.

Download WinGet

  1. Download WinGet bundle files from WinGet CLI Repo Releases.

    1. Choose the latest version that isn't "Prerelease" (It should have the Latest tag.)

    2. In my case, this version is version 1.4.10173
      Release screenshot

  2. Download the msixbundle file and the License1.xml file.

  3. Download the VCLibs Desktop framework package associated with your processor architecture.

    For more information, see How to install and update Desktop framework packages

  4. WinGet CLI has a dependency on Microsoft.UI.Xaml.2.8.

    1. Download the Microsoft.UI.Xaml.2.8 NuGet package from Microsoft UI NuGet Org. The download link is located on the right side at Download Package.

    2. Change the file extension from .nupkg to .zip. To change the file extension, Open Command Prompt, navigate to the directory where the nupkg file was downloaded and run the following command to rename the file:

    ren Microsoft.UI.Xaml.2.8.6.nupkg Microsoft.UI.Xaml.2.8.6.zip
    

    Note

    The latest version of Microsoft.UI.Xaml was 2.8.6 at time of this article. Replace the version 2.8.6 in the above command with the latest version downloaded from the Microsoft UI Xaml NuGet gallery.

    1. Open the .zip folder renamed in the previous step using File Explorer and copy the file tools\AppX\<your architecture>\release\Microsoft.UI.Xaml.2.8.appx to your downloads folder. This file will be installed to your device in a future step.
      1. For more information about working with .zip files, see zipping and unzipping files.

Install WinGet Client

  1. Launch PowerShell as Administrator

  2. Install the Desktop Framework Package using the PowerShell command Add-AppxPackage.

    Add-AppxPackage -Path <path to VCLibs .appx file>
    

    Where

    • <path to VCLibs .appx file> is the fully qualified path to the VC++ v14 Desktop Framework Package you downloaded earlier.
  3. Install Microsoft UI Xaml using the PowerShell command Add-AppxPackage.

    Add-AppxPackage -Path <path to UI xaml.appx file>
    

    Where

    • <path to UI xaml.appx file> is the fully qualified path to the Microsoft UI Xaml 2.8.6 package you downloaded earlier.

    Caution

    Without the VCLibs and UI Xaml dependencies installed, the WinGet installer fails (without any error/warning messages). Specifically, the "winget.exe" file isn't added to "C:\Users\[Username]\AppData\Local\Microsoft\WindowsApps"

  4. Install the WinGet client using the PowerShell command Add-AppxPackage.

    Add-AppxPackage -Path <path to .msixbundle file>
    

    Where

    • <path to .msixbundle file> is the fully qualified path to the WinGet bundle file you downloaded earlier.
  5. Configure the WinGet client with the correct license file using the PowerShell command Add-AppxProvisionedPackage

    Add-AppxProvisionedPackage -Online -PackagePath <path to .msixbundle file> -LicensePath <path to xml file>
    

    Where

    • <path to .msixbundle file> is the fully qualified path to the WinGet bundle file
    • <path to xml file> is the fully qualified path to the License1.xml file you downloaded earlier.

    All the commands ran

Now, you should see the winget.exe file appear at C:\Users\[Username]\AppData\Local\Microsoft\WindowsApps. Furthermore, it should also be automatically added to your path. You should also be able to use WinGet in the PowerShell terminal.
WinGet in powershell

Tip

If the winget command is not recognized in PowerShell, try restarting PowerShell first, and if unsuccessful again, try restarting your computer.

Install Applications with WinGet

  1. First, search the WinGet repository for the application you want to install. For example, to search for the 'Windows Camera' application, use the search command:

    winget search "Windows Camera"
    
  2. Next, learn more about the application with the show command:

    winget show "Windows Camera"
    
  3. Next, install the application with the install command:

    winget install "Windows Camera"
    
  4. For more detail on how to search, install, configure, and uninstall applications with WinGet, see Use WinGet.

Note

These instructions are adapted from the original WinGet documentation targeting Windows desktop editions for Windows IoT Enterprise LTSC which does not have a Windows Store user experience. These instructions also incorporate guidance Zamiell's WinGet CLI repository discussion and from MuradBuyukasik's WinGet Scripts repository.

More Resources