Brave-Portable-Updater
   
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:
- 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. - They track versions by parsing version-stamped subfolder names under
app\. Portapps doesn't use a version subfolder - it putsbrave.exeand the Chromium bundle directly inapp\- 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.exewhose.Pathlives under the portable root. The full install is provably untouched. - Version detection from the binary. Reads
app\brave.exe'sVersionInfo.ProductVersion, strips the Chromium-major prefix, and compares against github.com/brave/brave-browser release tags. - Atomic swap. Extracts to
app.new\, renamesapptoapp.old, promotesapp.newtoapp, then deletesapp.old. A failed extract leaves the previous install intact. - Best-effort SHA256 verification when the release notes publish a hash.
- Updates
portapp.jsonso the wrapper UI shows the correct version. - Logs to
<root>\log\update.login ISO timestamp format. - Refuses to run if the target dir doesn't look like a Portapps install (no
brave-portable.exe, nodata\).
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.gitOr 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 -QuietExit 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.ps1Manage the task:
schtasks /run /tn BravePortableUpdate
schtasks /query /tn BravePortableUpdate /v /fo LIST
schtasks /delete /tn BravePortableUpdate /fHow it actually works
- Sanity-check the target dir: must contain
brave-portable.exeanddata\. - Read installed version from
app\brave.exe'sProductVersion. Brave'sProductVersionis 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). - Query
api.github.com/repos/brave/brave-browser/releases?per_page=80. Filter by channel keyword (Release/Beta/Nightly), pick the first release with abrave-v*-win32-x64.zipasset. - If installed >= remote, exit 0. Otherwise download via BITS (fallback
Invoke-WebRequest) to%TEMP%. - If the release notes contain a SHA256 line matching the asset name, verify the hash.
- Find every
brave.exe/brave-portable.exeprocess whose.Pathstarts with the portable root. Stop only those. Sleep 2s for file handles to release. - Extract zip to
<root>\app.new\. If the zip has a single top-level folder, flatten it. - Sanity-check
app.new\brave.exeexists. If not, abort. - Rename
apptoapp.old,app.newtoapp, then deleteapp.old. - Patch
versionanddateinportapp.jsonso the wrapper UI is consistent.
Compatibility
- Windows 10 / 11
- PowerShell 5.1 or later (ships with Windows)
- Targets the official Brave Windows x64 zip from https://github.com/brave/brave-browser/releases
- Designed for the Portapps wrapper layout (
<root>\app\,<root>\data\,<root>\brave-portable.exe)