Skip to content

Commit 2e4f1a2

Browse files
authored
Merge pull request #1034 from Romanitho/release/2.8.0
Release 2.8.0
2 parents b3429ad + 7559057 commit 2e4f1a2

15 files changed

+182
-251
lines changed

.github/copilot-instructions.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copilot Instructions for Winget-AutoUpdate
2+
3+
## Project Overview
4+
- **Winget-AutoUpdate (WAU)** automates daily updates of Windows applications using the `winget` tool, supporting both system and user contexts.
5+
- The project is PowerShell-centric, with core scripts in `Sources/Winget-AutoUpdate/` and modular functions in `functions/`.
6+
- GPO/Intune management is supported via ADMX/ADML templates in `Sources/Policies/ADMX/`.
7+
- Customization is enabled through "Mods" scripts in `Sources/Winget-AutoUpdate/mods/`.
8+
9+
## Key Components
10+
- **Main scripts:**
11+
- `Winget-Upgrade.ps1`: Main update logic, loads all functions from `functions/`.
12+
- `Winget-Install.ps1`: Used for deployment scenarios (Intune/SCCM).
13+
- `WAU-Notify.ps1`, `WAU-Policies.ps1`: Notification and policy handling.
14+
- **Functions:** Each PowerShell file in `functions/` implements a single responsibility (e.g., `Get-ExcludedApps.ps1`, `Update-App.ps1`).
15+
- **Mods:**
16+
- Place custom scripts in `mods/` to hook into app install/upgrade events (see `mods/README.md`).
17+
- Supported hooks: `-preinstall`, `-upgrade`, `-install`, `-installed`, `-notinstalled`.
18+
- Global mods: `_WAU-mods.ps1`, `_WAU-mods-postsys.ps1`, `_WAU-notinstalled.ps1`.
19+
- **GPO/Intune:**
20+
- ADMX/ADML files in `Sources/Policies/ADMX/` allow central management of WAU settings.
21+
- Since v1.16.5, GPO Black/White lists are auto-detected—no need to set `-ListPath GPO`.
22+
23+
## Developer Workflows
24+
- **No build step**: Scripts are run directly via PowerShell.
25+
- **Testing:**
26+
- No formal test suite; test by running scripts with various parameters and checking logs in `logs/`.
27+
- **Debugging:**
28+
- Logs are written to `logs/updates.log` (system context).
29+
- Use `Write-ToLog` for custom debug output.
30+
- **Deployment:**
31+
- MSI installer is built using Wix (see `Wix/`).
32+
- Deploy via Intune/SCCM by installing the MSI package (WAU.msi).
33+
34+
## Project Conventions
35+
- **All functions are dot-sourced at runtime from the `functions/` directory.**
36+
- **Mods**: Use the provided templates in `mods/` for custom logic. Scripts are matched by naming convention.
37+
- **GPO/Intune**: Only the `en-US` ADML file is supported.
38+
- **Lists**: `excluded_apps.txt` and `included_apps.txt` are used unless a GPO list is present (GPO always takes precedence).
39+
- **Wildcard support**: App lists support `*` wildcards (e.g., `Mozilla.Firefox*`).
40+
41+
## Integration Points
42+
- **winget**: All app management is via the Windows Package Manager CLI.
43+
- **GPO/Intune**: Settings are read from registry or policy files if present.
44+
- **Wix**: Used for MSI packaging (see `Wix/build.wxs`).
45+
46+
## Examples
47+
- To add a global mod: copy `_WAU-mods-template.ps1` to `_WAU-mods.ps1` and customize.
48+
- To exclude an app: add its ID to `excluded_apps.txt` or configure via GPO.
49+
- To deploy via Intune: use `Winget-Install.ps1` with appropriate parameters.
50+
51+
For more, see `README.md`, `Sources/Policies/README.md`, and `Sources/Winget-AutoUpdate/mods/README.md`.

.github/workflows/GA_Mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
# Git Checkout
3535
- name: Checkout Code
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@v5
3737
with:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939
fetch-depth: 0

.github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
# Step 2: Checkout the develop branch which contains all approved features
3737
- name: Checkout code
38-
uses: actions/checkout@v4.2.2
38+
uses: actions/checkout@v5
3939
with:
4040
ref: develop # Always create releases from develop branch
4141
fetch-depth: 0

