Skip to content

Commit

Permalink
fix winget install
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrlaczykowski committed Jun 21, 2024
1 parent 95cb818 commit c916086
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions winget.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@ def is_winget_installed():

def install_winget():
try:
winget_install_command = (
"""$progressPreference = 'silentlyContinue'"""
"""Write-Information "Downloading WinGet and "its dependencies..." """
"Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
"Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx"
"Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx"
"Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx"
"Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx"
"Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
)
subprocess.run(["powershell", "-ExecutionPolicy", "Bypass", "-Command", winget_install_command], check=True)
subprocess.run(["powershell", "-Command", "Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe"], check=True)
print ("Winget is installed")
except subprocess.CalledProcessError as e:
print(f"Error installing Winget: {e}")
Expand Down

0 comments on commit c916086

Please sign in to comment.