Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Update winget via batch file #89

Open
ZaxLofful opened this issue Jun 30, 2024 · 1 comment
Open

[Enhancement] Update winget via batch file #89

ZaxLofful opened this issue Jun 30, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ZaxLofful
Copy link

When launching on a fresh build of Win 11, there is a winget warning that it needs to be updated.

Have PowerShell update winget right from the beginning, or have it done in the batch file prior to just launching.

@Raphire Raphire self-assigned this Jul 2, 2024
@Raphire Raphire added the enhancement New feature or request label Jul 2, 2024
@ZaxLofful
Copy link
Author

ZaxLofful commented Oct 17, 2024

I made a small PowerShell script that will install what is needed:

Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

$progressPreference = 'silentlyContinue'
$latestWingetMsixBundleUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object {$_.EndsWith(".msixbundle")}
$latestWingetMsixBundle = $latestWingetMsixBundleUri.Split("/")[-1]
# Define the output directory to the user's main directory
$outputDir = "$Env:USERPROFILE"

Write-Information "Downloading winget to user's main directory..."
Invoke-WebRequest -Uri $latestWingetMsixBundleUri -OutFile "$outputDir\$latestWingetMsixBundle"
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile "$outputDir\Microsoft.VCLibs.x64.14.00.Desktop.appx"

Add-AppxPackage "$outputDir\Microsoft.VCLibs.x64.14.00.Desktop.appx"
Add-AppxPackage "$outputDir\$latestWingetMsixBundle"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants