A few small fixes

pull/169/head
KnifMelti 2022-09-25 16:54:58 +02:00
parent b089980ae7
commit 3e04b1d544
5 changed files with 12 additions and 9 deletions

View File

@ -277,9 +277,6 @@ function Install-WingetAutoUpdate {
New-ItemProperty $regPath -Name DisplayIcon -Value "C:\Windows\System32\shell32.dll,-16739" -Force | Out-Null New-ItemProperty $regPath -Name DisplayIcon -Value "C:\Windows\System32\shell32.dll,-16739" -Force | Out-Null
New-ItemProperty $regPath -Name DisplayVersion -Value $WAUVersion -Force | Out-Null New-ItemProperty $regPath -Name DisplayVersion -Value $WAUVersion -Force | Out-Null
New-ItemProperty $regPath -Name InstallLocation -Value $WingetUpdatePath -Force | Out-Null New-ItemProperty $regPath -Name InstallLocation -Value $WingetUpdatePath -Force | Out-Null
if ($ListPath){
New-ItemProperty $regPath -Name ListPath -Value $ListPath -Force | Out-Null
}
New-ItemProperty $regPath -Name UninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WingetUpdatePath\WAU-Uninstall.ps1`"" -Force | Out-Null New-ItemProperty $regPath -Name UninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WingetUpdatePath\WAU-Uninstall.ps1`"" -Force | Out-Null
New-ItemProperty $regPath -Name QuietUninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WingetUpdatePath\WAU-Uninstall.ps1`"" -Force | Out-Null New-ItemProperty $regPath -Name QuietUninstallString -Value "powershell.exe -noprofile -executionpolicy bypass -file `"$WingetUpdatePath\WAU-Uninstall.ps1`"" -Force | Out-Null
New-ItemProperty $regPath -Name NoModify -Value 1 -Force | Out-Null New-ItemProperty $regPath -Name NoModify -Value 1 -Force | Out-Null
@ -300,6 +297,9 @@ function Install-WingetAutoUpdate {
if (!$RunOnMetered) { if (!$RunOnMetered) {
New-ItemProperty $regPath -Name WAU_DoNotRunOnMetered -Value 1 -PropertyType DWord -Force | Out-Null New-ItemProperty $regPath -Name WAU_DoNotRunOnMetered -Value 1 -PropertyType DWord -Force | Out-Null
} }
if ($ListPath){
New-ItemProperty $regPath -Name ListPath -Value $ListPath -Force | Out-Null
}
Write-host "WAU Installation succeeded!" -ForegroundColor Green Write-host "WAU Installation succeeded!" -ForegroundColor Green
Start-sleep 1 Start-sleep 1

View File

@ -4,7 +4,7 @@ function Get-ExcludedApps {
if (Test-Path "$WorkingDir\excluded_apps.txt") { if (Test-Path "$WorkingDir\excluded_apps.txt") {
return Get-Content -Path "$WorkingDir\excluded_apps.txt" return (Get-Content -Path "$WorkingDir\excluded_apps.txt").Trim() | Where-Object{$_.length -gt 0}
} }

View File

@ -4,7 +4,7 @@ function Get-IncludedApps {
if (Test-Path "$WorkingDir\included_apps.txt") { if (Test-Path "$WorkingDir\included_apps.txt") {
return Get-Content -Path "$WorkingDir\included_apps.txt" return (Get-Content -Path "$WorkingDir\included_apps.txt").Trim() | Where-Object{$_.length -gt 0}
} }

View File

@ -6,7 +6,7 @@ function Invoke-PostUpdateActions {
Write-Log "Running Post Update actions..." "yellow" Write-Log "Running Post Update actions..." "yellow"
#Reset Winget Sources #Reset Winget Sources
$ResolveWingetPath = Resolve-Path "$env:programfiles\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" $ResolveWingetPath = Resolve-Path "$env:programfiles\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" | Sort-Object { [version]($_.Path -replace '^[^\d]+_((\d+\.)*\d+)_.*', '$1') }
if ($ResolveWingetPath) { if ($ResolveWingetPath) {
#If multiple version, pick last one #If multiple version, pick last one
$WingetPath = $ResolveWingetPath[-1].Path $WingetPath = $ResolveWingetPath[-1].Path

View File

@ -60,11 +60,14 @@ if (Test-Network) {
#Get External ListPath #Get External ListPath
if ($WAUConfig.ListPath) { if ($WAUConfig.ListPath) {
Write-Log "WAU uses External Lists" Write-Log "WAU uses External Lists from $WAUConfig.ListPath"
$NewList = Test-ListPath $WAUConfig.ListPath $WAUConfig.WAU_UseWhiteList $WAUConfig.InstallLocation $NewList = Test-ListPath $WAUConfig.ListPath $WAUConfig.WAU_UseWhiteList $WAUConfig.InstallLocation
if ($NewList) { if ($NewList) {
Write-Log "Newer List downloaded to local path" Write-Log "Newer List downloaded to local path"
} }
else {
Write-Log "No newer List detected"
}
} }
#Get White or Black list #Get White or Black list