diff --git a/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 index e764292..73f4395 100644 --- a/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 @@ -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 - $WhiteList = "$WAUInstallLocation\included_apps.txt" - if (Test-Path $WhiteList) { + #Check if WAU default intall path is defined + if ($WAUInstallLocation) { + $WhiteList = "$WAUInstallLocation\included_apps.txt" + #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 diff --git a/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 index 879516f..d4958e5 100644 --- a/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -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 } } 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" } diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Update-WinGet.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Update-WinGet.ps1 index 73b2bfb..88bf74a 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Update-WinGet.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Update-WinGet.ps1 @@ -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 {