windows系统安装winget
windows system install winget
winget是微软自带的安装工具,在某些阉割版系统中没有自带,所以可通过此教程完成winget的安装
共 3 步 · 约 6 分钟
1
2min下载软件包
在同一个目录放两个文件:
Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle DesktopAppInstaller_Dependencies.zip
下载地址:
https://github.com/microsoft/winget-cli/releases/download/v1.28.240/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle https://github.com/microsoft/winget-cli/releases/download/v1.28.240/DesktopAppInstaller_Dependencies.zip
2
2min执行命令
然后在这个目录打开 Windows PowerShell,执行:
powershell
Expand-Archive .\DesktopAppInstaller_Dependencies.zip -DestinationPath .\DesktopAppInstaller_Dependencies -Force
$deps = Get-ChildItem .\DesktopAppInstaller_Dependencies -Recurse -File |
Where-Object {
$_.Extension -in ".appx", ".msix" -and
($_.Name -match "x64|neutral")
} |
Select-Object -ExpandProperty FullName
Add-AppxPackage `
-Path .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle `
-DependencyPath $deps3
2min验证安装
装完新开一个 PowerShell:
winget --version
如果还是识别不到,再执行一次注册:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
然后重新打开终端再试。