.github/workflows/GitFlow_Make-Release-and-Sync-to-Dev.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
steps:
3030
# Step 1: Checkout the code from the main branch after merge
3131
- name: Checkout code
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333
with:
3434
token: ${{ secrets.GH_PAT_SYNC }}
3535
lfs: "true"
@@ -99,19 +99,26 @@ jobs:
9999
100100
# Package ADMX policy templates
101101
echo "### Zip ADMX ###"
102-
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\WAU_ADMX.zip -Force
102+
$admxPath = ".\Sources\Policies\ADMX\WAU.admx"
103+
try {
104+
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null
105+
$ADMXversion = $matches[1]
106+
$admxZip = "WAU_ADMX_$($ADMXversion).zip"
107+
}
108+
catch {
109+
Write-Host "Error getting WAU ADMX version!"
110+
$admxZip = "WAU_ADMX.zip"
111+
}
112+
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\$admxZip -Force
103113
Get-Item .\*.zip
114+
echo "admx_zip_name=$admxZip" >> $env:GITHUB_OUTPUT
104115
105116
# Calculate ADMX package hash for verification
106117
echo "### Get ADMX zip SHA ###"
107-
$ADMXSHA = (Get-FileHash .\WAU_ADMX.zip).hash
108-
echo " - WAU_ADMX.zip SHA256: $ADMXSHA"
118+
$ADMXSHA = (Get-FileHash .\$admxZip).hash
119+
echo " - $admxZip SHA256: $ADMXSHA"
109120
echo "admx_sha=$ADMXSHA" >> $env:GITHUB_OUTPUT
110121
111-
# Create installation counter file for tracking installs
112-
echo "### Create install counter file ###"
113-
echo "Install counter file." > WAU_InstallCounter
114-
115122
# Step 4: Create stable GitHub release with all artifacts
116123
- name: Create release
117124
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
@@ -120,23 +127,21 @@ jobs:
120127
prerelease: false # This is a stable release
121128
generateReleaseNotes: true
122129
name: WAU ${{ steps.release_version.outputs.NextSemVer }}
123-
artifacts: "WAU.msi,WAU_ADMX.zip,WAU_InstallCounter"
130+
artifacts: "WAU.msi,${{ steps.build_project.outputs.admx_zip_name }}"
124131
body: |
125132
## Files
126133
|Files|Hash (SHA256)|Downloads|
127134
|---|---|---|
128135
|[WAU.msi](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.NextSemVer }}/WAU.msi) (x64)|`${{ steps.build_project.outputs.msi_sha }}`|<picture>![WAU.msi](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/WAU.msi?style=flat-square&label=&color=blue)</picture>|
129-
|[WAU_ADMX.zip](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.NextSemVer }}/WAU_ADMX.zip)|`${{ steps.build_project.outputs.admx_sha }}`|<picture>![WAU_ADMX.zip](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/WAU_ADMX.zip?style=flat-square&label=&color=blue)</picture>|
130-
131-
<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>
136+
|[${{ steps.build_project.outputs.admx_zip_name }}](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.NextSemVer }}/${{ steps.build_project.outputs.admx_zip_name }})|`${{ steps.build_project.outputs.admx_sha }}`|<picture>![${{ steps.build_project.outputs.admx_zip_name }}](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/${{ steps.build_project.outputs.admx_zip_name }}?style=flat-square&label=&color=blue)</picture>|
132137
133138
sync:
134139
name: Sync develop with main
135140
runs-on: ubuntu-latest
136141
needs: build
137142
steps:
138143
- name: Checkout code
139-
uses: actions/checkout@v4
144+
uses: actions/checkout@v5
140145
with:
141146
fetch-depth: 0
142147
token: ${{ secrets.GH_PAT_SYNC }}

