Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5db4188
Update GitFlow_Nightly-builds.yml
Romanitho May 26, 2025
903229a
Merge pull request #952 from Romanitho/hotfix/Nightlies
Romanitho May 26, 2025
465b15a
Trying to fix nighlties
Romanitho May 27, 2025
d2bbbfd
Update GitFlow_Make-Release-and-Sync-to-Dev.yml
Romanitho May 27, 2025
73f2048
Enhance 'Mods for WAU' with JSON output handling
KnifMelti Jun 22, 2025
5823e47
Merge branch 'Romanitho:main' into feature/_WAU-mods_exitcodes
KnifMelti Jun 22, 2025
58dfe8f
Beware!
KnifMelti Jun 22, 2025
91aca59
Merge branch 'feature/_WAU-mods_exitcodes' of https://github.com/Knif…
KnifMelti Jun 22, 2025
b339543
Exit for Reboot too...
KnifMelti Jun 22, 2025
f89d080
WAU Exit Codes from Mods too or standard
KnifMelti Jun 22, 2025
c343fec
Safe Reboot with delay notifying users
KnifMelti Jun 22, 2025
8f26ac3
Small text edits
KnifMelti Jun 23, 2025
4fc97e5
Default reboot message in minutes instead of seconds
KnifMelti Jun 23, 2025
f939719
'Postpone' as an Action too
KnifMelti Jun 24, 2025
06eea1d
Better WU check for Postpone
KnifMelti Jun 24, 2025
b1131ef
Small text change
KnifMelti Jun 24, 2025
f8bb371
Error handling
KnifMelti Jun 25, 2025
253dc4d
Reboot: now basic SCCM client awareness
KnifMelti Jun 26, 2025
3d691b4
Detail: DarkYellow
KnifMelti Jun 26, 2025
1917b61
Add reboot handler option in _WAU-mods-template.ps1 and the check
KnifMelti Jun 26, 2025
fbb8862
Wording more logical
KnifMelti Jun 26, 2025
c9be72c
Full SCCM client awareness (Soft/Hard Reboot)
KnifMelti Jun 26, 2025
a7ce3f1
Enhance mandatory restart (SCCM: Hard Reboot) handling with improved …
KnifMelti Jun 26, 2025
c3af9d7
Refactoring with external 'Test-WAUMods.ps1'
KnifMelti Jun 27, 2025
8f7f279
Rewording comment for clarity
KnifMelti Jun 27, 2025
3a3ede7
Hybrid mandatory SCCM restart handling
KnifMelti Jun 28, 2025
24a00df
Final Hybrid Hard Reboot!
KnifMelti Jun 28, 2025
dcfa95d
Documentation
KnifMelti Jun 29, 2025
cc0f89a
Nobody cares about functions...
KnifMelti Jun 29, 2025
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
10 changes: 10 additions & 0 deletions .github/workflows/GitFlow_Make-Release-and-Sync-to-Dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ jobs:

<picture>![Install counter](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/WAU_InstallCounter?style=flat-square&label=Total%20reported%20installations%20for%20this%20release&color=blue)</picture>

sync:
name: Sync develop with main
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0

# Step 5: Configure Git for merge back to develop
- name: Configure Git
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/GitFlow_Nightly-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
id: check_prs
shell: powershell
run: |
# Find the latest tag of any type
$LATEST_TAG = git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags | Select-Object -First 1
Write-Host "Latest tag: $LATEST_TAG"
# Get the latest release of any type
$LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1
Write-Host "Latest release: $LATEST_TAG"

# Get merged PRs since last tag using Git directly
$MERGED_PRS = git log --merges --grep="Merge pull request" --oneline "$LATEST_TAG..${{ env.BRANCH }}"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ Read more in the [Policies section](https://github.com/Romanitho/Winget-AutoUpda
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**.

In addition to this legacy handling, a new action-based system is now supported.<br>
This system lets you define multiple actions and conditions directly in your mod scripts, enabling more advanced automation and control over the WAU process.<br>
With actions, you can execute different scripts, check results, and control the WAU flow with greater flexibility and improved logging compared to relying solely on **Exit Code**.

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)
Expand Down
29 changes: 11 additions & 18 deletions Sources/Winget-AutoUpdate/Winget-Upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ if (Test-Network) {
#Compare
if ((Compare-SemVer -Version1 $WAUCurrentVersion -Version2 $WAUAvailableVersion) -lt 0) {
#If new version is available, update it
Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow";
Write-ToLog "WAU Available version: $WAUAvailableVersion" "DarkYellow";
Update-WAU;
}
else {
Expand Down Expand Up @@ -246,10 +246,10 @@ if (Test-Network) {
}
if ($NewList) {
if ($AlwaysDownloaded) {
Write-ToLog "List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow"
Write-ToLog "List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "DarkYellow"
}
else {
Write-ToLog "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow"
Write-ToLog "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "DarkYellow"
}
$Script:AlwaysDownloaded = $False
}
Expand Down Expand Up @@ -284,33 +284,26 @@ if (Test-Network) {
$Script:ReachNoPath = $False
}
if ($NewMods -gt 0) {
Write-ToLog "$NewMods newer Mods downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))\mods" "Yellow"
Write-ToLog "$NewMods newer Mods downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))\mods" "DarkYellow"
}
else {
if (Test-Path "$WorkingDir\mods\*.ps1") {
Write-ToLog "Mods are up to date." "Green"
}
else {
Write-ToLog "No Mods are implemented..." "Yellow"
Write-ToLog "No Mods are implemented..." "DarkYellow"
}
}
if ($DeletedMods -gt 0) {
Write-ToLog "$DeletedMods Mods deleted (not externally managed) from local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))\mods" "Red"
}
}

#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"
& "$Mods\_WAU-mods.ps1"
$ModsExitCode = $LASTEXITCODE
#If _WAU-mods.ps1 has ExitCode 1 - Re-run WAU
if ($ModsExitCode -eq 1) {
Write-ToLog "Re-run WAU"
Start-Process powershell -ArgumentList "-NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade.ps1`""
Exit
}
Write-ToLog "Running Mods for WAU..." "DarkYellow"
Test-WAUMods -WorkingDir $WorkingDir -WAUConfig $WAUConfig -GitHub_Repo $GitHub_Repo
}

}
Expand Down Expand Up @@ -351,7 +344,7 @@ if (Test-Network) {
}

#Get outdated Winget packages
Write-ToLog "Checking application updates on Winget Repository named '$($Script:WingetSourceCustom)' .." "yellow"
Write-ToLog "Checking application updates on Winget Repository named '$($Script:WingetSourceCustom)' .." "DarkYellow"
$outdated = Get-WingetOutdatedApps -src $Script:WingetSourceCustom;

#If something unusual happened or no update found
Expand Down Expand Up @@ -433,10 +426,10 @@ if (Test-Network) {
Write-ToLog "No new update." "Green"
}

#Test if _WAU-mods-postsys.ps1 exists: Mods for WAU (postsys) - if Network is active/any Winget is installed/running as SYSTEM _after_ SYSTEM updates
# Test if _WAU-mods-postsys.ps1 exists: Mods for WAU (postsys) - if Network is active/any Winget is installed/running as SYSTEM _after_ SYSTEM updates
if ($true -eq $IsSystem) {
if (Test-Path "$Mods\_WAU-mods-postsys.ps1") {
Write-ToLog "Running Mods (postsys) for WAU..." "Yellow"
Write-ToLog "Running Mods (postsys) for WAU..." "DarkYellow"
& "$Mods\_WAU-mods-postsys.ps1"
}
}
Expand Down
Loading
Loading