Tauri Bootstrap Installer
Relevant source files
The following files were used as context for generating this wiki page:
The Tauri Bootstrap Installer is a native utility designed to orchestrate the initial setup and update process for the J.A.R.V.I.S. desktop application. It functions by driving a bundled PowerShell script (install.ps1) on Windows, streaming real-time execution logs and stage transitions to a polished React-based frontend via Tauri's event system.
The installer operates in two primary modes: a bare launch for initial onboarding (install) and a hand-off launch from the main desktop application for updates (update). It manages dependency downloading, environment configuration, and repository setup, providing users with a visual progress indicator and diagnostic logs throughout the operation.
Sources: apps/bootstrap-installer/src-tauri/src/lib.rs:1-8, apps/bootstrap-installer/src/store.ts:60-65
Architecture and Core Logic
The system utilizes a client-server architecture where the Rust-based Tauri backend handles heavy orchestration—such as process spawning and network probes—while the TypeScript/React frontend manages the UI state.
Backend Orchestration
The backend is powered by a central AppState which tracks a BootstrapHandle. This handle contains synchronization primitives like an mpsc::Sender for cancellation and an Instant timestamp to track duration. The core installation logic is encapsulated in run_bootstrap, which executes the following sequence:
- GitHub Version Probe: Performs an asynchronous network request to the GitHub API to check for the latest release.
- Script Resolution: Locates the bundled
install.ps1within the application's resource directory or side-by-side with the executable. - PowerShell Execution: Spawns the installation script, providing arguments for the install root and source paths.
- Event Streaming: Intercepts
stdoutandstderrto detect[stage:NAME]markers, which are then broadcast to the frontend as typedBootstrapEventobjects.
Sources: apps/bootstrap-installer/src-tauri/src/bootstrap.rs:43-51, apps/bootstrap-installer/src-tauri/src/bootstrap.rs:135-155, apps/bootstrap-installer/src-tauri/src/bootstrap.rs:334-350
Frontend State Management
The frontend uses nanostores to maintain a single source of truth. It subscribes to the bootstrap event channel and translates raw payloads into a BootstrapStateModel. This model tracks the global status (idle, running, completed, failed), an ordered list of installation stages, and a bounded buffer of logs.
The diagram above illustrates the communication flow between the React frontend, the Rust orchestration layer, and the external installation script.
Sources: apps/bootstrap-installer/src/store.ts:35-50, apps/bootstrap-installer/src-tauri/src/bootstrap.rs:240-265
Installation Stages
The installer breaks the process into granular, user-visible stages. This allows the UI to show specific progress for long-running operations like downloading large dependencies.
| Stage Name | Title | Description |
|---|---|---|
github-check | GitHub-Version pruefen | Asynchronous probe to the repository API for the latest version. |
prepare | Vorbereiten | Initial environment preparation and path validation. |
copy | Dateien kopieren | Transfer of bundled application files to the target directory. |
shortcut | Verknuepfung erstellen | Creation of desktop or start menu shortcuts. |
finalize | Abschliessen | Post-installation cleanup and registry/path finalization. |
Sources: apps/bootstrap-installer/src-tauri/src/bootstrap.rs:156-189
Technical Implementation Details
Data Structures (Rust)
The backend defines several key structures for managing the lifecycle and communication.
// From apps/bootstrap-installer/src-tauri/src/bootstrap.rs:16-41
pub struct StartBootstrapArgs {
pub commit: Option<String>,
pub branch: Option<String>,
pub include_desktop: bool,
pub jarvis_home: Option<String>,
pub install_path: Option<String>,
}
pub struct BootstrapStatus {
pub running: bool,
pub completed: bool,
pub install_root: Option<String>,
pub last_error: Option<String>,
}
Event System
The communication utilizes a single bootstrap channel. Events are discriminated by a type field in the JSON payload, allowing the frontend to handle manifests, stage updates, logs, and completion/failure signals separately.
Sequence showing the handshake and event-driven updates during the installation process.
Sources: apps/bootstrap-installer/src/store.ts:105-185, apps/bootstrap-installer/src-tauri/src/bootstrap.rs:238-305
User Interface and Progress Tracking
The ProgressScreen component serves as the primary view during installation. It provides:
- Elapsed Timers: A live counter that ticks every second for the active stage, ensuring the user knows the app hasn't frozen during long tasks.
- Log Viewer: A collapsible mono-spaced log panel that displays raw output from the installation script.
- Progress Bar: A visual representation of completed stages versus total stages, derived from a computed store value.
- Conditional Routing: Automatically routes to the
successscreen upon receiving thecompleteevent, or thefailurescreen if the script exits with an error.
Sources: apps/bootstrap-installer/src/routes/progress.tsx:40-100, apps/bootstrap-installer/src/store.ts:70-80
Diagnostic and Path Functions
The installer provides several static commands to allow the frontend to display path information and diagnostic logs.
| Command | Return Type | Path (Windows Default) |
|---|---|---|
get_install_root | String | %LOCALAPPDATA%\Programs\Jarvis-Glas\Jarvis-Glas |
get_log_path | String | %LOCALAPPDATA%\jarvis\logs\bootstrap-installer.log |
get_jarvis_home | String | %LOCALAPPDATA%\jarvis |
open_log_dir | Result | Opens %LOCALAPPDATA%\Programs\Jarvis-Glas in Explorer. |
Sources: apps/bootstrap-installer/src-tauri/src/lib.rs:48-73, apps/bootstrap-installer/src-tauri/src/bootstrap.rs:105-120
Conclusion
The Tauri Bootstrap Installer provides a robust, native entry point for managing the lifecycle of the J.A.R.V.I.S. environment. By bridging Rust's low-level process management with a modern React frontend, it ensures a reliable setup experience while maintaining technical transparency through real-time logging and stage-based progress tracking.