Microsoft's latest package manager is included in Windows 10 and 11. However, if you want to use winget on Windows Server or try a preview version, you will need to install it manually. In prerelease versions, you can enable experimental features.

winget is a package manager similar to Chocolatey or Linux-apt, which can install programs from a repository, as well as update and remove them. The command-line tool is included in Windows 10 and 11, albeit currently only in version 1.4.x.

Since then, there have been significant developments in winget, and the latest release is currently 1.6.1573. This preview version offers some experimental features that you can try out and use to a certain extent.

winget as part of App Installer

To do this, you need to download the desired release of App Installer, which includes the corresponding preview of winget. From the list of files offered on GitHub, select the ones with the file extension msixbundle. You can start the installation by double-clicking them in Explorer.

If App Installer is already present on a system you can start an update by double clicking it in Explorer

If App Installer is already present on a system you can start an update by double clicking it in Explorer

Alternatively, you can execute the following command in PowerShell:

Add-AppxPackage -Path .\\Microsoft.DesktopAppInstaller\_8wekyb3d8bbwe.msixbundle

After that, running the following should confirm a successful update:

winget -v
Installing a winget preview on Windows 11

Installing a winget preview on Windows 11

Install winget on Windows Server

Officially, Microsoft does not support winget on Windows Server, but it can still be installed there (except on Server Core). However, dependencies need to be resolved first because VCLibs 14 and UI.Xaml.2.7 are required as prerequisites.

Otherwise, you will encounter this error message:

Windows cannot install package Microsoft.WindowsStore_22210.1401.13.0_x64__8wekyb3d8bbwe because this package depends on a framework that could not be found. Provide the framework "Microsoft.UI.Xaml.2.7" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 7.2109.13004.0, along with this package to install.

To download Microsoft.UI.Xaml 2.7.3, you can obtain it as a NuGet package, change the file extension from .nupkg to .zip, and extract the archive. The Appx package can then be found in the following location:

.\microsoft.ui.xaml.2.7.3\tools\AppX\x64\Release.

Install it using the following command:

Add-AppxPackage -Path .\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx

You can find the Visual C++ runtime library for all supported architectures on this page. After downloading it, install it as follows:

Add-AppxPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx
Installing winget on Windows Server 2022

Installing winget on Windows Server 2022

Finally, as described above, add the App Installer:

Add-AppxPackage Microsoft.DesktopAppInstaller\_8wekyb3d8bbwe.msixbundle

Enable experimental features

In the current version, winget offers several features that are in an experimental state. These include configuration management based on PowerShell DSC, installing optional Windows features when an application depends on them, or freezing an app to a specific version ("PIN").

Some of these features need to be explicitly enabled by adding an entry to the JSON configuration file. To do so, run the following command:

winget settings

This opens the settings in an editor. By default, the file contains only the schema declaration and some commented lines. You can insert the following block, for example:

"experimentalFeatures": {
"dependencies": true,
"directMSI": true,
"configuration": true,
"windowsFeature": true,
    },
Enabling experimental features through JSON configuration

Enabling experimental features through JSON configuration

Since editing the JSON format can be tricky, it is important to validate the results to avoid invalid configuration. In PowerShell 7.x, you can do so with the following command:

Test-Json -Json (Get-Content -raw $env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json)

Afterward, the new commands, such as configure, should be available in winget. You can verify this by using the following command:

winget features

Summary

While winget is included in the current versions of Windows 10 and 11, the operating systems ship with an older stable release. If you want to try out newer features in the previews, you need a corresponding version of the App Installer.

On client systems, you can easily install it through Explorer. However, on Windows Server, you need to set up two libraries before adding the App Installer using PowerShell.

If you want to use experimental features, you may need to unlock them by adding an entry to the JSON configuration file in some cases.

avatar
1 Comment
  1. Aaron 2 months ago

    I use it mostly for the Windows Store apps; –source msstore.
    # winget.exe show $app | findstr Publisher

    $WinStoreApps = @(“IrfanView64″,”Okular”,”AV1 Video Extension”)
    function InstallWinApps()
    {
    foreach ($App in $WinStoreApps)
    {
    winget.exe install $app –source msstore –disable-interactivity –accept-package-agreements –accept-source-agreements
    }
    }
    InstallWinApps

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account