From 9a493e4116fc4cf6d8f94071b0bba0cec0bc3503 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Mon, 29 Apr 2024 19:49:34 +0200 Subject: [PATCH] WSB Fix back --- .../functions/Install-Prerequisites.ps1 | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 index 75a689f..e415828 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 @@ -64,6 +64,28 @@ function Install-Prerequisites { } } + #Check if Microsoft.UI.Xaml.2.8 is installed + if (!(Get-AppxPackage -Name 'Microsoft.UI.Xaml.2.8' -AllUsers)) { + try { + Write-ToLog "Microsoft.UI.Xaml.2.8 is not installed" "Red" + #Download + $UIXamlUrl = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx" + $UIXamlFile = "$env:TEMP\Microsoft.UI.Xaml.2.8.x64.appx" + Write-ToLog "-> Downloading Microsoft.UI.Xaml.2.8..." + Invoke-RestMethod -Uri $UIXamlUrl -OutFile $UIXamlFile + #Install + Write-ToLog "-> Installing Microsoft.UI.Xaml.2.8..." + Add-AppxProvisionedPackage -Online -PackagePath $UIXamlFile -SkipLicense | Out-Null + Write-ToLog "-> Microsoft.UI.Xaml.2.8 installed successfully." "Green" + } + catch { + Write-ToLog "-> Failed to intall Microsoft.UI.Xaml.2.8..." "Red" + } + finally { + Remove-Item -Path $UIXamlFile -Force + } + } + Write-ToLog "Prerequisites checked. OK`n" "Green" }