Packaging & Installer Architecture
NH Reader utilizes Tauri v2 Native Packaging (tauri build) for local builds of Windows, macOS, Linux, Android, and iOS packages. Packages are not signed or published by CI; there is no automated packaging workflow. iOS builds require macOS, Xcode, and Apple signing credentials.
🧭 Why Native Packaging Over Custom Installers
In earlier versions, a custom embedded installer was evaluated. However, custom installers in Tauri v2 present significant architectural challenges:
- Asset & Webview Bundling: Native packaging automatically links and bundles frontend static assets, webview loaders, and platform runtime dependencies into the output binary package.
- Elevation & UAC: Windows User Account Control (UAC) handling during custom installs often causes file-locking collisions and permission errors when updating program files.
- Uninstallation & System Registry: Native installers (NSIS and WiX) manage system uninstaller registrations, start menu entries, and desktop shortcuts cleanly through standard OS facilities.
- Mobile & Cross-Platform Alignment: Tauri’s native packaging toolchain cleanly supports Android APK packaging alongside desktop installers.
📦 Bundling Pipeline
flowchart TD
A[npm run tauri:build:release / tauri build] --> B[SvelteKit build static]
B --> C[Rust cargo build release]
C --> D{Platform Bundler}
D -->|Windows| E[NSIS setup.exe]
D -->|Windows| F[WiX .msi]
D -->|macOS| G[DMG & .app bundle]
D -->|Linux| H[deb & AppImage]
D -->|Android| I[APK]
Build Commands
# Desktop release build (bundles NSIS, WiX MSI, DMG, or deb/AppImage)
npm run tauri:build:release
# Debug desktop build (unoptimized, useful for rapid testing)
npm run tauri:build:debug
# Android mobile build pipeline
npm run tauri:android:init # initialize Android studio project
npm run tauri:android:build # compile standalone APK
⚙️ Configuration (src-tauri/tauri.conf.json)
Packaging is configured under the bundle key in src-tauri/tauri.conf.json:
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"nsis": {
"installMode": "both",
"installerIcon": "icons/icon.ico",
"headerImage": null,
"sidebarImage": null,
"languages": ["English"]
},
"wix": {
"language": "en-US"
}
},
"macOS": {
"dmg": {
"windowSize": { "width": 600, "height": 400 },
"appPosition": { "x": 180, "y": 170 },
"applicationFolderPosition": { "x": 420, "y": 170 }
}
}
}
🎨 Customizing NSIS & WiX Installers
Tauri v2 allows deep customization of Windows installers without breaking native stability:
- NSIS Installation Mode (
installMode: "both"):- Gives the user a choice between “Install for anyone who uses this computer (all users)” or “Install just for me (current user)”.
- Visual Assets:
headerImage: 150x57 BMP header graphic displayed during installation. (Not used by NH Reader: the composed wide banner renders as a small left-aligned top-bar graphic in NSIS, so the option was removed from our config.)sidebarImage: 164x314 BMP graphic displayed on the Welcome and Finish wizard pages. (The only visual asset NH Reader uses:src-tauri/windows/sidebar.bmp.)
- Custom NSIS Hooks (
customLanguageFiles, custom.nshincludes):- For custom registry entries, environment variables, or custom styling.
- WiX Templates:
- For corporate deployment, custom
.wxsfragments can be injected into the WiX MSI compilation.
- For corporate deployment, custom
- Related: Installation & Maintenance · Architecture · Security
📚 Documentation Index
- Core: Home · Getting Started · Installation & Maintenance
- App Features: Search & Filters · Blacklist · Favorites & History · Reader & Galleries · Settings & API Key · Localization
- Architecture & Development: Architecture · Backend (Rust) · Frontend (SvelteKit) · Packaging & Bundling · Development & Contributing
- Reference: Security · Privacy · Troubleshooting · FAQ
NH Reader — a lightweight, modern, cross-platform client for nhentai.net.
Documentation Home · Repository · Releases · Security · Privacy · TOS · License