This document provides a quick reference for creating Windows distribution packages.
The following Windows packaging infrastructure has been added to GPUBench:
- Added CPack configuration for creating Windows packages
- Support for ZIP archives (portable distribution)
- Support for NSIS installers (professional installation)
- Version management (project version set to 1.0.0)
- Automatic architecture detection (win32/win64)
- PowerShell script for automated packaging
- Validates prerequisites (CMake, NSIS)
- Configures, builds, and packages in one command
- Options for ZIP, NSIS, or both package types
- Clean build option
- Colored output for easy status tracking
- Comprehensive guide for Windows packaging
- Prerequisites and setup instructions
- Quick start examples
- Troubleshooting guide
- Distribution checklist
# From the project root directory
.\packaging\windows\build_package.ps1This will:
- Configure the project with CMake
- Build in Release mode
- Create both ZIP and NSIS packages (if NSIS is installed)
# Create and enter build directory
mkdir build-release
cd build-release
# Configure
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="GPUBench"
# Build
cmake --build . --config Release
# Create ZIP package
cpack -G ZIP -C Release
# Create NSIS installer (optional, requires NSIS)
cpack -G NSIS -C ReleaseAfter running the packaging process, you'll get:
-
ZIP Archive:
GPUBench-1.0.0-win64.zip- Portable, no installation required
- Extract and run
bin\gpubench.exe - Good for testing or users who prefer portable apps
-
NSIS Installer:
GPUBench-1.0.0-win64.exe(if NSIS installed)- Professional installer with wizard
- Automatic PATH configuration
- Start Menu shortcuts
- Uninstaller included
- Default location:
C:\Program Files\GPUBench
- Windows 10 or 11
- Visual Studio 2019+ with C++ desktop development
- CMake 3.16 or later
- Vulkan SDK or OpenCL SDK
- NSIS 3.x from https://nsis.sourceforge.io/
Both package types include:
GPUBench/
├── RunAllBenchmarks.bat # Easy execution script
├── bin/
│ └── gpubench.exe # Main executable
└── share/gpubench/
└── kernels/
├── vulkan/ # SPIR-V shaders (*.spv)
└── opencl/ # OpenCL kernels (*.cl)
The PowerShell script accepts several parameters:
# Create only ZIP package
.\packaging\windows\build_package.ps1 -PackageType zip
# Create only NSIS installer
.\packaging\windows\build_package.ps1 -PackageType nsis
# Create both (default)
.\packaging\windows\build_package.ps1 -PackageType both
# Clean build (removes existing build directory)
.\packaging\windows\build_package.ps1 -CleanBuild
# Use custom build directory
.\packaging\windows\build_package.ps1 -BuildDir "my-build"
# Debug build (default is Release)
.\packaging\windows\build_package.ps1 -BuildType Debug- Extract
GPUBench-1.0.0-win64.zip - Double-click
RunAllBenchmarks.batin the root directory - The benchmarks will run and the window will stay open when finished
Alternatively, via command line:
# Extract
Expand-Archive GPUBench-1.0.0-win64.zip -DestinationPath test
# Run the wrapper script
cd test\GPUBench
.\RunAllBenchmarks.bat- Run the installer
GPUBench-1.0.0-win64.exe - You can find "Run All Benchmarks" in the Start Menu
- Or run
gpubench --list-benchmarksfrom any terminal
Edit CMakeLists.txt:
project(GPUBench VERSION 1.0.0) # Change version hereEdit the CPack NSIS settings in CMakeLists.txt:
CPACK_NSIS_DISPLAY_NAME- Name shown in Add/Remove ProgramsCPACK_NSIS_HELP_LINK- Support URLCPACK_NSIS_CONTACT- Contact emailCPACK_NSIS_MENU_LINKS- Start Menu shortcuts
- Create or obtain a 256x256 icon
- Convert to .ico format
- Save as
packaging/windows/icon.ico - The build system will automatically use it
See packaging/windows/ICON_PLACEHOLDER.txt for detailed instructions.
- Install from https://nsis.sourceforge.io/
- Add to PATH or let the script auto-detect it
- Or create ZIP package only
- Install Vulkan SDK from https://vulkan.lunarg.com/
- Ensure
VULKAN_SDKenvironment variable is set - Restart terminal after installation
- Check build output for errors
- Ensure Release build succeeded
- Verify all kernel files are present
- Ensure Visual C++ Redistributable is installed
- Check that GPU drivers are up to date
- Test on clean Windows VM before distributing
Before releasing:
- Test on clean Windows installation
- Verify all compute backends work
- Test with different GPU vendors (NVIDIA, AMD, Intel)
- Ensure all kernel files are included
- Test installer and uninstaller (NSIS)
- Verify PATH modification works
- Update version number
- Update contact information in CMakeLists.txt
- Include LICENSE and README files
- Document system requirements
- Create release notes
For automated packaging in CI/CD (e.g., GitHub Actions):
name: Build Windows Package
on: [push, release]
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install Vulkan SDK
run: |
# Install Vulkan SDK
- name: Build Package
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cpack -G ZIP -C Release
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: windows-package
path: build/GPUBench-*.zipFor detailed information:
- Windows packaging guide:
packaging/windows/README.md - General installation:
INSTALL.md - CPack documentation: https://cmake.org/cmake/help/latest/module/CPack.html
For issues:
- Check build output for specific errors
- Verify all prerequisites are installed
- See troubleshooting sections in documentation