First production build

wails build -nsis.

6 mineasy

Last lesson of the chapter — produce a real binary you can run on any machine. Two commands cover it: wails build for the bare .exe / .app, wails build -nsis for a Windows installer.

The basic build

Terminal
$wails build

Produces a single binary for your current OS / arch in build/bin/:

  • Windows: build/bin/field-pos.exe (~15 MB)
  • macOS: build/bin/field-pos.app (a bundle)
  • Linux: build/bin/field-pos (ELF binary)

Cross-compiling for Windows from Mac/Linux

Terminal
$wails build -platform windows/amd64

Wails uses Go's cross-compile. The frontend bundle is the same; only the Go binary differs. Result lands in build/bin/field-pos.exe.

Build with NSIS installer

Terminal
$wails build -nsis

Produces:

  • field-pos.exe — raw binary (~15 MB)
  • field-pos-amd64-installer.exe — NSIS installer (~22 MB)

The installer is the customer-facing artifact. It installs to %LOCALAPPDATA%\Programs\field-pos\ per-user — no UAC, no admin needed.

NSIS must be installed: winget install NSIS.NSIS on Windows. macOS/Linux can cross-build to Windows .exe but can't produce the NSIS installer unless NSIS is on the box (or via WINE).

Build flags worth knowing

Terminal
# Smaller binary — strips debug symbols
$wails build -trimpath -ldflags "-s -w"
# Custom output name
$wails build -o "FieldPOS-v1.0.0.exe"
# All platforms in one shot
$wails build -platform windows/amd64,darwin/arm64,linux/amd64

-ldflags "-s -w" can shave 30% off the binary size. Worth it for distribution.

Where the assets come from

Your app icon, splash image, and metadata come from build/windows/ (and parallel folders for darwin/, linux/). The Grit scaffold ships placeholders. Swap them for your brand assets before shipping.

  • build/windows/icon.ico — app icon (multi-resolution .ico)
  • build/windows/info.json — version + company metadata
  • build/darwin/icon.icns — macOS bundle icon

Quick check

You ran `wails build -nsis` on Windows. Both `.exe` files appear in build/bin. Which one do you ship to customers?

Try it

For chapter 1's assignment, build + install + uninstall:

  1. Run wails build -nsis in your project
  2. Find build/bin/field-pos-amd64-installer.exe
  3. Double-click → run the installer
  4. Launch the app from the Start menu
  5. Uninstall via Settings → Apps → field-pos → Uninstall

Paste screenshots of the installer wizard + the uninstall confirmation in notes.md.

What's next

Chapter 2 — Offline-first. Local SQLite, the outbox pattern for queued writes, and the sync engine that pushes changes when you reconnect.

Spot a typo? Have an idea?

Help us improve this lesson. One click opens a GitHub issue with the lesson URL pre-filled — suggest clearer wording, report a bug, or request more depth. The course keeps improving thanks to learners like you.

Suggest an improvement on GitHub