Repository navigation
0.2.0
0.2.0 – GUI auto-update, script self-update & safer defaults
Minor feature release for NetBird Delayed Auto-Update for Windows (Chocolatey).
Note: this 0.2.0 release was updated once more to fix a PowerShell parsing error in some logging lines.
The tag and version number remain0.2.0, butnetbird-delayed-update.ps1is now the corrected version.
This version adds automatic updates for the NetBird GUI, a self-update mechanism for the script itself, and changes the default delay to 10 days so short-lived / bad releases are less likely to be deployed.
✨ Highlights
🖥 GUI auto-update
- On each run, the script:
- Reads the latest NetBird release from GitHub to get the version number.
- Downloads the latest Windows x64 GUI installer from
https://pkgs.netbird.io/windows/x64. - Runs the installer silently (
/S).
- The last installed GUI version is tracked in:
C:\ProgramData\NetBirdDelayedUpdate\gui-state.json
- If the stored GUI version matches the latest release, the installer is skipped (no redundant reinstall).
🔁 Script self-update
-
The script can now update itself based on GitHub releases of this repo:
- Fetches
releases/latestforNetHorror/netbird-delayed-auto-update-windows. - Compares the release tag (e.g.
0.2.0) against the local$ScriptVersionconstant.
- Fetches
-
If the remote version is newer:
- Tries to locate a
.gitrepository above the script path and run:
- Tries to locate a
git pull --ff-only- If
gitis unavailable or the script is not inside a repo, falls back to HTTP:- Downloads
netbird-delayed-update.ps1from
https://raw.githubusercontent.com/NetHorror/netbird-delayed-auto-update-windows/<tag>/netbird-delayed-update.ps1 - Overwrites the local script file.
- Downloads
-
The updated script file is used on the next run; the current run continues with the old version.
-
Script version is duplicated in two places for convenience:
- Header comment at the top of the file:
# Version: 0.2.0 $ScriptVersion = [version]"0.2.0"inside the Script self-update settings block.
- Header comment at the top of the file:
⚙️ Behaviour changes
-
Default delay increased to 10 days
DelayDaysdefault changed from3to10.- New Chocolatey NetBird versions must now “age” for 10 days before upgrade.
- Still configurable via
-DelayDays.
-
More robust version parsing
- Version parsing for Chocolatey output now accepts both 3-part and 4-part versions, e.g.:
0.60.70.60.7.1
- Version parsing for Chocolatey output now accepts both 3-part and 4-part versions, e.g.:
-
Graceful handling when the package is not installed
- If
netbird(or a custom-PackageName) is not installed locally:- The script logs a message and exits with 0 (no error),
- Instead of treating the situation as a failure.
- If
-
Fixed PowerShell parsing errors (updated 0.2.0)
- Logging lines that used
$($_.Exception.Message)were refactored to use formatted strings, eliminating “string is missing the terminator” parse errors on some environments.
- Logging lines that used
-
Core logic unchanged
- The delayed rollout behaviour for the daemon via Chocolatey remains the same:
- Version “aging” via
state.json. - Random delay before each run via
MaxRandomDelaySeconds. - Optional
-StartWhenAvailablesupport for missed task runs.
- Version “aging” via
- Existing scheduled tasks continue to work without modification.
- The delayed rollout behaviour for the daemon via Chocolatey remains the same:
📂 New / updated files
-
Script
netbird-delayed-update.ps1- Contains GUI update logic, self-update logic and the new default
DelayDays=10. - Top-of-file version comment:
# Version: 0.2.0. $ScriptVersion = [version]"0.2.0"in the self-update settings section.
- Contains GUI update logic, self-update logic and the new default
-
State files (existing + new)
Located in:
C:\ProgramData\NetBirdDelayedUpdate\
-
state.json– existing daemon/Chocolatey aging state (unchanged format). -
gui-state.json– new file for GUI version tracking. -
Docs
README.mdupdated:- Describes GUI auto-update and self-update.
- Reflects
DelayDays=10as the default. - Mentions
CHANGELOG.mdand the versioning scheme.
CHANGELOG.md– maps GitHub releases to script versions.
🚀 Upgrade instructions
-
Update the script file
- Replace your local
netbird-delayed-update.ps1with the version from this release (or rungit pull). - Ensure the header and
$ScriptVersionboth show0.2.0.
- Replace your local
-
(Optional) Reinstall the scheduled task
If you want the new default
DelayDays=10or changed parameters, reinstall:
powershell -ExecutionPolicy Bypass -File .\netbird-delayed-update.ps1 -Uninstall
powershell -ExecutionPolicy Bypass -File .\netbird-delayed-update.ps1 -InstallAdd -StartWhenAvailable and/or -RunAsCurrentUser if needed.
-
Verify
- Optionally run a one-off check:
powershell -ExecutionPolicy Bypass -File .\netbird-delayed-update.ps1 -DelayDays 0 -MaxRandomDelaySeconds 0- Next scheduled run will:
- Attempt script self-update.
- Perform the delayed daemon upgrade via Chocolatey.
- Perform GUI auto-update (if a newer GUI version is available).
If you prefer to disable self-update, you can:
- Set
$ScriptRepo = ""in the script, or - Comment out the
Invoke-SelfUpdateByReleasecall at the end of the file.