Creating Installers
Overview
Create professional installers for your Wails application on all platforms.
Platform Installers
NSIS Installer
bash
# Install NSIS
# Download from: https://nsis.sourceforge.io/
# Create installer script (installer.nsi)
makensis installer.nsi
installer.nsi:
!define APPNAME "MyApp"
!define VERSION "1.0.0"
Name "${APPNAME}"
OutFile "MyApp-Setup.exe"
InstallDir "$PROGRAMFILES\${APPNAME}"
Section "Install"
SetOutPath "$INSTDIR"
File "build\bin\myapp.exe"
CreateShortcut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\myapp.exe"
SectionEndWiX Toolset
Alternative for MSI installers.
DMG Creation
bash
# Create DMG
hdiutil create -volname "MyApp" -srcfolder bin/MyApp.app -ov -format UDZO MyApp.dmg
Code Signing
bash
# Sign application
codesign --deep --force --verify --verbose --sign "Developer ID" MyApp.app
# Notarize
xcrun notarytool submit MyApp.dmg --apple-id "email" --password "app-password"
App Store
Use Xcode for App Store distribution.
DEB Package
bash
# Create package structure
mkdir -p myapp_1.0.0/DEBIAN
mkdir -p myapp_1.0.0/usr/bin
# Copy binary
cp bin/myapp myapp_1.0.0/usr/bin/
# Create control file
cat > myapp_1.0.0/DEBIAN/control << EOF
Package: myapp
Version: 1.0.0
Architecture: amd64
Maintainer: Your Name
Description: My Application
EOF
# Build package
dpkg-deb --build myapp_1.0.0
RPM Package
Use rpmbuild for RPM-based distributions.
AppImage
bash
# Use appimagetool
appimagetool myapp.AppDir
Automated Packaging
Using GoReleaser
# .goreleaser.yml
project_name: myapp
builds:
- binary: myapp
goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm64
archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
nfpms:
- formats:
- deb
- rpm
vendor: Your Company
homepage: https://example.com
description: My ApplicationBest Practices
✅ Do
- Code sign on all platforms
- Include version information
- Create uninstallers
- Test installation process
- Provide clear documentation
❌ Don’t
- Don’t skip code signing
- Don’t forget file associations
- Don’t hardcode paths
- Don’t skip testing
Next Steps
- In-App Updater - Add self-updates to your app
- Cross-Platform Building - Build for multiple platforms