Creating Installers
Overview
Section titled “Overview”Create professional installers for your Wails application on all platforms.
Platform Installers
Section titled “Platform Installers”NSIS Installer
Section titled “NSIS Installer”# Install NSIS# Download from: https://nsis.sourceforge.io/
# Create installer script (installer.nsi)makensis installer.nsiinstaller.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
Section titled “WiX Toolset”Alternative for MSI installers.
DMG Creation
Section titled “DMG Creation”# Create DMGhdiutil create -volname "MyApp" -srcfolder build/bin/MyApp.app -ov -format UDZO MyApp.dmgCode Signing
Section titled “Code Signing”# Sign applicationcodesign --deep --force --verify --verbose --sign "Developer ID" MyApp.app
# Notarizexcrun notarytool submit MyApp.dmg --apple-id "email" --password "app-password"App Store
Section titled “App Store”Use Xcode for App Store distribution.
DEB Package
Section titled “DEB Package”# Create package structuremkdir -p myapp_1.0.0/DEBIANmkdir -p myapp_1.0.0/usr/bin
# Copy binarycp build/bin/myapp myapp_1.0.0/usr/bin/
# Create control filecat > myapp_1.0.0/DEBIAN/control << EOFPackage: myappVersion: 1.0.0Architecture: amd64Maintainer: Your NameDescription: My ApplicationEOF
# Build packagedpkg-deb --build myapp_1.0.0RPM Package
Section titled “RPM Package”Use rpmbuild for RPM-based distributions.
AppImage
Section titled “AppImage”# Use appimagetoolappimagetool myapp.AppDirAutomated Packaging
Section titled “Automated Packaging”Using GoReleaser
Section titled “Using GoReleaser”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
Section titled “Best Practices”- Code sign on all platforms
- Include version information
- Create uninstallers
- Test installation process
- Provide clear documentation
❌ Don’t
Section titled “❌ Don’t”- Don’t skip code signing
- Don’t forget file associations
- Don’t hardcode paths
- Don’t skip testing
Next Steps
Section titled “Next Steps”- Auto-Updates - Implement automatic updates
- Cross-Platform Building - Build for multiple platforms