Windows Packaging & Deployment
Relevant source files
The following files were used as context for generating this wiki page:
Windows Packaging & Deployment for the SSA Consulta Rapida C++ project involves the compilation, environment configuration, and artifact generation necessary to run the application on Windows 11 systems. The process utilizes a C++20 toolchain integrated with Qt 6.6+ and CMake, targeting a standalone executable and its associated dependencies.
The deployment strategy focuses on generating a clean distribution folder using standard Qt deployment tools. This ensures that all necessary DLLs, QML modules, and plugins are bundled with the executable for portability.
Sources: packaging/windows/README.md, README.md:21-25
Build Environment and Requirements
Deploying on Windows requires specific tooling and environment variables to ensure compatibility with the MSVC compiler and the Qt framework.
Prerequisites
- Compiler: Visual Studio 2022 Build Tools (Desktop development with C++).
- Framework: Qt 6 for MSVC 2022 64-bit (specifically components like Core, Gui, Qml, Quick, QuickControls2, and Sql).
- Build System: CMake 3.24+ and Ninja.
- Database: SQLite3.
Sources: README.md:14-25, CMakeLists.txt:10-11
Configuration Environment
Before building, the environment must point to the specific Qt installation. This is typically handled via PowerShell environment variables.
| Variable | Purpose | Typical Value |
|---|---|---|
$env:QT_DIR | Path to the Qt installation root. | C:\Qt\6.8.3\msvc2022_64 |
$env:Path | Path updated to include Qt binaries. | $env:QT_DIR\bin;$env:Path |
Sources: README.md:43-45
Compilation and Build Process
The project uses CMake Presets to manage build configurations. For production deployment, the release preset is used to optimize the binary.
The build process generates a native Windows executable (ssa_consulta_rapida.exe). The CMakeLists.txt file specifically defines the WIN32_EXECUTABLE property for this target to ensure it runs as a windowed application rather than a console application.
Sources: README.md:46-48, CMakeLists.txt:98-103, CMakePresets.json
Deployment and Artifact Generation
Once the binary is compiled, the deployment phase gathers the required runtime dependencies.
Deployment Tooling
The primary tool for Windows deployment is windeployqt.exe. This tool scans the executable and copies all necessary Qt libraries, QML modules, and platform plugins into the target directory.
Execution Command:
& "$env:QT_DIR\bin\windeployqt.exe" .\build\dev\ssa_consulta_rapida.exe
Sources: README.md:51-53, packaging/windows/README.md
Installation Targets
The CMakeLists.txt defines the installation structure for the artifacts:
- Runtime Destination:
bin/ - Bundle Destination:
.(for the main executable)
Sources: CMakeLists.txt:105-108
Runtime Configuration and Startup
The application accepts specific command-line arguments that are critical for deployment scenarios, such as specifying custom database paths or configuration directories.
Command Line Options
| Option | Description |
|---|---|
--db <path> | Specifies the path to the SQLite database. |
--config-dir <path> | Sets the directory for user preferences and logs. |
--project-root <path> | Used for determining default paths. |
Sources: app/desktop/main.cpp:38-44, src/platform/StartupOptions.h
Path Resolution Logic
The deployment environment must account for where the application stores data. On Windows, the default configuration directory is typically located within %LOCALAPPDATA%.
Sources: app/desktop/main.cpp:46-52, README.md:55-60
Conclusion
Windows Packaging & Deployment for SSA Consulta Rapida C++ follows a standardized Qt/CMake workflow. By utilizing windeployqt and the MSVC 2022 toolchain, the system produces a portable distribution folder containing the ssa_consulta_rapida.exe and all its required environmental dependencies. Current plans involve stabilizing macOS smoke tests before finalizing the automated installer generation from clean CI jobs.
Sources: packaging/windows/README.md, README.md:65-71