Latest update

6/recent/ticker-posts

Install Winget in Windows Server 2022 – No applicable app licenses error

Winget is a great new utility from Microsoft that brings us the native command-line software install/update functionality that we have been envious of every time we configure software on a Linux server. If you want to learn more about winget itself and the installation of winget in Windows 10, take a look at my post – Install Winget 1.0 Windows 10 and upgrade all software. In working with Windows Server 2022 a lot in the lab lately, installing software, etc, I wanted to see what the process looks like to install winget in Windows Server 2022. To my disappointment, it isn’t as easy as the process in Windows 10. Let’s take a look at how to install Winget in Windows Server 2022 – no applicable app licenses error to see the hurdles I ran into and how you can get winget installed in Windows Server 2022.

Winget not really for Windows Server yet

A harsh reality hit me when attempting to install winget in Windows Server 2022 that I had realized before attempting the install. Winget is not really for Windows Server, at least not yet. The reason for this is that Windows Server SKUs don’t ship with the Store client enabled. Take note of this comment from the Github page I will be highlighting a bit more below. This comes from @denelon who’s profile shows to work on Windows Package Manager:

Currently, the Windows server SKUs don’t ship with the Microsoft Store client enabled. This creates challenges for updating applications delivered by the Microsoft Store. As the Windows Package Manager ships as a part of the Desktop App Installer, and that is also not generally default on server SKUs, we don’t yet have a solid delivery mechanism nor an update mechanism in place today.

We have already started looking at the next evolution for the Store For Business. The future integration with Intune is part of the story as we work towards support across our entire product portfolio.

So, the TLDR is:
  • No Windows store in Windows Server so winget doesn’t work

However, I wanted to see what happens when you try to install winget just using the normal means. The short story is you will receive an error. Let’s see how to fix it.

Install Winget in Windows Server 2022 – No applicable app licenses

First, we will take a look at the error message received when simply trying to install winget in Windows Server 2022 as you would in Windows 10. The overall process to work around the errors installing winget in Windows Server 2022 involves:

  1. Installing the VCLib package requirement
  2. Download the license file for Windows Package Manager
  3. Download Winget MSIXbundle file
  4. Install winget using the MSIXbundle package and license file

The error when installing winget

If you download the MSIXbundle file the same as in Windows 10, you will find that you can’t just double-click the file and have it install in Windows Server 2022 due to no store availability in Windows Server. However, we can use the Add-AppxPackage PowerShell cmdlet to install the MSIXbundle file.

What happens? If you try to directly install the MSIXbundle in Windows Server 2022, you will receive this error:

Installing the MSXI bundle for winget directly in Windows Server 2022
Installing the MSXI bundle for winget directly in Windows Server 2022

So we have a prerequisite package that needs to be installed. How do we get this?

1. Installing the VCLib package requirement

A blog post I hit when Googling around for installing winget in Windows Server 2022 is the following:

On this blog, there are two scripts, one for installing VCLib and the other for installing winget. I tried using both together and winget installs with the same license error we will see below. With the script for installing the VCLibs from this blog, I was able to get the prerequisite for this package installed successfully.

Installing the VCLib package using PowerShell
Installing the VCLib package using PowerShell

Can I just install winget now using the Add-AppPackage cmdlet? Yes, the install now works since we have installed the prerequisite VCLib package.
Winget now installs on Windows Server 2022
Winget now installs on Windows Server 2022

However, after installing winget without error, running the winget cmd results in an error:

Program 'winget.exe' failed to run: No applicable app licenses found
No applicable licenses found when running winget in Windows Server 2022
No applicable licenses found when running winget in Windows Server 2022

2. Download the license file for Windows Package Manager

So, what’s the deal, does winget require a license to run? Evidently so. Actually, not winget, but the Windows Package Manager. You can download the XML license file provided by Microsoft on the following Github link:

On the Github page, scroll all the way to the bottom under the Assets. You will see the License file listed with the source and installers.

Download the XML license file for Windows Package Manager
Download the XML license file for Windows Package Manager

3. Download Winget MSIXbundle file

So, what I did, was download the needed files into a folder:

License file VCLib powershell script and the winget MSIXbundle file for installing winget
License file VCLib powershell script and the winget MSIXbundle file for installing winget

4. Install winget using the MSIXbundle package and license file

After you have the needed files downloaded into a directory, you can run the following cmdlet with the license path parameter:

Add-AppxProvisionedPackage -Online -PackagePath .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -LicensePath .\08d8788d59cf47ed9bf42c31e31f8efa_License1.xml -Verbose

Below, the command is basically the same, except we are pointing to the downloaded XML license file downloaded from the Github page. The install completes successfully.

Installing winget package in Windows Server 2022 with the license path parameter
Installing winget package in Windows Server 2022 with the license path parameter

After installing using the App

Winget running successfully in Windows Server 2022
Winget running successfully in Windows Server 2022

Wrapping Up

If you attempt to Install Winget in Windows Server 2022 – No applicable app licenses error will appear when running the application, even after installing the required VCLib requirement. However, by installing the freely available XML license file provided by Microsoft, you can install winget and it will work in Windows Server 2022. As discussed, this is due to the way the winget package currently relies on the Microsoft Store, which is not enabled in Windows Server SKUs.

After implementing the workaround shown, you will be able to fully enjoy using the winget package manager in Windows Server 2022 to install software packages as expected.

 

Post a Comment

1 Comments

  1. Is this method applicable in Windows Server 2016?

    ReplyDelete