Table of Contents
Windows Package Manager
In some cases, you cannot use Microsoft Store so, you cannot install or update App Installer. And when you install an app using Windows Package Manager, you get the following error.
Method 1: Install WinGet without Micosoft Store manually
To fix it, we’ll install Windows Package Manager without Microsoft Store. Before you begin, you need install dependencies stuff.
1️⃣ Right click on Windows start icon then select Windows PowerShell Admin or Windows Terminal Admin in Windows 11 and keep it open throughout this guide.
2️⃣ Download the correct VC++ v14 Desktop Framework Package for your architecture. Winget v1.2.10271 introduced a new dependency for Microsoft.UI.Xaml.2.7 and above which you have to install manually.
Add-AppxPackage "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx"
3️⃣ Download the latest version of Microsoft.UI.Xaml from Microsoft to the temp folder.
Set-Location "$env:temp"
$uri = 'https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.x64.appx'
Invoke-WebRequest -Uri $uri -OutFile 'Microsoft.UI.Xaml.2.8.x64.appx'
4️⃣ Install Microsoft.UI.Xaml with Add-AppxPackage cmdlet.
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
5️⃣ Download the latest version of WinGet from GitHub. Then using Add-AppxProvisionedPackge command to install the Windows Package Manager.
# Download winget and license file the install it
Write-Host "Installing Windows Package Manager..." -ForegroundColor Green
function getLink($match) {
$uri = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$get = Invoke-RestMethod -uri $uri -Method Get -ErrorAction stop
$data = $get[0].assets | Where-Object name -Match $match
return $data.browser_download_url
}
$url = getLink("msixbundle")
$licenseUrl = getLink("License1.xml")
# Finally, install winget
$fileName = 'winget.msixbundle'
$licenseName = 'license1.xml'
(New-Object Net.WebClient).DownloadFile($url, "$env:temp\$fileName")
(New-Object Net.WebClient).DownloadFile($licenseUrl, "$env:temp\$licenseName")
Add-AppxProvisionedPackage -Online -PackagePath $fileName -LicensePath $licenseName
6️⃣ You can run the below command to verify the Winget is installed successfully.
$packages = @("Microsoft.VCLibs","DesktopAppInstaller","UI.Xaml")
ForEach ($package in $packages){
Get-AppxPackage -Name *$package* | select Name,Version,Status
}
Name Version Status
---- ------- ------
Microsoft.VCLibs.140.00.UWPDesktop 14.0.30704.0 Ok
Microsoft.DesktopAppInstaller 1.19.10173.0 Ok
Microsoft.UI.Xaml.2.7 7.2109.13004.0 Ok
7️⃣ Now, open Windows PowerShell or Windows Command Prompt then run the winget command to install an app.
PS C:\Users\admin\Downloads> winget
Windows Package Manager v1.3.2091
Copyright (c) Microsoft Corporation. All rights reserved.
The winget command line utility enables installing applications and other packages from the command line.
usage: winget [<command>] [<options>]
The following commands are available:
install Installs the given package
show Shows information about a package
source Manage sources of packages
search Find and show basic info of packages
list Display installed packages
upgrade Shows and performs available upgrades
uninstall Uninstalls the given package
hash Helper to hash installer files
validate Validates a manifest file
settings Open settings or set administrator settings
features Shows the status of experimental features
export Exports a list of the installed packages
import Installs all the packages in a file
For more details on a specific command, pass it the help argument. [-?]
The following options are available:
-v,--version Display the version of the tool
--info Display general info of the tool
More help can be found at: https://aka.ms/winget-command-help
Method 2: Install Windows Package Manager using script
1️⃣ Open PowerShell as administrator.
2️⃣ Copy and paste all below code into PowerShell window then hit Enter.
irm bonguides.com/winget | iex
Not a reader? Watch this related video tutorial: