Enrol Chrome from the installers, and drop load-unpacked

Both setup scripts ended by telling you to load the folder unpacked, which is
the one install that cannot update itself - and the policy install they moved
to next does nothing on an unmanaged machine. Enrolment is the step that
actually matters: with it, the extension arrives from the Admin console already
force-installed, and there is nothing else to configure on the box.

So step 7 now asks for an enrolment token instead. The Windows script elevates
itself for it - the token is machine-scoped, and that is the only UAC prompt in
the whole install.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-08-31 16:14:14 -05:00
co-authored by Claude Opus 5
parent 95c073d4c2
commit 35dd15d584
4 changed files with 82 additions and 56 deletions
+18 -15
View File
@@ -141,22 +141,25 @@ else
fi
# ── 7. extension ────────────────────────────────────────────────────────────
# Chrome refuses to side-load a CRX and will not update an unpacked folder, so
# the extension goes in the way a self-hosted one has to: a managed-policy file
# naming our update server. That lives under /etc, hence sudo — there is no
# per-user equivalent on Linux.
# Chrome will not update an unpacked folder, and only force-installs an off-store
# extension on a managed browser. Enrolling in Chrome Enterprise Core is what
# makes this machine's Chrome managed; the extension then arrives from the Admin
# console already set to force install. The token file lives under /etc, hence
# sudo.
echo
info "[7/7] Chrome extension"
info " Installs it from the update server and lets Chrome keep it current"
info " by itself. Needs sudo - the policy file lives under /etc."
read -r -p " Set this up now? [Y/n] " DOEXT
info " Enrols this machine's Chrome, after which the extension installs"
info " itself from the Admin console and stays updated on its own."
info " The token is in the Admin console under Devices > Chrome >"
info " Managed browsers. Blank to skip."
read -r -p " Enrollment token: " ENROLTOKEN
EXTPOLICY=0
if [ "${DOEXT,,}" != "n" ]; then
if sudo bash scripts/install-extension-policy.sh; then EXTPOLICY=1; else
warn "extension policy failed - load $TARGET/extension unpacked for now"
if [ -n "${ENROLTOKEN:-}" ]; then
if sudo bash scripts/enroll-chrome-management.sh "$ENROLTOKEN"; then EXTPOLICY=1; else
warn "enrolment failed - re-run: sudo scripts/enroll-chrome-management.sh <token>"
fi
else
info " Skipped. Run: sudo scripts/install-extension-policy.sh"
info " Skipped. Run: sudo scripts/enroll-chrome-management.sh <token>"
fi
# ── summary ─────────────────────────────────────────────────────────────────
@@ -179,11 +182,11 @@ fi
echo
info "Still manual:"
if [ "$EXTPOLICY" -eq 1 ]; then
info " - Restart Chrome, and remove any unpacked copy of the extension"
info " (it shares the same id now, and Chrome will not load both)"
info " - Restart Chrome. chrome://management should name your organisation,"
info " and the extension installs itself within a minute or two."
else
info " - Load the Chrome extension: chrome://extensions -> Developer mode"
info " -> Load unpacked -> $TARGET/extension"
info " - Enrol Chrome so it can install the extension:"
info " sudo scripts/enroll-chrome-management.sh <token>"
fi
info " - Add your firm credentials on the dashboard's Settings page"
if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -z "${DISPLAY:-}" ]; then