This document describes all the build scripts available for MalDestruct and how to use them.
Before running any build script, ensure you have:
- Visual Studio 2022 installed
- Qt 6.9.3 installed at
C:/Qt/6.9.3/mingw_64 - CMake (included with Visual Studio)
Important: All scripts should be run from:
- Developer Command Prompt for VS 2022 (recommended), OR
- Visual Studio's integrated terminal
To open Developer Command Prompt:
- Search for "Developer Command Prompt for VS 2022" in Start menu
- Navigate to project directory:
cd C:\Users\cysec\OneDrive\Desktop\MalDestruct\MalDestruct - Run the desired script
Usage:
rebuild_both.bat [Debug|Release]Description:
- Builds both Console and GUI versions
- Defaults to Release configuration
- Automatically configures CMake if needed
- Detects and reconfigures if generator mismatch
Examples:
rebuild_both.bat # Builds Release (default)
rebuild_both.bat Release # Builds Release
rebuild_both.bat Debug # Builds DebugOutput Location: build\bin\
Usage:
kill_and_rebuild.bat [Debug|Release]Description:
- Kills any running MalDestruct processes first
- Then rebuilds both versions
- Defaults to Debug configuration
- Useful when executables are locked
Examples:
kill_and_rebuild.bat # Builds Debug (default)
kill_and_rebuild.bat Release # Builds Release
kill_and_rebuild.bat Debug # Builds DebugOutput Location: build\bin\
Usage:
build_all.batDescription:
- Builds both Console and GUI in Debug configuration
- Automatically configures CMake if needed
- Uses
builddirectory (matches CMakeSettings.json)
Output Location: build\bin\
Usage:
build_release.batDescription:
- Builds both Console and GUI in Release configuration
- Automatically configures CMake if needed
- Uses
builddirectory (matches CMakeSettings.json)
Output Location: build\bin\
Usage:
rebuild_gui.bat [Debug|Release]Description:
- Builds only the GUI version
- Defaults to Release configuration
- Automatically configures CMake if needed
Examples:
rebuild_gui.bat # Builds Release (default)
rebuild_gui.bat Release # Builds Release
rebuild_gui.bat Debug # Builds DebugOutput Location: build\bin\MalDestruct_GUI.exe
Usage:
find_executables.batDescription:
- Searches for MalDestruct executables in common locations
- Shows file information (size, date) for found executables
- Checks multiple possible build output directories
Searches in:
build\bin\(primary location)out\build\x64-Debug\bin\out\build\x64-Release\bin\
All scripts follow this pattern:
- Check Build Directory: Creates
builddirectory if it doesn't exist - Check CMake Configuration:
- Verifies if CMake is already configured
- Checks if generator matches (Ninja, as per CMakeSettings.json)
- Reconfigures if needed
- Configure CMake (if needed):
- Uses Ninja generator
- Sets Qt path:
C:/Qt/6.9.3/mingw_64 - Sets C++ standard: 17
- Sets build type (Debug or Release)
- Build Targets: Uses
cmake --buildcommand - Verify Output: Checks if executables were created
- Make sure you're running from Developer Command Prompt for VS 2022
- Verify Qt is installed at
C:/Qt/6.9.3/mingw_64 - Check that CMake is in your PATH
- Close any running MalDestruct executables
- Use
kill_and_rebuild.batto kill processes first - Make sure you have write permissions to the build directory
- Check the build output for errors
- Verify CMake configuration completed successfully
- Try cleaning and rebuilding: delete
buildfolder and run script again
- Scripts automatically detect and fix generator mismatches
- If issues persist, manually delete
build\CMakeCache.txtandbuild\CMakeFiles\
These scripts are designed to work alongside Visual Studio's CMake integration:
- Visual Studio uses
CMakeSettings.jsonwhich points tobuilddirectory - Scripts also use
builddirectory for consistency - Both use Ninja generator
- Both support Debug and Release configurations
You can:
- Build from Visual Studio (right-click target → Build)
- Build from command line using these scripts
- Both methods produce executables in the same location:
build\bin\
| Script | Builds | Config | Auto-Config | Kill Processes |
|---|---|---|---|---|
rebuild_both.bat |
Both | Release* | Yes | No |
kill_and_rebuild.bat |
Both | Debug* | Yes | Yes |
build_all.bat |
Both | Debug | Yes | No |
build_release.bat |
Both | Release | Yes | No |
rebuild_gui.bat |
GUI only | Release* | Yes | No |
*Can be overridden with command-line argument