Framework ready, function next

pull/232/head
KnifMelti 2022-11-02 18:47:21 +01:00
parent 84f7e16f2a
commit db507c8264
3 changed files with 33 additions and 2 deletions

View File

@ -86,7 +86,10 @@ Disable Winget-AutoUpdate update checking. By default, WAU auto updates if new v
Use White List instead of Black List. This setting will not create the "excluded_apps.txt" but "included_apps.txt" Use White List instead of Black List. This setting will not create the "excluded_apps.txt" but "included_apps.txt"
**-ListPath** **-ListPath**
Get Black/White List from Path (URL/UNC/Local) (copy/download to Winget-AutoUpdate installation location if external list is newer). Get Black/White List from Path (URL/UNC/Local) (download/copy to Winget-AutoUpdate installation location if external list is newer).
**-ModsPath**
Get Mods from Path (URL/UNC/Local) (download/copy to `mods` in Winget-AutoUpdate installation location if external mods is newer).
**-InstallUserContext** **-InstallUserContext**
Install WAU with system and **user** context executions (From version 1.15.3) Install WAU with system and **user** context executions (From version 1.15.3)

View File

@ -25,6 +25,9 @@ Use White List instead of Black List. This setting will not create the "exclude_
.PARAMETER ListPath .PARAMETER ListPath
Get Black/White List from Path (URL/UNC/Local) Get Black/White List from Path (URL/UNC/Local)
.PARAMETER ModsPath
Get mods from Path (URL/UNC/Local)
.PARAMETER Uninstall .PARAMETER Uninstall
Remove scheduled tasks and scripts. Remove scheduled tasks and scripts.
@ -67,6 +70,9 @@ Configure WAU to bypass the Black/White list when run in user context
.EXAMPLE .EXAMPLE
.\Winget-AutoUpdate-Install.ps1 -Silent -ListPath https://www.domain.com/WAULists -StartMenuShortcut .\Winget-AutoUpdate-Install.ps1 -Silent -ListPath https://www.domain.com/WAULists -StartMenuShortcut
.EXAMPLE
.\Winget-AutoUpdate-Install.ps1 -Silent -ModsPath https://www.domain.com/WAUMods -DesktopShortcut
.EXAMPLE .EXAMPLE
.\Winget-AutoUpdate-Install.ps1 -Silent -UpdatesAtLogon -UpdatesInterval Weekly .\Winget-AutoUpdate-Install.ps1 -Silent -UpdatesAtLogon -UpdatesInterval Weekly
@ -80,6 +86,7 @@ param(
[Parameter(Mandatory = $False)] [Alias('S')] [Switch] $Silent = $false, [Parameter(Mandatory = $False)] [Alias('S')] [Switch] $Silent = $false,
[Parameter(Mandatory = $False)] [Alias('Path')] [String] $WingetUpdatePath = "$env:ProgramData\Winget-AutoUpdate", [Parameter(Mandatory = $False)] [Alias('Path')] [String] $WingetUpdatePath = "$env:ProgramData\Winget-AutoUpdate",
[Parameter(Mandatory = $False)] [Alias('List')] [String] $ListPath, [Parameter(Mandatory = $False)] [Alias('List')] [String] $ListPath,
[Parameter(Mandatory = $False)] [Alias('Mods')] [String] $ModsPath,
[Parameter(Mandatory = $False)] [Switch] $DoNotUpdate = $false, [Parameter(Mandatory = $False)] [Switch] $DoNotUpdate = $false,
[Parameter(Mandatory = $False)] [Switch] $DisableWAUAutoUpdate = $false, [Parameter(Mandatory = $False)] [Switch] $DisableWAUAutoUpdate = $false,
[Parameter(Mandatory = $False)] [Switch] $RunOnMetered = $false, [Parameter(Mandatory = $False)] [Switch] $RunOnMetered = $false,
@ -339,6 +346,9 @@ function Install-WingetAutoUpdate {
if ($ListPath) { if ($ListPath) {
New-ItemProperty $regPath -Name WAU_ListPath -Value $ListPath -Force | Out-Null New-ItemProperty $regPath -Name WAU_ListPath -Value $ListPath -Force | Out-Null
} }
if ($ModsPath) {
New-ItemProperty $regPath -Name WAU_ModsPath -Value $ModsPath -Force | Out-Null
}
if ($BypassListForUsers) { if ($BypassListForUsers) {
New-ItemProperty $regPath -Name WAU_BypassListForUsers -Value 1 -PropertyType DWord -Force | Out-Null New-ItemProperty $regPath -Name WAU_BypassListForUsers -Value 1 -PropertyType DWord -Force | Out-Null
} }

View File

@ -76,7 +76,7 @@ if (Test-Network) {
Write-Log "WAU uses External Lists from: $($WAUConfig.WAU_ListPath)" Write-Log "WAU uses External Lists from: $($WAUConfig.WAU_ListPath)"
$NewList = Test-ListPath $WAUConfig.WAU_ListPath $WAUConfig.WAU_UseWhiteList $WAUConfig.InstallLocation $NewList = Test-ListPath $WAUConfig.WAU_ListPath $WAUConfig.WAU_UseWhiteList $WAUConfig.InstallLocation
if ($NewList) { if ($NewList) {
Write-Log "Newer List copied/downloaded to local path: $($WAUConfig.InstallLocation)" "Yellow" Write-Log "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation)" "Yellow"
} }
else { else {
if ((Test-Path "$WorkingDir\included_apps.txt") -or (Test-Path "$WorkingDir\excluded_apps.txt")) { if ((Test-Path "$WorkingDir\included_apps.txt") -or (Test-Path "$WorkingDir\excluded_apps.txt")) {
@ -88,6 +88,24 @@ if (Test-Network) {
} }
} }
} }
#Get External ModsPath if System
if ($WAUConfig.WAU_ModsPath) {
Write-Log "WAU uses External Mods from: $($WAUConfig.WAU_ModsPath)"
$NewMods = Test-ModsPath $WAUConfig.WAU_ModsPath $WAUConfig.InstallLocation
if ($NewMods) {
Write-Log "Newer Mods downloaded/copied to local path: $($WAUConfig.InstallLocation)" "Yellow"
}
else {
if (Test-Path "$WorkingDir\mods\*.ps1") {
Write-Log "Mods is up to date." "Green"
}
else {
Write-Log "Mods doesn't exist!" "Yellow"
#Exit 0
}
}
}
} }
#Get White or Black list #Get White or Black list