Windows Server 2019 and Windows Server 2022 don't include WinGet (Windows Package Manager) by default. Install WinGet on these servers to install and update software through Atera's WinGet integration, including software bundles and automated software patching via automation profiles.
Note: This applies to Windows Server 2019 and Windows Server 2022 with Desktop Experience. It doesn't apply to Server Core.
Before you begin
- You must be able to run PowerShell as a local Administrator.
- The server needs outbound internet access to github.com and aka.ms to download the required packages.
- No server reboot is required. Opening a new PowerShell or Command Prompt session (or logging out and back in) is enough for PATH changes to take effect.
Install WinGet via an Atera script
You can install WinGet and all its prerequisites by running a single PowerShell script from Atera. The script installs:
- Microsoft.VCLibs.140.00.UWPDesktop (runtime library required by WinGet)
- Microsoft.UI.Xaml.2.8 (UI framework required by WinGet)
- Visual C++ Redistributable (VS 2015-2022)
- The WinGet license file (License1.xml)
- Microsoft.DesktopAppInstaller (WinGet itself)
To install WinGet via an Atera script:
1. Create a new PowerShell script with the following content. For more information, see Create, upload, and generate scripts.
irm asheroto.com/winget | iex
2. Run the script on your Windows Server 2019 or 2022 devices.
No reboot or additional steps are needed.
Install WinGet manually
Use these steps if you can't run the script via Atera.
Step 1: Identify the server's CPU architecture
Most servers are x64. To confirm, run this in PowerShell:
(Get-ComputerInfo).CsSystemType
The result contains x64, x86, or ARM64. Use this value to pick the correct files in the steps below.
Step 2: Install the WinGet framework dependencies
WinGet depends on two Microsoft framework packages that aren't included by default on Server 2019 and 2022: Microsoft.VCLibs.140.00.UWPDesktop and Microsoft.UI.Xaml.2.8.
1. Go to https://github.com/microsoft/winget-cli/releases/latest.
2. Under Assets, download DesktopAppInstaller_Dependencies.zip.
3. Extract the file and open the subfolder that matches your server's architecture. It contains two .appx files, one for VCLibs and one for UI.Xaml.
4. Open PowerShell as Administrator and install both .appx files. For example:
Add-AppxPackage -Path "C:\Downloads\x64\Microsoft.VCLibs.140.00.UWPDesktop_x64.appx" Add-AppxPackage -Path "C:\Downloads\x64\Microsoft.UI.Xaml.2.8_x64.appx"
Note: Adjust the file names and paths to match the extracted files, since version numbers change over time.
Step 3: Install the Visual C++ Redistributable
If the Visual C++ Redistributable (VS 2015-2022, version 14.x) is already installed, skip this step.
1. Download the redistributable that matches your architecture:
- x64: https://aka.ms/vs/17/release/vc_redist.x64.exe
- x86: https://aka.ms/vs/17/release/vc_redist.x86.exe
- ARM64: https://aka.ms/vs/17/release/vc_redist.arm64.exe
2. Run the downloaded file, or install it silently. For example:
.\vc_redist.x64.exe /install /quiet /norestart
Step 4: Install WinGet
WinGet must be side-loaded with a license file, since Server 2019 and 2022 can't install it from the Microsoft Store.
1. Go back to the GitHub release page from Step 2.
2. Under Assets, download both Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle and License1.xml.
3. Open PowerShell as Administrator and run:
Add-AppxProvisionedPackage -Online ` -PackagePath "C:\Downloads\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" ` -LicensePath "C:\Downloads\License1.xml"
This installs and licenses WinGet in one step.
Step 5: Fix folder permissions and update the PATH
On Server 2019 and 2022, the WinGet install folder isn't added to the system PATH automatically, and Administrators may not have full control over it.
1. Locate the WinGet install folder (the version number varies):
C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_<version>_<arch>__8wekyb3d8bbwe
2. Grant the local Administrators group Full Control on that folder. Use File Explorer (right-click the folder > Properties > Security > Edit, then add Administrators with Full control), or run:
$Path = "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_<version>_<arch>__8wekyb3d8bbwe" $Acl = Get-Acl -Path $Path $Rule = New-Object System.Security.AccessControl.FileSystemAccessRule( "Administrators","FullControl","ContainerInherit,ObjectInherit","None","Allow") $Acl.SetAccessRule($Rule) Set-Acl -Path $Path -AclObject $Acl
3. Add the same folder to the System PATH. Use System Properties > Advanced > Environment Variables > System variables > Path > New, or run:
$Path = "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_<version>_<arch>__8wekyb3d8bbwe"
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$Path", "Machine")4. Close any open PowerShell or Command Prompt windows and open a new one (or log out and back in).
Verify the installation
Run the following in PowerShell:
winget --version
If a version number is returned, WinGet is installed and ready for software installation and updates via Atera.
Troubleshooting
- "winget is not recognized": Close and reopen the terminal, then check the PATH entry from Step 5.
- Downloads are blocked or time out: Confirm the server has outbound access to github.com and aka.ms.
- Add-AppxPackage errors on the framework packages: Confirm the architecture folder you used matches Step 1.
- Add-AppxProvisionedPackage fails: Confirm the .msixbundle and License1.xml files came from the same release and weren't renamed.