Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ You can use [Winget-Install](https://github.com/Romanitho/Winget-AutoUpdate/blob
**Mods for WAU** allows you to craft a script to do whatever you like via `_WAU-mods.ps1` in the **mods** folder.<br>
This script executes **if the network is active/any version of Winget is installed/WAU is running as SYSTEM**.<br>
If **ExitCode** is **1** from `_WAU-mods.ps1` then **Re-run WAU**.

Likewise `_WAU-mods-postsys.ps1` can be used to do things at the end of the **SYSTEM context WAU** process before the user run.

## Custom scripts (Mods feature for Apps)
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`, `-installed` or `-notinstalled` suffix in the **mods** folder.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Winget-AutoUpdate/Winget-Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $realPath = if ($scriptItem.LinkType) {
. "$realPath\functions\Get-WingetCmd.ps1"
. "$realPath\functions\Write-ToLog.ps1"
. "$realPath\functions\Confirm-Installation.ps1"

. "$realPath\functions\Compare-SemVer.ps1"

#Check if App exists in Winget Repository
function Confirm-Exist ($AppID) {
Expand Down Expand Up @@ -225,7 +225,7 @@ function Uninstall-App ($AppID, $AppArgs) {

#Uninstall App
Write-ToLog "-> Uninstalling $AppID..." "Yellow"
$WingetArgs = "uninstall --id $AppID -e --accept-source-agreements -h" -split " "
$WingetArgs = "uninstall --id $AppID -e --accept-source-agreements -h $AppArgs" -split " "
Write-ToLog "-> Running: `"$Winget`" $WingetArgs"
& "$Winget" $WingetArgs | Where-Object { $_ -notlike " *" } | Tee-Object -file $LogFile -Append

Expand Down
4 changes: 2 additions & 2 deletions Sources/Winget-AutoUpdate/functions/Test-Mods.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ function Test-Mods ($app) {
$ModsPreInstall = "$Mods\$app-preinstall.ps1"
}
if (Test-Path "$Mods\$app-override.txt") {
$ModsOverride = Get-Content "$Mods\$app-override.txt" -Raw
$ModsOverride = (Get-Content "$Mods\$app-override.txt" -Raw).Trim()
}
if (Test-Path "$Mods\$app-custom.txt") {
$ModsCustom = Get-Content "$Mods\$app-custom.txt" -Raw
$ModsCustom = (Get-Content "$Mods\$app-custom.txt" -Raw).Trim()
}
if (Test-Path "$Mods\$app-install.ps1") {
$ModsInstall = "$Mods\$app-install.ps1"
Expand Down
Loading