Portfolio / PowerShell lane / Brave-Portable-Updater
PS

Brave-Portable-Updater

Update Brave inside a Portapps portable install without touching system install

PowerShell
Delivery
Source-first
Browse code, README, and release notes on GitHub.
Primary lane
PowerShell lane
The clearest adjacent context for this project inside the portfolio.
Freshness
Updated May 19, 2026
Latest release
No tag yet
README is the clearest project overview right now.

Preview

Using the generated project card as a clean fallback until a live capture is available.

Brave-Portable-Updater card

Source at github.com/SysAdminDoc/Brave-Portable-Updater.

README

Cached at build time, cleaned up for in-site reading, and linked back to the canonical GitHub source.

3 min read 496 words 9 sections
Contents
  1. Brave-Portable-Updater
  2. Why this exists
  3. Files
  4. Install
  5. Usage
  6. Autorun at boot
  7. How it actually works
  8. Compatibility
  9. License

Brave-Portable-Updater

![Version](https://img.shields.io/badge/version-1.0.1-blue?style=flat-square) ![License](https://img.shields.io/badge/license-MIT-green?style=flat-square) ![Platform](https://img.shields.io/badge/platform-Windows%2010%20%7C%2011-0078D4?style=flat-square&logo=windows) ![PowerShell](https://img.shields.io/badge/PowerShell-5.1%2B-5391FE?style=flat-square&logo=powershell&logoColor=white)

A safe, path-scoped PowerShell updater for the Portapps brave-portable distribution. Updates the inner Brave bundle in place while leaving your system-wide Brave install and your portable user profile untouched.

Why this exists

Most existing updater scripts have one of two problems:

  1. They run Get-Process brave | Stop-Process, which kills the installed full version of Brave along with the portable one, dropping every tab in your main session.
  2. They track versions by parsing version-stamped subfolder names under app\. Portapps doesn't use a version subfolder - it puts brave.exe and the Chromium bundle directly in app\ - so those scripts re-download on every run.

This updater fixes both, plus a few extras:

  • Path-scoped process termination. Only stops brave.exe / brave-portable.exe whose .Path lives under the portable root. The full install is provably untouched.
  • Version detection from the binary. Reads app\brave.exe's VersionInfo.ProductVersion, strips the Chromium-major prefix, and compares against github.com/brave/brave-browser release tags.
  • Atomic swap. Extracts to app.new\, renames app to app.old, promotes app.new to app, then deletes app.old. A failed extract leaves the previous install intact.
  • Best-effort SHA256 verification when the release notes publish a hash.
  • Updates portapp.json so the wrapper UI shows the correct version.
  • Logs to <root>\log\update.log in ISO timestamp format.
  • Refuses to run if the target dir doesn't look like a Portapps install (no brave-portable.exe, no data\).

Files

File Purpose
Update-BravePortable.ps1 The updater.
Update-BravePortable.bat Forwards args to the PS1, pauses on non-zero exit.
update.bat One-click default run (stable channel, pauses at end).
update_then_run_brave.bat Update, then launch brave-portable.exe.
run_at_boot.ps1 Registers a Scheduled Task that runs the updater at every system startup.

Install

Copy the contents of this repo into your Brave-Portable updater dir of choice (it doesn't have to live next to brave-portable.exe - the script accepts -PortableRoot):

git clone https://github.com/SysAdminDoc/Brave-Portable-Updater.git

Or download the ZIP and extract anywhere.

Usage

# Default: stable channel, targets C:\brave-portable-work
.\Update-BravePortable.ps1

# Other channels
.\Update-BravePortable.ps1 -Channel beta
.\Update-BravePortable.ps1 -Channel nightly

# Different install location
.\Update-BravePortable.ps1 -PortableRoot "D:\Apps\Brave"

# Reinstall current version (e.g. after corruption)
.\Update-BravePortable.ps1 -Force

# Quiet (file log only) - useful for scheduled tasks
.\Update-BravePortable.ps1 -Quiet

Exit codes: 0 already-current or updated successfully, non-zero on failure.

Autorun at boot

# Elevates and registers a Scheduled Task named "BravePortableUpdate"
.\run_at_boot.ps1

Manage the task:

schtasks /run    /tn BravePortableUpdate
schtasks /query  /tn BravePortableUpdate /v /fo LIST
schtasks /delete /tn BravePortableUpdate /f

How it actually works

  1. Sanity-check the target dir: must contain brave-portable.exe and data\.
  2. Read installed version from app\brave.exe's ProductVersion. Brave's ProductVersion is the Chromium major prefixed onto the Brave version (e.g. 148.1.90.122 = Chromium 148 + Brave 1.90.122). Drop the first segment to get the comparable Brave version (1.90.122).
  3. Query api.github.com/repos/brave/brave-browser/releases?per_page=80. Filter by channel keyword (Release / Beta / Nightly), pick the first release with a brave-v*-win32-x64.zip asset.
  4. If installed >= remote, exit 0. Otherwise download via BITS (fallback Invoke-WebRequest) to %TEMP%.
  5. If the release notes contain a SHA256 line matching the asset name, verify the hash.
  6. Find every brave.exe / brave-portable.exe process whose .Path starts with the portable root. Stop only those. Sleep 2s for file handles to release.
  7. Extract zip to <root>\app.new\. If the zip has a single top-level folder, flatten it.
  8. Sanity-check app.new\brave.exe exists. If not, abort.
  9. Rename app to app.old, app.new to app, then delete app.old.
  10. Patch version and date in portapp.json so the wrapper UI is consistent.

Compatibility

License

MIT

Read on GitHub → github.com/SysAdminDoc/Brave-Portable-Updater

Esc
Start with the strongest work, a key route, or the full archive.