.github/workflows/GitFlow_Nightly-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
# Step 1: Checkout the develop branch for nightly builds
3030
- name: Checkout code
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v5
3232
with:
3333
lfs: "true"
3434
fetch-depth: 0

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following command will install WAU through winget itself in the newest versi
2727
winget install Romanitho.Winget-AutoUpdate
2828
```
2929
#### Alternative installation (for home admin users)
30-
You can also download the latest release of the add-on [WAU Settings GUI (for Winget-AutoUpdate)](https://github.com/KnifMelti/WAU-Settings-GUI) and install it (this will install both **WAU** and a **GUI** that provides a user-friendly portable standalone interface to modify every aspect of **Winget-AutoUpdate (WAU)** settings).
30+
You can also download the latest release of the add-on [WAU Settings GUI (for Winget-AutoUpdate)](https://github.com/KnifMelti/WAU-Settings-GUI) and install it (this will install both **WAU** and a **GUI** that provides a user-friendly portable standalone interface to modify every aspect of **Winget-AutoUpdate (WAU)**).
3131

3232
## Configurations
3333
### Keep some apps out of Winget-AutoUpdate
@@ -39,15 +39,15 @@ You can update only pre-selected apps. To do so, create an "included_apps.txt" w
3939

4040
> The lists can contain Wildcard (*). For instance ```Mozilla.Firefox*``` will take care of all Firefox channels.
4141
42-
List and Mods folder content will be copied to WAU install location:
42+
List and Mods folder content will be copied to WAU install location:
4343
![explorer](https://github.com/user-attachments/assets/a37837b0-b61e-4ce7-b23c-fd8661585e40)
4444

4545

4646
### Notification Level
4747
You can choose which notification will be displayed: `Full`, `Success only`, `Errors only` or `None`.
4848

4949
### Notification language
50-
You can easily translate toast notifications by creating your locale xml config file (and share it with us :) ).
50+
You can easily translate toast notifications by creating your locale xml config file (and share it with us 😉).
5151

5252
### When does the script run?
5353
WAU runs ,by default, at logon. You can configure the frequency with options (Daily, BiDaily, Weekly, BiWeekly, Monthly or Never).
@@ -110,7 +110,8 @@ It doesn't work to call Powershell in **CMD** to install **WAU** with the parame
110110
Instead you must escape **every** special character (notice the `%` escape too) like:<br>
111111
`-ListPath https://storagesample.blob.core.windows.net/sample-container^?v=2023-11-31^&sr=b^&sig=39Up9jzHkxhUIhFEjEh9594DIxe6cIRCgOVOICGSP%%3A377^&sp=rcw`
112112

