Skip to content

Fix installer BOM and logger permissions#341

Open
kovtcharov wants to merge 3 commits intomainfrom
kalin/installer-logger-fixes
Open

Fix installer BOM and logger permissions#341
kovtcharov wants to merge 3 commits intomainfrom
kalin/installer-logger-fixes

Conversation

@kovtcharov
Copy link
Copy Markdown
Collaborator

Summary

  • Fix UTF-8 BOM issue in Windows installer script
  • Update logger to write to user space by default
  • Add permission error handling with helpful messages

Changes

Install Script Fix

  • Remove UTF-8 BOM from install.ps1 that caused PowerShell execution error
  • Fixes: The term '#' is not recognized error when running installer

Logger Improvements

  • Change default log location from current directory to ~/.gaia/gaia.log
  • Add PermissionError handling with user-friendly fallback
  • Prevents errors when running from protected directories (e.g., C:\windows\system32)

Testing

  • Verified installer runs without BOM error
  • Tested logger writes to user space from any directory
  • Confirmed helpful error messages display when permissions are insufficient

These fixes improve the first-run experience and prevent common permission issues on Windows.

- Remove UTF-8 BOM from install.ps1 to fix PowerShell execution error
- Update logger to default to ~/.gaia/gaia.log instead of current directory
- Add graceful PermissionError handling with helpful user messages
- Prevents permission errors when running from protected directories like C:\windows\system32
@kovtcharov kovtcharov added this to the v0.17.0 milestone Mar 13, 2026
@kovtcharov kovtcharov modified the milestones: v0.17.0, v0.17.1 Mar 16, 2026
@kovtcharov kovtcharov added installer Installer changes bug Something isn't working labels Mar 16, 2026
@kovtcharov kovtcharov added the p1 medium priority label Mar 27, 2026
kovtcharov added a commit that referenced this pull request Apr 9, 2026
Comprehensive plan for the GAIA Agent UI desktop installer — the
primary install path for non-developer end users. Ground-up
implementation using Lemonade Server's installer as a reference
architecture (not vendored).

Key decisions:
- Distribute via GitHub Releases initially (R2 deferred)
- NSIS on Windows, DMG on macOS, DEB + AppImage on Linux
- Remove the existing Squirrel installer entirely (no migration —
  v0.17.1 users uninstall manually via release-notes step)
- Reuse `bin/gaia-ui.mjs` install logic via a shared
  `services/backend-installer.cjs` module — both the npm CLI and
  the Electron app call it (eliminates the broken Squirrel UX)
- Auto-update via electron-updater + GitHub provider
- `gaia uninstall` CLI as the unifying piece for all four platforms
- Drag-to-trash for macOS uninstall (DMG convention)
- Documentation as a first-class deliverable (Phase I)
- Code signing via SignPath OSS (Windows) + Apple Developer ID (macOS)

Plan is structured as 9 phases (A–I) with explicit dependency
ordering. Phase A is independently mergeable and ships first.

Refs: #530
Related: #341 (folded into Phase B), #597 (left as polish)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kovtcharov added a commit that referenced this pull request Apr 9, 2026
The file began with a UTF-8 BOM (EF BB BF), which causes PowerShell to
fail with: "The term '#' is not recognized as the name of a cmdlet".
Removing the BOM so the script runs cleanly when piped through iex.

Folds in the first of three fixes from the stale PR #341.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kovtcharov added a commit that referenced this pull request Apr 9, 2026
…llback (#341)

GaiaLogger used to default to a relative "gaia.log" in the current
working directory, which had two problems:

1. It littered CWD with log files on every invocation.
2. It crashed with PermissionError when GAIA was invoked from a
   read-only or system directory (e.g. `cd / && gaia ...`), which
   broke the Windows PowerShell one-liner installer from PR #341
   whenever it ran in restricted shells.

Fix:

- Default log_file is now ~/.gaia/gaia.log (created on demand).
- File-handler creation is wrapped in try/except for both
  PermissionError and OSError.
- On failure we try ~/.gaia/gaia.log, then tempfile.gettempdir()
  /gaia.log, then fall back to console-only logging with a friendly
  warning on stderr instead of crashing.

Folds in the logger portion of the stale PR #341.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working installer Installer changes p1 medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants