How to distribute your CyberBasic games to players
- Overview
- What to Include
- Distribution Methods
- Platform-Specific Instructions
- Packaging Scripts
- Best Practices
CyberBasic games are distributed as:
- The
cyberbasic.exe(orcyberbasicon Linux/macOS) interpreter - Your
.basgame files - Assets (images, sounds, music, data files)
- Any required DLLs (if not statically linked)
Players run your game by executing: cyberbasic.exe game.bas
No compiler handy? Grab the latest cyberbasic-windows or cyberbasic-linux artifact from the Build CyberBasic workflow—each successful run uploads fresh binaries produced on clean CI runners.
-
CyberBasic Executable
cyberbasic.exe(Windows) orcyberbasic(Linux/macOS)- Recommended: Use
build-dist/cyberbasic.exe(statically linked, no DLLs) - Alternative:
build/cyberbasic.exeorbuild-mingw/cyberbasic.exe(may require DLLs)
-
Game Files
- All
.basfiles your game uses - Include any imported/included files
- All
-
Assets
- Images (
.png,.jpg, etc.) - Sounds (
.wav,.ogg,.mp3) - Music files
- Data files (
.json,.txt, etc.)
- Images (
-
Dependencies (if not statically linked)
- Windows: May need Visual C++ redistributables
- Linux: May need system libraries
- macOS: Usually bundled in
.app
README.txt- Instructions for playersLICENSE.txt- License information- Launcher script (
.baton Windows,.shon Linux/macOS)
Best for: Quick distribution, no installation needed
Steps:
-
Create distribution folder:
MyGame_v1.0/ ├── cyberbasic.exe ├── game.bas ├── assets/ │ ├── sprites/ │ ├── sounds/ │ └── music/ └── README.txt -
Create README.txt:
MyGame v1.0 INSTRUCTIONS: 1. Extract all files 2. Run: cyberbasic.exe game.bas CONTROLS: - WASD: Move - ESC: Exit -
Zip the folder:
- Windows: Right-click → Send to → Compressed folder
- Linux/macOS:
zip -r MyGame_v1.0.zip MyGame_v1.0/
-
Distribute the zip file
Best for: Professional distribution, easy installation
Tools:
- Inno Setup (Free, recommended)
- NSIS (Free)
- WiX Toolset (Free, more complex)
Inno Setup Example:
[Setup]
AppName=MyGame
AppVersion=1.0
DefaultDirName={pf}\MyGame
DefaultGroupName=MyGame
OutputDir=dist
[Files]
Source: "cyberbasic.exe"; DestDir: "{app}"
Source: "game.bas"; DestDir: "{app}"
Source: "assets\*"; DestDir: "{app}\assets"; Flags: recursesubdirs
[Icons]
Name: "{group}\MyGame"; Filename: "{app}\cyberbasic.exe"; Parameters: "game.bas"
Name: "{commondesktop}\MyGame"; Filename: "{app}\cyberbasic.exe"; Parameters: "game.bas"
Best for: Linux distribution, single file
Steps:
-
Create AppDir structure:
MyGame.AppDir/ ├── cyberbasic ├── game.bas ├── assets/ └── AppRun (executable script) -
Create AppRun:
#!/bin/sh cd "$(dirname "$0")" ./cyberbasic game.bas
-
Use appimagetool to create AppImage
Best for: macOS distribution
Steps:
-
Create application bundle:
MyGame.app/ └── Contents/ ├── MacOS/ │ └── cyberbasic └── Resources/ ├── game.bas └── assets/ -
Use Disk Utility or createDMG to create DMG file
Build with static linking to avoid DLL dependencies:
Windows:
# Use the distribution build script
.\build-dist.bat
# Or manually:
cmake -S . -B build-dist -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBASIC_STATIC_LINK=ON
cmake --build build-distLinux/macOS:
cmake -S . -B build-dist -DCMAKE_BUILD_TYPE=Release -DBASIC_STATIC_LINK=ON
cmake --build build-distThis creates build-dist/cyberbasic.exe (or build-dist/cyberbasic on Linux/macOS) with all dependencies bundled. No DLL files required!
MyGame/
├── cyberbasic.exe
├── game.bas
├── run_game.bat
├── assets/
└── README.txt
run_game.bat:
@echo off
cd /d "%~dp0"
cyberbasic.exe game.bas
pauseTest on a clean Windows system without development tools:
- Copy your distribution folder
- Run
cyberbasic.exe game.bas - Verify all assets load correctly
MyGame/
├── cyberbasic
├── game.bas
├── run_game.sh
├── assets/
└── README.txt
run_game.sh:
#!/bin/bash
cd "$(dirname "$0")"
./cyberbasic game.basMake executable: chmod +x run_game.sh
May need to include or document:
- libc6 (usually pre-installed)
- libstdc++6
- libgcc-s1
For broader compatibility, consider packaging as AppImage or Flatpak.
MyGame.app/
└── Contents/
├── MacOS/
│ └── cyberbasic
└── Resources/
├── game.bas
└── assets/
For distribution outside the App Store:
- Get Apple Developer certificate
- Sign the executable:
codesign --sign "Developer ID" cyberbasic - Create DMG and sign it
Create package_game.ps1:
$GameName = "MyGame"
$Version = "1.0"
$BuildDir = "build-mingw"
$DistDir = "dist/${GameName}_${Version}"
# Create distribution directory
New-Item -ItemType Directory -Force -Path $DistDir
New-Item -ItemType Directory -Force -Path "$DistDir/assets"
# Copy files
Copy-Item "$BuildDir/cyberbasic.exe" $DistDir
Copy-Item "game.bas" $DistDir
Copy-Item -Recurse "assets/*" "$DistDir/assets/"
# Create launcher
@"
@echo off
cd /d "%~dp0"
cyberbasic.exe game.bas
pause
"@ | Out-File -FilePath "$DistDir/run_game.bat" -Encoding ASCII
# Create README
@"
$GameName v$Version
INSTRUCTIONS:
1. Extract all files
2. Double-click run_game.bat
CONTROLS:
- WASD: Move
- ESC: Exit
"@ | Out-File -FilePath "$DistDir/README.txt" -Encoding ASCII
# Create zip
Compress-Archive -Path $DistDir -DestinationPath "dist/${GameName}_${Version}.zip" -Force
Write-Host "Package created: dist/${GameName}_${Version}.zip"Create package_game.sh:
#!/bin/bash
GAME_NAME="MyGame"
VERSION="1.0"
BUILD_DIR="build"
DIST_DIR="dist/${GAME_NAME}_${VERSION}"
# Create distribution directory
mkdir -p "$DIST_DIR/assets"
# Copy files
cp "$BUILD_DIR/cyberbasic" "$DIST_DIR/"
cp "game.bas" "$DIST_DIR/"
cp -r "assets/"* "$DIST_DIR/assets/"
# Create launcher
cat > "$DIST_DIR/run_game.sh" << 'EOF'
#!/bin/bash
cd "$(dirname "$0")"
./cyberbasic game.bas
EOF
chmod +x "$DIST_DIR/run_game.sh"
# Create README
cat > "$DIST_DIR/README.txt" << EOF
${GAME_NAME} v${VERSION}
INSTRUCTIONS:
1. Extract all files
2. Run: ./run_game.sh
CONTROLS:
- WASD: Move
- ESC: Exit
EOF
# Create tar.gz
cd dist
tar -czf "${GAME_NAME}_${VERSION}.tar.gz" "${GAME_NAME}_${VERSION}"
cd ..
echo "Package created: dist/${GAME_NAME}_${VERSION}.tar.gz"Always build with Release configuration:
cmake .. -DCMAKE_BUILD_TYPE=ReleaseAvoid DLL dependencies:
cmake .. -DBASIC_STATIC_LINK=ONTest your distribution on a system without development tools installed.
Create a README with:
- Installation instructions
- Controls
- System requirements
- Troubleshooting tips
Keep assets organized:
assets/
├── sprites/
├── sounds/
├── music/
└── data/
Include version numbers in:
- Distribution folder name
- README file
- Game title (optional)
Include license information for:
- Your game
- CyberBasic
- Any third-party assets
- Compress images appropriately
- Use efficient audio formats
- Remove unused assets
Before distributing, verify:
- Game runs on clean system
- All assets are included
- README is clear and complete
- Launcher script works
- Version number is correct
- License information included
- Tested on target platform
- No debug files included
- File paths are relative
- All dependencies included (or documented)
MyGame_v1.0/
├── cyberbasic.exe (or cyberbasic on Linux/macOS)
├── game.bas
├── run_game.bat (or run_game.sh)
├── README.txt
├── LICENSE.txt
└── assets/
├── sprites/
│ ├── player.png
│ └── enemy.png
├── sounds/
│ ├── jump.wav
│ └── collect.wav
└── music/
└── background.mp3
- Download Inno Setup
- Use the example script above
- Compile to create installer
- Install appimagetool
- Create AppDir structure
- Run:
appimagetool MyGame.AppDir MyGame.AppImage
- Create application bundle
- Use Disk Utility or createDMG
- Sign with Developer ID (optional)
For distribution questions:
- Check this guide
- Review examples in the repository
- Open an issue on GitHub
Happy distributing! 🚀