Skip to content

Commit 479d6ed

Browse files
authored
Merge pull request #1015 from Romanitho/feature/admx_version
Add version in ADMX name.
2 parents 40a7e8d + ef784a3 commit 479d6ed

File tree

5 files changed

+52
-40
lines changed

5 files changed

+52
-40
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,24 @@ 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
111122
# Step 4: Create stable GitHub release with all artifacts
@@ -116,13 +127,13 @@ jobs:
116127
prerelease: false # This is a stable release
117128
generateReleaseNotes: true
118129
name: WAU ${{ steps.release_version.outputs.NextSemVer }}
119-
artifacts: "WAU.msi,WAU_ADMX.zip"
130+
artifacts: "WAU.msi,${{ steps.build_project.outputs.admx_zip_name }}"
120131
body: |
121132
## Files
122133
|Files|Hash (SHA256)|Downloads|
123134
|---|---|---|
124135
|[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>|
125-
|[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>|
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>|
126137
127138
sync:
128139
name: Sync develop with main

.github/workflows/GitFlow_Nightly-builds.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# - Checks for merged PRs since the last tag
33
# - Creates a pre-release version if changes are detected
44
# - Builds and packages the software
5-
# - Creates GitHub release with artifacts and download counters
5+
# - Creates GitHub release with artifacts
66

77
name: GitFlow | Nightly Builds
88

@@ -43,28 +43,28 @@ jobs:
4343
# Get the latest release tag (any type)
4444
$LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1
4545
Write-Host "Latest release: $LATEST_TAG"
46-
46+
4747
# Get all merged PRs since last tag (only merge commits from PRs)
4848
$MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$LATEST_TAG..develop"
49-
49+
5050
# Count merges
5151
$MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count
52-
52+
5353
if ($MERGE_COUNT -eq 0) {
5454
Write-Host "No PRs merged to develop since last tag. Skipping build."
5555
$BUILD_NEEDED = $false
5656
}
5757
else {
5858
Write-Host "Merged PRs since last tag (develop):"
5959
Write-Host $MERGED_PRS
60-
60+
6161
if ($MERGE_COUNT -eq 1 -and $MERGED_PRS -match "Merge pull request #\d+ from .*/release/") {
6262
Write-Host "Only change since last tag is a release PR merge. Skipping build."
6363
$BUILD_NEEDED = $false
6464
}
6565
else {
6666
$BUILD_NEEDED = $true
67-
67+
6868
# Set release type for output (adapts to your previous logic if you need it)
6969
if ($LATEST_TAG -like "*-*") {
7070
$RELEASE_TYPE = "prerelease"
@@ -158,13 +158,24 @@ jobs:
158158
159159
# Package ADMX policy templates
160160
echo "### Zip ADMX ###"
161-
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\WAU_ADMX.zip -Force
161+
$admxPath = ".\Sources\Policies\ADMX\WAU.admx"
162+
try {
163+
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null
164+
$ADMXversion = $matches[1]
165+
$admxZip = "WAU_ADMX_$($ADMXversion).zip"
166+
}
167+
catch {
168+
Write-Host "Error getting WAU ADMX version!"
169+
$admxZip = "WAU_ADMX.zip"
170+
}
171+
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\$admxZip -Force
162172
Get-Item .\*.zip
173+
echo "admx_zip_name=$admxZip" >> $env:GITHUB_OUTPUT
163174
164175
# Calculate ADMX package hash for verification
165176
echo "### Get ADMX zip SHA ###"
166-
$ADMXSHA = (Get-FileHash .\WAU_ADMX.zip).hash
167-
echo " - WAU_ADMX.zip SHA256: $ADMXSHA"
177+
$ADMXSHA = (Get-FileHash .\$admxZip).hash
178+
echo " - $admxZip SHA256: $ADMXSHA"
168179
echo "admx_sha=$ADMXSHA" >> $env:GITHUB_OUTPUT
169180
170181
# Step 6: Create GitHub release with all artifacts
@@ -177,7 +188,7 @@ jobs:
177188
prerelease: true
178189
generateReleaseNotes: true
179190
name: ${{ steps.format_version.outputs.ReleaseName }}
180-
artifacts: "WAU.msi,WAU_ADMX.zip"
191+
artifacts: "WAU.msi,${{ steps.build_project.outputs.admx_zip_name }}"
181192
body: |
182193
${{ steps.format_version.outputs.ReleaseBodyIntro }}
183194
@@ -187,4 +198,4 @@ jobs:
187198
|Files|Hash (SHA256)|Downloads|
188199
|---|---|---|
189200
|[WAU.msi](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.format_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.format_version.outputs.NextSemVer }}/WAU.msi?style=flat-square&label=&color=blue)</picture>|
190-
|[WAU_ADMX.zip](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.format_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.format_version.outputs.NextSemVer }}/WAU_ADMX.zip?style=flat-square&label=&color=blue)</picture>|
201+
|[${{ steps.build_project.outputs.admx_zip_name }}](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.format_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.format_version.outputs.NextSemVer }}/${{ steps.build_project.outputs.admx_zip_name }}?style=flat-square&label=&color=blue)</picture>|

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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/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.

Sources/Winget-AutoUpdate/config/WAU-MSI_Actions.ps1

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,6 @@ function Install-WingetAutoUpdate {
164164

165165
}
166166

167-
#Add 1 to Github counter file
168-
try {
169-
Invoke-WebRequest -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v$($WAUconfig.ProductVersion)/WAU_InstallCounter" -UseBasicParsing | Out-Null
170-
Write-Host "-> Reported installation."
171-
}
172-
catch {
173-
Write-Host "-> Not able to report installation."
174-
}
175-
176167
Write-Host "### WAU MSI Post actions succeeded! ###"
177168

178169
}

0 commit comments

Comments
 (0)