Windows Bootstrapper Installer
Relevant source files
The following files were used as context for generating this wiki page:
The Windows Bootstrapper Installer is a specialized Tauri-based application designed to provide a modern, sleek user interface for the mausVoice installation process on Windows. It serves as a wrapper for the standard NSIS installer, providing a high-level UI with progress tracking and post-installation actions, such as launching the main application immediately after setup.
Sources: apps/windows-installer/BUILD.md:3-8, apps/windows-installer/src/main.ts:1-10
Architecture and Components
The bootstrapper is built using the Tauri v2 framework, utilizing a Rust backend for native operations (file extraction and process execution) and a TypeScript/Vite frontend for the user interface.
Core Components
| Component | Responsibility |
|---|---|
| Rust Backend | Handles embedding, extracting, and executing the NSIS installer. |
| TypeScript Frontend | Manages the installer state machine (idle, installing, complete, error). |
| NSIS Installer | The actual mausVoice setup executable (mausVoice_Setup.exe) bundled as a resource. |
| WebView2 | Render engine for the UI, bundled as an offline installer for reliability. |
Sources: apps/windows-installer/src-tauri/src/main.rs:1-15, apps/windows-installer/src/main.ts:20-40, apps/windows-installer/BUILD.md:52-54
Data Flow Diagram
The following diagram illustrates the interaction between the TypeScript frontend and the Rust backend during the installation process.
The flow shows how the frontend triggers native Rust commands to handle the binary extraction and silent execution of the internal NSIS installer.
Sources: apps/windows-installer/src-tauri/src/main.rs:25-70, apps/windows-installer/src/main.ts:55-75
Native Installation Logic
The Rust backend is responsible for the heavy lifting of the installation. It uses the include_bytes! macro to embed the main application's NSIS installer directly into the bootstrapper binary.
Key Functions
extract_installer(): Writes the embedded bytes to the system's temporary directory asmausVoice_Setup.exe.start_installation(): Orchestrates the process by extracting the file, spawning the NSIS process with the/S(silent) and/D=(directory) flags, and emitting progress events to the frontend.get_installed_app_path(): SearchesLOCALAPPDATAandPROGRAMFILESto locate themausVoice.exeexecutable after installation completes.
Sources: apps/windows-installer/src-tauri/src/main.rs:15-23, apps/windows-installer/src-tauri/src/main.rs:37-45, apps/windows-installer/src-tauri/src/main.rs:90-115
Installation Sequence
Frontend State Management
The frontend uses an Installer class to manage the UI state and listen for backend events. It transitions through several states to update the user on progress.
Installer States
idle: Initial state upon launch.installing: Backend is currently running the NSIS setup.complete: Installation finished successfully; provides a "Launch" button.error: Installation failed; displays an error message and a "Retry" button.
Sources: apps/windows-installer/src/main.ts:11-12, apps/windows-installer/src/main.ts:43-65
Configuration
The bootstrapper window is configured with specific dimensions and security settings in tauri.conf.json.
| Parameter | Value | Description |
|---|---|---|
| Width | 480 | Fixed width for the installer window. |
| Height | 320 | Fixed height for the installer window. |
| Resizable | false | The window cannot be resized by the user. |
| AlwaysOnTop | true | Ensures the installer remains visible during setup. |
| Decorations | false | Custom UI handling without standard OS window borders. |
Sources: apps/windows-installer/src-tauri/tauri.conf.json:15-24
Build and CI Integration
The bootstrapper is built in a multi-step process that requires the main desktop app to be built first to generate the NSIS setup file.
Build Process Steps
- Build Main App: Run
npm run tauri buildinapps/desktopto producemausVoice_*-setup.exe. - Bundle: Copy the produced NSIS setup to
apps/windows-installer/src-tauri/installer/mausVoice_Setup.exe. - Build Bootstrapper: Run
npm run tauri buildinapps/windows-installer.
Sources: apps/windows-installer/BUILD.md:16-30
CI Workflow (GitHub Actions)
The CI pipeline automates this by setting the CARGO_TARGET_DIR for Windows builds and performing the copy operation before building the installer workspace.
- name: Build Windows Bootstrapper
if: matrix.platform == 'windows-latest'
run: |
cp apps/desktop/src-tauri/target/release/bundle/nsis/mausVoice_*-setup.exe \
apps/windows-installer/src-tauri/installer/mausVoice_Setup.exe
cd apps/windows-installer
npm install
npm run tauri build
Sources: apps/windows-installer/BUILD.md:32-45, personal-fork-ci/workflows/build-desktop.yml:71-75
Conclusion
The Windows Bootstrapper Installer acts as a sophisticated delivery mechanism for mausVoice, bridging the gap between a standard NSIS installation and a modern user experience. By leveraging Tauri's ability to embed and control external processes, it provides progress visibility and automated post-install actions while maintaining a small binary footprint.
Sources: apps/windows-installer/BUILD.md:3-8, apps/windows-installer/src-tauri/src/main.rs:120-130