Skip to content

0.2.0

Choose a tag to compare

@NetHorror NetHorror released this 08 Dec 02:48
· 12 commits to main since this release
76c4c8c

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 remain 0.2.0, but netbird-delayed-update.ps1 is 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/latest for NetHorror/netbird-delayed-auto-update-windows.
    • Compares the release tag (e.g. 0.2.0) against the local $ScriptVersion constant.
  • If the remote version is newer:

    1. Tries to locate a .git repository above the script path and run:
git pull --ff-only
  1. If git is unavailable or the script is not inside a repo, falls back to HTTP:
    • Downloads netbird-delayed-update.ps1 from
      https://raw.githubusercontent.com/NetHorror/netbird-delayed-auto-update-windows/<tag>/netbird-delayed-update.ps1
    • Overwrites the local script file.
  • 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.

⚙️ Behaviour changes

  • Default delay increased to 10 days

    • DelayDays default changed from 3 to 10.
    • 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.7
      • 0.60.7.1
  • 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.
  • 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.
  • 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 -StartWhenAvailable support for missed task runs.
    • Existing scheduled tasks continue to work without modification.

📂 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.
  • 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.md updated:
      • Describes GUI auto-update and self-update.
      • Reflects DelayDays=10 as the default.
      • Mentions CHANGELOG.md and the versioning scheme.
    • CHANGELOG.md – maps GitHub releases to script versions.

🚀 Upgrade instructions

  1. Update the script file

    • Replace your local netbird-delayed-update.ps1 with the version from this release (or run git pull).
    • Ensure the header and $ScriptVersion both show 0.2.0.
  2. (Optional) Reinstall the scheduled task

    If you want the new default DelayDays=10 or changed parameters, reinstall:

powershell -ExecutionPolicy Bypass -File .\netbird-delayed-update.ps1 -Uninstall
powershell -ExecutionPolicy Bypass -File .\netbird-delayed-update.ps1 -Install

Add -StartWhenAvailable and/or -RunAsCurrentUser if needed.

  1. Verify

    • Optionally run a one-off check:
powershell -ExecutionPolicy Bypass -File .\netbird-delayed-update.ps1 -DelayDays 0 -MaxRandomDelaySeconds 0
  • Next scheduled run will:
    1. Attempt script self-update.
    2. Perform the delayed daemon upgrade via Chocolatey.
    3. 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-SelfUpdateByRelease call at the end of the file.