diff --git a/README.md b/README.md index 93d143f..45437dc 100644 --- a/README.md +++ b/README.md @@ -172,12 +172,9 @@ Remove scheduled tasks and scripts. See https://github.com/Romanitho/Winget-AutoUpdate/discussions/88 ## Custom script (Mods for WAU) -**Mods for WAU** allows you to craft a script to do whatever you like via `_WAU-mods.ps1` in the **mods** folder. - -This script executes **if the network is active/any version of Winget is installed/WAU is running as SYSTEM**. - +**Mods for WAU** allows you to craft a script to do whatever you like via `_WAU-mods.ps1` in the **mods** folder. +This script executes **if the network is active/any version of Winget is installed/WAU is running as SYSTEM**. If **ExitCode** is **1** from `_WAU-mods.ps1` then **Re-run WAU**. - ## Custom scripts (Mods feature for Apps) From version 1.8.0, the Mods feature allows you to run additional scripts when upgrading or installing an app. Just put the scripts in question with the **AppID** followed by the `-preinstall`, `-upgrade`, `-install` or `-installed` suffix in the **mods** folder. diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 767aa3a..25cfbc7 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -178,7 +178,7 @@ if (Test-Network) { } } - #Test if _WAU-mods.ps1 exist (Mods for WAU if Network is active/any Winget is installed/running as SYSTEM) + #Test if _WAU-mods.ps1 exist: Mods for WAU (if Network is active/any Winget is installed/running as SYSTEM) $Mods = "$WorkingDir\mods" if (Test-Path "$Mods\_WAU-mods.ps1") { Write-ToLog "Running Mods for WAU..." "Yellow" diff --git a/Winget-AutoUpdate/mods/README.md b/Winget-AutoUpdate/mods/README.md index defa8bd..d25361a 100644 --- a/Winget-AutoUpdate/mods/README.md +++ b/Winget-AutoUpdate/mods/README.md @@ -1,3 +1,7 @@ +### Mods for WAU (if Network is active/any Winget is installed/running as SYSTEM): +Custom script should be placed here. +A script **Template** `_WAU-mods-template.ps1` is included to get you started. +Rename it to `_WAU-mods.ps1` if you want to activate/run it via `Winget-Upgrade.ps1`. ### Pre/During/Post install/uninstall: Custom scripts should be placed here. A script **Template** and **Mods Functions** are included as an **example** to get you started... diff --git a/Winget-AutoUpdate/mods/_WAU-mods-template.ps1 b/Winget-AutoUpdate/mods/_WAU-mods-template.ps1 new file mode 100644 index 0000000..1dbd695 --- /dev/null +++ b/Winget-AutoUpdate/mods/_WAU-mods-template.ps1 @@ -0,0 +1,17 @@ +#Mods for WAU (if Network is active/any Winget is installed/running as SYSTEM) +#Winget-Upgrade.ps1 calls this script with the code: +#[Write-ToLog "Running Mods for WAU..." "Yellow" +#& "$Mods\_WAU-mods.ps1"] +#Exit 1 to Re-run WAU from this script! + +<# FUNCTIONS #> + + +<# ARRAYS/VARIABLES #> + + +<# MAIN #> + + +Write-ToLog "...everything's already been done!" "Green" +Exit 0