From c916086bfbe8f24213bd0efd9643703346360e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20=C5=81=C4=85czykowski?= Date: Fri, 21 Jun 2024 15:17:39 +0200 Subject: [PATCH] fix winget install --- winget.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/winget.py b/winget.py index 5ea6378..bdb538c 100644 --- a/winget.py +++ b/winget.py @@ -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}")