Req for WSB!

pull/619/head
KnifMelti 2024-04-29 15:00:06 +02:00
parent 4563b7b5f6
commit 41063c46cf
1 changed files with 22 additions and 0 deletions

View File

@ -64,6 +64,28 @@ function Install-Prerequisites {
} }
} }
#Check if Microsoft.UI.Xaml.2.8 is installed (Req for WSB: https://learn.microsoft.com/en-us/windows/package-manager/winget/#install-winget-on-windows-sandbox)
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" Write-ToLog "Prerequisites checked. OK`n" "Green"
} }