-
Notifications
You must be signed in to change notification settings - Fork 167
build_on_linux
This guide covers building Generals and Zero Hour on Linux using Docker. The build produces Windows executables that can run natively on Windows or under Wine on Linux.
The repository includes convenience scripts that automate the Docker build process:
# Clone the repository
git clone https://github.com/TheSuperHackers/GeneralsGameCode.git
cd GeneralsGameCode
# Build using Docker (produces Windows executables)
./scripts/docker-build.sh
# Install to your game (auto-detects Wine prefix)
./scripts/docker-install.sh --detect- Docker: Install Docker Engine for your distribution
- Git: For cloning the repository
- Wine (optional): For running the built executables on Linux
Ensure Docker is running and your user has permission:
# Start Docker daemon
sudo systemctl start docker
# Add your user to the docker group (logout/login required)
sudo usermod -aG docker $USERThe main build script that manages the Docker-based build process.
# Full build (both Generals and Zero Hour)
./scripts/docker-build.sh
# Build Zero Hour only
./scripts/docker-build.sh --game zh
# Build Generals only
./scripts/docker-build.sh --game generals
# Build specific target
./scripts/docker-build.sh --target generalszh
# Clean build directory first
./scripts/docker-build.sh --clean
# Force CMake reconfiguration
./scripts/docker-build.sh --cmake
# Enter container shell for debugging
./scripts/docker-build.sh --interactiveBuild outputs are placed in build/docker/:
| Directory | Contents |
|---|---|
build/docker/GeneralsMD/ |
Zero Hour executables |
build/docker/Generals/ |
Generals executables |
build/docker/Core/ |
Shared DLLs |
Installs built executables to an existing game installation.
# Auto-detect game location (checks Wine prefixes and common paths)
./scripts/docker-install.sh --detect
# Specify game directory manually
./scripts/docker-install.sh /path/to/game
# Install Generals instead of Zero Hour
./scripts/docker-install.sh --game generals /path/to/game
# Dry run (show what would be installed)
./scripts/docker-install.sh --dry-run --detect
# Restore original files from backups
./scripts/docker-install.sh --restore /path/to/gameThe script will:
- Backup your original executables (
.exe.backup) - Copy newly built executables
- Copy new DLLs (DebugWindow.dll, ParticleEditor.dll)
- Preserve original mss32.dll and binkw32.dll (audio/video libraries)
After building and installing, run the game with Wine:
# Zero Hour (path depends on your installation)
wine /path/to/game/generalszh.exe
# Or from the build directory (requires game data files)
wine build/docker/GeneralsMD/generalszh.exeFor best results:
# Use 32-bit Wine prefix
WINEARCH=win32 WINEPREFIX=~/.wine-generals winecfg
# Set Windows version to Windows XP or Windows 7
winecfgGot permission denied while trying to connect to the Docker daemon
Solution: Add your user to the docker group and re-login:
sudo usermod -aG docker $USER
# Then logout and login againBuild directory not found: /path/to/GeneralsGameCode/build/docker
Solution: Run the build script first:
./scripts/docker-build.shNo game installation found
Solution: Specify the game directory manually:
./scripts/docker-install.sh /path/to/your/game/installationIf the game crashes or has graphical issues:
- Try different Wine versions (wine-staging often works better for games)
- Install required dependencies:
winetricks directx9 vcrun6 - Use DXVK for better DirectX performance:
winetricks dxvk
If you prefer to run the Docker commands manually instead of using the scripts:
# Build the Docker image
docker build \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
resources/dockerbuild \
-t zerohour-build
# Run the build
docker run \
-u $(id -u):$(id -g) \
-v $(pwd):/build/cnc \
--rm \
zerohour-build
# Enter container for debugging
docker run \
-u $(id -u):$(id -g) \
-v $(pwd):/build/cnc \
--rm \
-it \
--entrypoint bash \
zerohour-build- Build with VC6 on Docker - Manual Docker setup
- Build Configuration - CMake presets and options
- Build Guides - All build guides
- How to Get Involved
- How to Contribution
- Replays for testing
- New Configuration Options
- In-Game Debug Commands
- Community forks
- License
- Credits
- Changelog
- FAQ
- Known Issues
- Contact & Community
-
Visual Studio 6 Guides:
-
Visual Studio 2022 Guides:
- DirectX
- STLport
- Max4SDK
- NVASM
- Benchmark
- MilesSoundSystem
- Bink
- SafeDisk
- Asimp3
- GameSpy
- ZLib
- LZHCompress