Merge pull request #619 from KnifMelti/Whitelist_Fix

Fixes
pull/574/head
Romain 2024-04-30 13:35:13 +02:00 committed by GitHub
commit d9f870b45c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 6 deletions

View File

@ -256,9 +256,13 @@ function Uninstall-App ($AppID, $AppArgs) {
#Function to Add app to WAU white list
function Add-WAUWhiteList ($AppID) {
#Check if WAU default intall path exists
#Check if WAU default intall path is defined
if ($WAUInstallLocation) {
$WhiteList = "$WAUInstallLocation\included_apps.txt"
if (Test-Path $WhiteList) {
#Create included_apps.txt if it doesn't exist
if (!(Test-Path $WhiteList)) {
New-Item -ItemType File -Path $WhiteList -Force -ErrorAction SilentlyContinue
}
Write-ToLog "-> Add $AppID to WAU included_apps.txt"
#Add App to "included_apps.txt"
Add-Content -path $WhiteList -Value "`n$AppID" -Force

View File

@ -214,7 +214,7 @@ if (Test-Network) {
#If _WAU-mods.ps1 has ExitCode 1 - Re-run WAU
if ($ModsExitCode -eq 1) {
Write-ToLog "Re-run WAU"
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade.ps1`""
Start-Process powershell -ArgumentList "-NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade.ps1`""
Exit
}
}

View File

@ -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"
}

View File

@ -12,8 +12,8 @@ Function Update-WinGet {
$WinGetAvailableVersion = ((Invoke-WebRequest $WinGeturl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v", "")
}
catch {
#if fail set version to the latest version as of 2023-10-08
$WinGetAvailableVersion = "1.6.2771"
#if fail set version to the latest version as of 2024-04-29
$WinGetAvailableVersion = "1.7.11132"
}
try {