Skip to content

Commit f66242e

Browse files
authored
Merge pull request #1092 from Romanitho/release/2.9.0
Release 2.9.0
2 parents baa46ac + 63c3d13 commit f66242e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1576
-910
lines changed

.github/workflows/GA_Close-Inactive-Issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
issues: write
1414
pull-requests: write
1515
steps:
16-
- uses: actions/stale@v9
16+
- uses: actions/stale@v10
1717
with:
1818
days-before-issue-stale: 30
1919
days-before-issue-close: 14

.github/workflows/GA_Mega-linter.yml

Lines changed: 5 additions & 5 deletions
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@v5
36+
uses: actions/checkout@v6
3737
with:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939
fetch-depth: 0
@@ -43,7 +43,7 @@ jobs:
4343
id: ml
4444
# You can override MegaLinter flavor used to have faster performances
4545
# More info at https://megalinter.github.io/flavors/
46-
uses: oxsecurity/megalinter@e08c2b05e3dbc40af4c23f41172ef1e068a7d651 # v8.8.0
46+
uses: oxsecurity/megalinter@55a59b24a441e0e1943080d4a512d827710d4a9d # v9.2.0
4747
env:
4848
# All available variables are described in documentation
4949
# https://megalinter.github.io/configuration/
@@ -59,7 +59,7 @@ jobs:
5959
# Upload MegaLinter artifacts
6060
- name: Archive production artifacts
6161
if: ${{ success() }} || ${{ failure() }}
62-
uses: actions/upload-artifact@v4
62+
uses: actions/upload-artifact@v6
6363
with:
6464
name: MegaLinter reports
6565
path: |
@@ -71,7 +71,7 @@ jobs:
7171
- name: Create Pull Request with applied fixes
7272
id: cpr
7373
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
74-
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
74+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
7575
with:
7676
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
7777
commit-message: "[MegaLinter] Apply linters automatic fixes"
@@ -90,7 +90,7 @@ jobs:
9090
run: sudo chown -Rc $UID .git/
9191
- name: Commit and push applied linter fixes
9292
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
93-
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
93+
uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
9494
with:
9595
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
9696
commit_message: "[MegaLinter] Apply linters fixes"

.github/workflows/GitFlow_Check-pull-request-source-branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
# Step 2: If the branch pattern is invalid, add a label and comment to the PR
6060
- name: Handle invalid branch (label + comment)
6161
if: failure()
62-
uses: actions/github-script@v7
62+
uses: actions/github-script@v8
6363
with:
6464
github-token: ${{ secrets.GITHUB_TOKEN }}
6565
script: |
@@ -122,7 +122,7 @@ jobs:
122122
# Step 3: If the branch pattern is corrected, remove label and comment
123123
- name: Clean up if branch is corrected
124124
if: success()
125-
uses: actions/github-script@v7
125+
uses: actions/github-script@v8
126126
with:
127127
github-token: ${{ secrets.GITHUB_TOKEN }}
128128
script: |

.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@v5
38+
uses: actions/checkout@v6
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: 3 additions & 3 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@v5
32+
uses: actions/checkout@v6
3333
with:
3434
token: ${{ secrets.GH_PAT_SYNC }}
3535
lfs: "true"
@@ -121,7 +121,7 @@ jobs:
121121
122122
# Step 4: Create stable GitHub release with all artifacts
123123
- name: Create release
124-
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
124+
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
125125
with:
126126
tag: v${{ steps.release_version.outputs.NextSemVer }}
127127
prerelease: false # This is a stable release
@@ -141,7 +141,7 @@ jobs:
141141
needs: build
142142
steps:
143143
- name: Checkout code
144-
uses: actions/checkout@v5
144+
uses: actions/checkout@v6
145145
with:
146146
fetch-depth: 0
147147
token: ${{ secrets.GH_PAT_SYNC }}

.github/workflows/GitFlow_Nightly-builds.yml

