Install Winget on Windows 2022 or Windows 10 LTSC
Install Pre-reqs
Install Microsoft.UI.Xaml/2.8.6
Navigate to https://www.nuget.org/packages/Microsoft.UI.Xaml/2.8.6, on the left side look for Download Package button to download microsoft.ui.xaml.2.8.6.nupkg.Using 7-zip, extract microsoft.ui.xaml.2.8.6.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.8.appx
Install
PS C:\>Add-AppxPackage .\Microsoft.UI.Xaml.2.8.appx
Install Microsoft.VCLibs.140.00.UWPDesktop
Download https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appxInstall
PS C:\>Add-AppxPackage .\Microsoft.VCLibs.x64.14.00.Desktop.appx
Install Winget
Download Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle or any recent versions (tested using 1.8.1911) from GithubDownload license file 76fba573f02545629706ab99170237bc_License1.xml (should be one of the artifacts) from Github, the same URL from above.
Install (on elevated cmd/shell)
PS C:\>cd ~/Downloads PS C:\Users\u1\Downloads> Add-AppxProvisionedPackage -Online -PackagePath .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -LicensePath .\76fba573f02545629706ab99170237bc_License1.xml -Verbose
If you are in a hurry, you can grab the script below and run it on a PowerShell console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ProgressPreference = 'SilentlyContinue' | |
iwr https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile ~/Downloads/Microsoft.UI.Xaml.2.8.x64.appx | |
iwr https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile ~/Downloads/Microsoft.VCLibs.x64.14.00.Desktop.appx | |
iwr https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/76fba573f02545629706ab99170237bc_License1.xml -OutFile ~/Downloads/76fba573f02545629706ab99170237bc_License1.xml | |
iwr https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile ~/Downloads/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle | |
Add-AppxPackage ~/Downloads/Microsoft.UI.Xaml.2.8.x64.appx | |
Add-AppxPackage ~/Downloads/Microsoft.VCLibs.x64.14.00.Desktop.appx | |
$loc = (Resolve-Path ~/Downloads).Path | |
$install = "$loc\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" | |
$lic = "$loc\76fba573f02545629706ab99170237bc_License1.xml" | |
# Check if files exist | |
if (-Not (Test-Path $install)) { | |
throw "Package file not found: $install" | |
} | |
if (-Not (Test-Path $lic)) { | |
throw "License file not found: $lic" | |
} | |
# Run the command with expanded arguments | |
Start-Process powershell -ArgumentList "-NoProfile -Command Add-AppxProvisionedPackage -Online -PackagePath `"$install`" -LicensePath `"$lic`" -Verbose; Read-Host 'Press Enter to exit'" -Verb RunAs |
And if you trust me ;), run below:
PS C:\> iex (Invoke-RestMethod -Uri "https://gist.githubusercontent.com/technoscavenger/37f06e23daa833d0c7bee1d378ff332e/raw/122d300c8a6bb711dcd70652551599818dfdb09e/InstallWinget.ps1")
Refs: https://8thstring.blogspot.com/2023/04/install-winget-on-windows-2022.html
No comments:
Post a Comment