113-
If `-ListPath` is set to **GPO** the Black/White List can be managed from within the GPO itself under **Application GPO Blacklist**/**Application GPO Whitelist**. Thanks to [Weatherlights](https://github.com/Weatherlights) in [#256 (reply in thread)](https://github.com/Romanitho/Winget-AutoUpdate/discussions/256#discussioncomment-4710599)!
113+
114+
If a blacklist or whitelist is configured via Group Policy (GPO), WAU will automatically use these settings. There is no longer a need to specify "GPO" as a value for `ListPath`, detection is automatic as soon as a list is defined in Group Policy.
114115

115116

116117
### MODSPATH
@@ -162,7 +163,7 @@ Default value 6AM (06:00:00). Specify the time of the update interval execution
162163

163164
### UPDATESATTIMEDELAY
164165
Default value is none (00:00). This setting specifies the delay for the scheduled task.
165-
A scheduled task random delay adds a random amount of wait time (up to the specified maximum) before the task starts.
166+
A scheduled task random delay adds a random amount of wait time (up to the specified maximum) before the task starts.
166167
This helps prevent many devices from running the task at the exact same time. This is not applicable to "on logon" triggers.
167168

168169
### DONOTRUNONMETERED
@@ -268,4 +269,3 @@ Feel free to give us any suggestions or optimizations in code and support us by
268269
[![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/Romanitho/Winget-AutoUpdate?display_name=release&include_prereleases&label=Latest%20Release&style=flat-square)](https://github.com/Romanitho/Winget-AutoUpdate/releases/)
269270

270271
</div>
271-

Sources/Policies/ADMX/WAU.admx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="5.1"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="5.2"
44
schemaVersion="1.0" xmlns="http://www.microsoft.com/GroupPolicy/PolicyDefinitions">
55
<policyNamespaces>
66
<target prefix="WAU" namespace="Romanitho.Policies.WAU" />
77
</policyNamespaces>
8-
<resources minRequiredRevision="5.1" fallbackCulture="en-us" />
8+
<resources minRequiredRevision="5.2" fallbackCulture="en-us" />
99
<supportedOn>
1010
<definitions>
1111
<definition name="SUPPORTED_WAU_1_16_0" displayName="$(string.SUPPORTED_WAU_1_16_0)" />

Sources/Policies/ADMX/en-US/WAU.adml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<policyDefinitionResources xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="5.1" schemaVersion="1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="5.2" schemaVersion="1.0"
44
xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
55
<displayName>WinGet-AutoUpdate</displayName>
66
<description>WinGet-AutoUpdate GPO Management</description>
@@ -47,9 +47,9 @@ If this policy is disabled or not configured, GPO Whitelist is not used.</string
4747
<string id="UseWhiteList_Explain">This policy setting specifies whether to use a Whitelist or not.
4848

4949
If this policy is disabled or not configured, the default is No.</string>
50-
<string id="ListPath_Name">Get Black/White List from external Path (URL/UNC/GPO/Local)</string>
51-
<string id="ListPath_Explain">If this policy is enabled, you can set a (URL/UNC/GPO/Local) Path to external lists other than the default.
52-
If "Application GPO Blacklist/Whitelist" is set in this GPO the Path MUST be: GPO
50+
<string id="ListPath_Name">Get Black/White List from external Path (URL/UNC/Local)</string>
51+
<string id="ListPath_Explain">If this policy is enabled, you can set a (URL/UNC/Local) Path to external lists other than the default.
52+
If "Application GPO Blacklist/Whitelist" is set, this policy setting is ignored.
5353

5454
If this policy is disabled or not configured, the default ListPath is used (WAU InstallLocation).</string>
5555
<string id="ModsPath_Name">Get Mods from external Path (URL/UNC/Local/AzureBlob)</string>
@@ -163,7 +163,7 @@ If this policy is disabled or not configured, the default no delay.</string>
163163
</presentation>
164164
<presentation id="ListPath">
165165
<textBox refId="ListPath">
166-
<label>(URL/UNC/GPO/Local) Path:</label>
166+
<label>(URL/UNC/Local) Path:</label>
167167
</textBox>
168168
</presentation>
169169
<presentation id="ModsPath">

Sources/Policies/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@ In an enterprise environment, it's crucial that different groups can have differ
77
## Administrative Template
88

99
### To an Individual Computer
10-
1. Copy the **`WAU.admx`** file to your Policy Definitions template folder.
11-
Example: `C:\Windows\PolicyDefinitions`
12-
2. Copy the **`WAU.adml`** file to the matching language folder in your Policy Definitions folder.
13-
Example: `C:\Windows\PolicyDefinitions\en-US`
10+
1. Copy the **`WAU.admx`** file to your Policy Definitions template folder.
11+
>Example: `C:\Windows\PolicyDefinitions`
12+
2. Copy the **`WAU.adml`** file to the matching language folder in your Policy Definitions folder.
13+
>Example: `C:\Windows\PolicyDefinitions\en-US`
1414
1515
### To Active Directory
1616
1. On a domain controller or workstation with [RSAT](https://learn.microsoft.com/en-us/troubleshoot/windows-server/system-management-components/remote-server-administration-tools), go to the **PolicyDefinitions** folder (also known as the _Central Store_) on any domain controller for your domain.
17-
2. Copy the **`WAU.admx`** file to the PolicyDefinitions folder.
18-
Example: `%systemroot%\sysvol\domain\policies\PolicyDefinitions`
19-
3. Copy the **`WAU.adml`** file to the matching language folder in the PolicyDefinitions folder. Create the folder if it doesn't already exist.
20-
Example: `%systemroot%\sysvol\domain\policies\PolicyDefinitions\en-US`
17+
2. Copy the **`WAU.admx`** file to the PolicyDefinitions folder.
18+
>Example: `%systemroot%\sysvol\domain\policies\PolicyDefinitions`
19+
3. Copy the **`WAU.adml`** file to the matching language folder in the PolicyDefinitions folder. Create the folder if it doesn't already exist.
20+
>Example: `%systemroot%\sysvol\domain\policies\PolicyDefinitions\en-US`
2121
4. If your domain has more than one domain controller, the new [ADMX files](https://learn.microsoft.com/en-us/troubleshoot/windows-client/group-policy/create-and-manage-central-store) will be replicated to them at the next domain replication interval.
2222

2323
## Intune
2424

25-
Please follow the comprehensive Microsoft documentation to import and manage the WAU policies:
25+
Please follow the comprehensive Microsoft documentation to import and manage the WAU policies:
2626
[Import and Manage Administrative Templates in Intune](https://learn.microsoft.com/en-us/mem/intune-service/configuration/administrative-templates-import-custom#add-the-admx-and-adml-files)
2727

2828
## Important Notes
2929

30-
- When using GPO or Intune policies, you need to enable `Activate WAU GPO Management` for the policies to work. This setting is not intuitive and should be part of any decommissioning considerations.
3130
- This project only supports the `en-US` ADML file.

0 commit comments

Comments
 (0)