Lines changed: 2 additions & 2 deletions
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@v5
31+
uses: actions/checkout@v6
3232
with:
3333
lfs: "true"
3434
fetch-depth: 0
@@ -180,7 +180,7 @@ jobs:
180180
181181
# Step 6: Create GitHub release with all artifacts
182182
- name: Create release
183-
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
183+
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
184184
if: steps.check_prs.outputs.BUILD_NEEDED == 'true'
185185
with:
186186
tag: v${{ steps.format_version.outputs.NextSemVer }}

README.md

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ 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:
43-
![explorer](https://github.com/user-attachments/assets/a37837b0-b61e-4ce7-b23c-fd8661585e40)
42+
List and Mods folder content will be copied to WAU install location:
43+
![image](https://github.com/user-attachments/assets/a37837b0-b61e-4ce7-b23c-fd8661585e40)
4444

4545

4646
### Notification Level
@@ -242,17 +242,63 @@ Share your mods with the community:<br>
242242
<https://github.com/Romanitho/Winget-AutoUpdate/discussions/categories/mods>
243243

244244
### Winget native parameters
245-
Another finess is the **AppID** followed by the `-override` suffix as a **text file** (.**txt**) that you can place under the **mods** folder.
245+
You can customize winget behavior per-app using **text files** (.**txt**) placed in the **mods** folder:
246+
247+
#### Override (Full installer control)
248+
Use **AppID**`-override.txt` to replace ALL installer arguments (without `-h` silent mode).
246249
> Example:<br>
247250
**Adobe.Acrobat.Reader.64-bit-override.txt** with the content `"-sfx_nu /sAll /rs /msi EULA_ACCEPT=YES DISABLEDESKTOPSHORTCUT=1"`
248251

249-
This will use the **content** of the text file as a native **winget --override** parameter when upgrading.
252+
This uses the **content** as a native **winget --override** parameter when upgrading.
250253

251-
Likewise you can use the **AppID** followed by the `-custom` suffix as a **text file** (.**txt**) that you can place under the **mods** folder (*Arguments to be passed on to the installer in addition to the defaults*).
254+
#### Custom (Add installer arguments)
255+
Use **AppID**`-custom.txt` to add extra arguments to the installer (with `-h` silent mode).
252256
> Example:<br>
253257
**Adobe.Acrobat.Reader.64-bit-custom.txt** with the content `"DISABLEDESKTOPSHORTCUT=1"`
254258

255-
This will use the **content** of the text file as a native **winget --custom** parameter when upgrading.
259+
This uses the **content** as a native **winget --custom** parameter when upgrading.
260+
261+
#### Arguments (Winget-level parameters) ⭐ NEW
262+
Use **AppID**`-arguments.txt` to pass **winget parameters** (not installer arguments, with `-h` silent mode).
263+
264+
💡 **Locale Tip:** Many applications revert to English or system default language during WAU upgrades because winget doesn't remember the original installation locale. To prevent this:
265+
- **Best solution:** Use locale-specific package IDs in `included_apps.txt` (e.g., `Mozilla.Firefox.sv-SE` instead of `Mozilla.Firefox`)
266+
- **Alternative:** Create `{AppID}-arguments.txt` with `--locale` parameter to force language on every upgrade
267+
268+
> Example for language control ([#1073](https://github.com/Romanitho/Winget-AutoUpdate/issues/1073)):<br>
269+
**Mozilla.Firefox-arguments.txt** with the content `--locale pl`<br>
270+
*This prevents Firefox from reverting to English after WAU upgrades.*<br>
271+
*Better solution: Use `Mozilla.Firefox.pl` in included_apps.txt instead of `Mozilla.Firefox`.*
272+
273+
> Example for dependency issues ([#1075](https://github.com/Romanitho/Winget-AutoUpdate/issues/1075)):<br>
274+
**Cloudflare.Warp-arguments.txt** with the content `--skip-dependencies`
275+
276+
> Example with multiple parameters:<br>
277+
**Microsoft.VisualStudio.2022.Community-arguments.txt** with the content `--locale en-US --architecture x64`
278+
279+
**Common use cases:**
280+
- `--locale <locale>` - Force application language (e.g., `pl-PL`, `en-US`, `de-DE`)
281+
- 💡 **Recommended alternative:** Use locale-specific package IDs when available (e.g., `Mozilla.Firefox.sv-SE`, `Mozilla.Firefox.de`, `Mozilla.Firefox.ESR.pl`) to get latest versions
282+
- `--skip-dependencies` - Skip dependency installations when they conflict
283+
- `--architecture <arch>` - Force architecture (`x86`, `x64`, `arm64`)
284+
- `--version <version>` - Pin to specific version
285+
- `--ignore-security-hash` - Bypass hash verification
286+
- `--ignore-local-archive-malware-scan` - Skip AV scanning
287+
288+
⚠️ **Important:** When combining `--locale` and `--version`, the specific version must have an installer available for that locale. Not all versions support all locales. Check available versions with `winget show --id <AppID> --versions`.
289+
290+
💡 **Locale Best Practice:** Search for locale-specific packages with `winget search <AppName>` to see if your language has a dedicated package ID (e.g., `Mozilla.Firefox.sv-SE` for Swedish Firefox). These packages are maintained with the latest versions in your preferred language.
291+
292+
**Command-line usage:** You can also pass arguments when calling `Winget-Install.ps1`:
293+
```powershell
294+
.\winget-install.ps1 -AppIDs "Mozilla.Firefox --locale sv-SE"
295+
.\winget-install.ps1 -AppIDs "7zip.7zip, Notepad++.Notepad++"
296+
.\winget-install.ps1 -AppIDs "Adobe.Acrobat.Reader.64-bit --scope machine --override \"-sfx_nu /sAll /msi EULA_ACCEPT=YES\""
297+
```
298+
299+
**Priority:** Override > Custom > Arguments (file) > Arguments (command-line) > Default
300+
301+
See [_AppID-arguments-template.txt](Sources/Winget-AutoUpdate/mods/_AppID-arguments-template.txt) for more examples.
256302

257303

258304
## Known issues
Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,84 @@
11
<#
22
.SYNOPSIS
3-
Handle user interaction from shortcuts and show a Toast notification
3+
Handles user-initiated WAU update checks via shortcut.
44
55
.DESCRIPTION
6-
Act on shortcut run
6+
Provides a user-facing interface to manually trigger WAU update checks.
7+
Displays toast notifications for status updates (starting, running,
8+
completed, or error). Waits for the scheduled task to complete and
9+
shows the result.
710
811
.EXAMPLE
9-
.\user-run.ps1
12+
.\User-Run.ps1
1013
14+
.NOTES
15+
Triggered by desktop shortcut or Start menu entry.
16+
Uses the Winget-AutoUpdate scheduled task.
17+
Shows error details from logs\error.txt if update check fails.
1118
#>
1219

20+
# Check if WAU is currently running
1321
function Test-WAUisRunning {
14-
If (((Get-ScheduledTask -TaskName 'Winget-AutoUpdate').State -eq 'Running') -or ((Get-ScheduledTask -TaskName 'Winget-AutoUpdate-UserContext').State -eq 'Running')) {
15-
Return $True
16-
}
22+
If (((Get-ScheduledTask -TaskName 'Winget-AutoUpdate').State -eq 'Running') -or ((Get-ScheduledTask -TaskName 'Winget-AutoUpdate-UserContext').State -eq 'Running')) {
23+
Return $True
24+
}
1725
}
1826

1927
<# MAIN #>
2028

21-
#Get Working Dir
29+
# Set working directory
2230
$Script:WorkingDir = $PSScriptRoot
2331

24-
#Load external functions
32+
# Load required functions
2533
. $WorkingDir\functions\Get-NotifLocale.ps1
2634
. $WorkingDir\functions\Start-NotifTask.ps1
2735

28-
#Get Toast Locale function
36+
# Load notification locale
2937
Get-NotifLocale
3038

31-
#Set common variables
39+
# Set common notification parameters
3240
$OnClickAction = "$WorkingDir\logs\updates.log"
3341
$Button1Text = $NotifLocale.local.outputs.output[11].message
3442

3543
try {
36-
#Check if WAU is currently running
37-
if (Test-WAUisRunning) {
38-
$Message = $NotifLocale.local.outputs.output[8].message
39-
$MessageType = "warning"
40-
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
41-
break
42-
}
43-
#Run scheduled task
44-
Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction Stop | Start-ScheduledTask -ErrorAction Stop
45-
#Starting check - Send notification
46-
$Message = $NotifLocale.local.outputs.output[6].message
47-
$MessageType = "info"
48-
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
49-
#Sleep until the task is done
50-
While (Test-WAUisRunning) {
51-
Start-Sleep 3
52-
}
44+
# Check if WAU is already running
45+
if (Test-WAUisRunning) {
46+
$Message = $NotifLocale.local.outputs.output[8].message
47+
$MessageType = "warning"
48+
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
49+
break
50+
}
5351

54-
#Test if there was a list_/winget_error
55-
if (Test-Path "$WorkingDir\logs\error.txt") {
56-
$MessageType = "error"
57-
$Critical = Get-Content "$WorkingDir\logs\error.txt" -Raw
58-
$Critical = $Critical.Trim()
59-
$Critical = $Critical.Substring(0, [Math]::Min($Critical.Length, 50))
60-
$Message = "Critical:`n$Critical..."
61-
}
62-
else {
63-
$MessageType = "success"
64-
$Message = $NotifLocale.local.outputs.output[9].message
65-
}
66-
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
52+
# Start the WAU scheduled task
53+
Get-ScheduledTask -TaskName "Winget-AutoUpdate" -ErrorAction Stop | Start-ScheduledTask -ErrorAction Stop
54+
55+
# Send "starting" notification
56+
$Message = $NotifLocale.local.outputs.output[6].message
57+
$MessageType = "info"
58+
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
59+
60+
# Wait for task completion
61+
While (Test-WAUisRunning) {
62+
Start-Sleep 3
63+
}
64+
65+
# Check for errors in the update process
66+
if (Test-Path "$WorkingDir\logs\error.txt") {
67+
$MessageType = "error"
68+
$Critical = Get-Content "$WorkingDir\logs\error.txt" -Raw
69+
$Critical = $Critical.Trim()
70+
$Critical = $Critical.Substring(0, [Math]::Min($Critical.Length, 50))
71+
$Message = "Critical:`n$Critical..."
72+
}
73+
else {
74+
$MessageType = "success"
75+
$Message = $NotifLocale.local.outputs.output[9].message
76+
}
77+
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
6778
}
6879
catch {
69-
#Check failed - Just send notification
70-
$Message = $NotifLocale.local.outputs.output[7].message
71-
$MessageType = "error"
72-
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
80+
# Handle task start failure
81+
$Message = $NotifLocale.local.outputs.output[7].message
82+
$MessageType = "error"
83+
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
7384
}
Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
1-
#Send Notify Script
1+
<#
2+
.SYNOPSIS
3+
Displays a toast notification to the logged-in user.
24
3-
#get xml notif config
5+
.DESCRIPTION
6+
Reads notification configuration from an XML file and displays
7+
a Windows toast notification using the ToastNotificationManager API.
8+
This script is called by a scheduled task when WAU runs in system context.
9+
10+
.NOTES
11+
Configuration file: config\notif.xml
12+
Launcher ID: Windows.SystemToast.WAU.Notification
13+
#>
14+
15+
# Get WAU installation path from registry
416
$WAUinstalledPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" -Name InstallLocation
17+
18+
# Load notification XML configuration
519
[xml]$NotifConf = Get-Content "$WAUinstalledPath\config\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue
620
if (!($NotifConf)) {
721
break
822
}
923

10-
#Load Assemblies
24+
# Load Windows notification assemblies
1125
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
1226
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
1327

14-
#Prepare XML
28+
# Parse notification XML
1529
$ToastXml = [Windows.Data.Xml.Dom.XmlDocument]::New()
1630
$ToastXml.LoadXml($NotifConf.OuterXml)
1731

18-
#Specify Launcher App ID
32+
# Specify toast launcher ID
1933
$LauncherID = "Windows.SystemToast.WAU.Notification"
2034

21-
#Prepare and Create Toast
35+
# Create and display the notification
2236
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
2337
$ToastMessage.Tag = $NotifConf.toast.tag
2438
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($LauncherID).Show($ToastMessage)

0 commit comments

Comments
 (0)