This guide explains how to create professional release builds of Click Guardian with proper versioning and packaging.
For a simple release build:
scripts\release-build.batThis will create:
dist\click-guardian.exe- Main applicationdist\click-guardian-v1.0.4-windows-portable.zip- Complete release package
## 📋 Prerequisites
### Required
- **Go 1.24.1+** with CGO enabled
- **Git** (for version information)
### Optional
- **Windows SDK** (for code signing with `signtool`)
- **Code signing certificate** (for production releases)
## 📝 Version Management
### Change Version Number
Edit **ONE** file to change the version:
**File: `build\build.conf`**
```ini
VERSION=1.0.4
That's it! The build script automatically uses this version for:
- Executable metadata
- Package naming
- Release documentation
The release build script automatically updates the following files with the new version:
wix.json- Windows installer configurationbuild/windows/app.rc- Windows resource file (contains version info embedded in executable)build/windows/app-manifest.xml- Application manifest file
The build script automatically includes:
- Git commit hash - from
git rev-parse --short HEAD - Build timestamp - current date/time
- Builder name - from
git config user.nameor Windows username
The simplified build process:
- Load version from
build\build.conf - Get git info (commit, builder name)
- Generate Windows resource file (icon, manifest, version info)
windres build\windows\app.rc -O coff -o cmd\click-guardian\click-guardian.syso
- Build executables with embedded version info
- Create release package with documentation
- Generate ZIP file ready for distribution
- GUI Version (
click-guardian.exe) - Main application for end users
(Windows icon, manifest, and version info are embedded viaclick-guardian.syso) - Release Package (
click-guardian-v1.0.4-windows-portable.zip) - Complete distribution package
If you prefer to build manually:
# GUI version (recommended for users)
go build -ldflags "-s -w -H=windowsgui" -o dist\click-guardian-gui.exe .\cmd\click-guardian
# Console version (for debugging)
go build -ldflags "-s -w" -o dist\click-guardian.exe .\cmd\click-guardian# Set your version
set VERSION=1.0.4
set GIT_COMMIT=abc1234
set BUILD_BY=YourName
# Build with version info
go build -ldflags "-s -w -H=windowsgui -X click-guardian/internal/version.Version=%VERSION% -X click-guardian/internal/version.GitCommit=%GIT_COMMIT% -X click-guardian/internal/version.BuildBy=%BUILD_BY%" -o dist\click-guardian-gui.exe .\cmd\click-guardianThe build process uses a Windows resource file to embed the application icon, manifest, and version info into the executable.
- Resource script:
build/windows/app.rc - Icon:
build/windows/app-icon.ico - Manifest:
build/windows/app-manifest.xml - How to generate:
windres build\windows\app.rc -O coff -o cmd\click-guardian\click-guardian.syso
- The
.sysofile must be in the same directory asmain.go(cmd\click-guardian\).
- Get a certificate from a trusted CA (DigiCert, Sectigo, etc.)
- Use the signing script:
build\scripts\sign-code.bat dist\click-guardian-gui.exe path\to\cert.pfx password
# Create self-signed certificate (Windows will show warnings)
makecert -sv mykey.pvk -n "CN=YourName" mycert.cer
pvk2pfx -pvk mykey.pvk -spc mycert.cer -pfx mycert.pfxThe ZIP package includes:
click-guardian-v1.0.4-windows/
├── click-guardian-gui.exe # Main application
├── README.txt # Usage instructions
└── LICENSE # License (if present)
GitHub Releases (Recommended)\n\n1. Update version in build\\build.conf\n2. Build release:\n ```cmd\n scripts\
elease-build.bat\n \n3. **Create git tag**:\n cmd\n git tag -a v1.0.4 -m "Release version 1.0.4"\n git push origin v1.0.4\n ```\n4. Upload to GitHub:\n - Go to GitHub → Releases → Create new release\n - Upload dist\\click-guardian-v1.0.4-windows-portable.zip
- Share the ZIP file directly
- Upload to your website
- Distribute the signed executables
# The GUI version doesn't show console output, but you can verify it was built correctly
# by checking the file exists and running it to see the About dialog- GUI Version - Should start without console window and show the main interface
- About Dialog - Check "About" button to verify version info is embedded
- Protection - Test double-click blocking works
# Check Go environment
go version
go env
# Clean and retry
rmdir /s /q dist
scripts\release-build.bat- Make sure
build\build.confexists withVERSION=1.0.4 - Check that Git is installed and working
- Executable is ~24MB (normal for Go with CGO and GUI)
- Use the original
scripts\build.batfor smaller builds without version info if needed
build\build.conf- ChangeVERSION=1.0.4to your new version
scripts\release-build.bat- Modify build processscripts\build.bat- Your original working build script
cmd\click-guardian\main.go- Main application entry pointinternal\version\version.go- Version handling code
To release a new version:
- Edit
build\build.conf→ change VERSION - Run
scripts\release-build.bat - Upload
dist\click-guardian-v1.0.4-windows-portable.zip
Simple build (no packaging):
scripts\build.batRelease build (with packaging):
scripts\release-build.batThat's it! 🎉