Desktop Installer Package Generation Guide

Desktop Installer Package Generation Guide

Prerequisites

```bash

Ensure dependencies are installed

pnpm install

`

1. Build the Frontend

```bash

npx vite build

`

  • Output artifacts to the dist/ directory
  • Completes in approximately 20 seconds

2. Package the Installer

```bash

npx electron-builder --win --config electron-builder.yml

`

  • Output artifacts to the release8/ directory
  • Completes in approximately 10-15 minutes
  • Generated installer: release8/LRAgent-Setup-1.1.0-win-x64.exe (approx. 173MB)

3. One-Step Command (Build + Package)

```bash

npx vite build && npx electron-builder --win --config electron-builder.yml

`

Key Configuration Files

FilePurpose
electron-builder.ymlPackaging configuration (App ID, output directory, included files, NSIS settings)
electron-app/main.jsElectron main process entry (starts embedded Node service + loads frontend window)
package.jsonVersion number (version field, currently 1.1.0)

Directory Structure

`

bossagents/

├── dist/ # Frontend build artifacts (vite build output)

├── electron-app/main.js # Electron main process

├── electron-builder.yml # Packaging configuration

├── server/ # Backend service (included in build)

├── release8/ # Installer output directory (excluded by .gitignore)

│ └── LRAgent-Setup-1.1.0-win-x64.exe

└── package.json # Version number

`

Update version number

Edit the version field in package.json and electron-builder.yml, then rebuild the installer.

Build installer without rebuilding frontend

`bash

npx electron-builder --win --config electron-builder.yml

`

Build for other platforms

`bash

macOS

npx electron-builder --mac --config electron-builder.yml

Linux

npx electron-builder --linux --config electron-builder.yml

`

Common issues

IssueSolution
Build timeoutIncrease timeout; NSIS compression for a 173MB app takes 10-15 minutes
`file source doesn't exist` warningSome DB files missing; does not affect build, can be ignored
better-sqlite3 binding missingDowngraded to node:sqlite; does not affect build or runtime
← 返回案例列表

Try 左帮右臂 Industrial Agent — your digital workforce

Available as a WeChat mini program, web app (ylxt.chat) and desktop client. Start from whichever fits your workflow.

🌐 Web App 💻 Desktop Download 📞 Call 189-8606-6876
WeChat mini program QR
Scan for the WeChat mini program
Share:
🤖 Try Now →
🤖
🎁