Thank You Deepseek
Enter this into a batch file named "install.bat"
Right-click and run as administrator.
Copy/paste the following text into a file named "install.ps1"
Have both files in the same folder
# More automated approach using direct package download
$progressPreference = 'silentlyContinue'
# Download the App Installer bundle
$url = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
$output = "$env:TEMP\AppInstaller.msixbundle"
Write-Host "Downloading winget package..." -ForegroundColor Green
Invoke-WebRequest -Uri $url -OutFile $output
# Install the package
Write-Host "Installing winget..." -ForegroundColor Green
Add-AppxPackage -Path $output
# Install dependencies
Write-Host "Installing dependencies..." -ForegroundColor Green
$dependencies = @(
"https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.UI.Xaml.2.7_8wekyb3d8bbwe.msixbundle",
"https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe.msixbundle"
)
foreach ($dep in $dependencies) {
$depFile = "$env:TEMP\$(Split-Path $dep -Leaf)"
Invoke-WebRequest -Uri $dep -OutFile $depFile
Add-AppxPackage -Path $depFile
}
# Verify
Start-Sleep -Seconds 5
try {
winget --version
Write-Host "winget installed successfully!" -ForegroundColor Green
} catch {
Write-Host "Installation completed. You may need to restart Windows Sandbox." -ForegroundColor Yellow
}