Skip to content

Latest commit

 

History

History
156 lines (124 loc) · 3.96 KB

File metadata and controls

156 lines (124 loc) · 3.96 KB

Building BlockMaster DMG Installer

This guide explains how to create a professional .dmg installer for BlockMaster.

🚀 Quick Build

To create the .dmg installer, simply run:

./create_dmg.sh

This will create BlockMaster-2.0.0.dmg in the current directory.

📋 What the Script Does

The create_dmg.sh script:

  1. Creates App Bundle Structure

    • BlockMaster.app/Contents/MacOS/ - Contains the executable
    • BlockMaster.app/Contents/Resources/ - Contains all source files
    • BlockMaster.app/Contents/Info.plist - App metadata
  2. Includes All Files

    • Complete source code (src/ directory)
    • Documentation (docs/, README.md, INSTALL.md)
    • Scripts (scripts/ directory)
    • Dependencies (requirements.txt)
    • License and other files
  3. Creates Professional DMG

    • Proper volume name and formatting
    • Applications folder shortcut
    • User-friendly README
    • Compressed format for smaller file size

🛠️ Manual DMG Creation

If you need to customize the DMG creation process:

1. Create App Bundle Structure

mkdir -p BlockMaster.app/Contents/{MacOS,Resources}

2. Create Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleExecutable</key>
    <string>BlockMaster</string>
    <key>CFBundleIdentifier</key>
    <string>com.bythebug.blockmaster</string>
    <key>CFBundleName</key>
    <string>BlockMaster</string>
    <key>CFBundleVersion</key>
    <string>2.0.0</string>
    <key>CFBundleShortVersionString</key>
    <string>2.0.0</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>LSMinimumSystemVersion</key>
    <string>10.12</string>
</dict>
</plist>

3. Create Executable Script

#!/bin/bash
# BlockMaster - Main Executable
APP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
RESOURCES_DIR="$APP_DIR/Contents/Resources"
cd "$RESOURCES_DIR"
python3 src/launcher.py

4. Copy Files

cp -r src BlockMaster.app/Contents/Resources/
cp -r docs BlockMaster.app/Contents/Resources/
cp -r scripts BlockMaster.app/Contents/Resources/
cp requirements.txt BlockMaster.app/Contents/Resources/
cp LICENSE BlockMaster.app/Contents/Resources/
cp README.md BlockMaster.app/Contents/Resources/

5. Create DMG

hdiutil create -srcfolder BlockMaster.app -volname "BlockMaster" -fs HFS+ -format UDZO BlockMaster-2.0.0.dmg

🎨 Customization Options

App Icon

To add a custom app icon:

  1. Create a .icns file (512x512 PNG converted to .icns)
  2. Place it in BlockMaster.app/Contents/Resources/
  3. Add to Info.plist:
<key>CFBundleIconFile</key>
<string>AppIcon</string>

Version Information

Update version numbers in:

  • create_dmg.sh script
  • Info.plist file
  • DMG filename

Custom Installer

You can modify the install_dependencies.sh script in the app bundle to:

  • Install additional dependencies
  • Set up system preferences
  • Create additional shortcuts
  • Configure firewall rules

📦 Distribution

GitHub Releases

  1. Upload the .dmg file to GitHub Releases
  2. Update download links in documentation
  3. Tag the release with version number

Direct Download

Users can download directly:

curl -O https://github.com/bythebug/Block-Master-System-Level-Website-Blocker/releases/latest/download/BlockMaster-2.0.0.dmg

🔧 Troubleshooting

DMG Creation Fails

  • Ensure you're running on macOS
  • Check available disk space
  • Verify all source files exist

App Won't Launch

  • Check Python 3 installation
  • Verify tkinter availability
  • Check file permissions

Large File Size

  • Use hdiutil with compression options
  • Remove unnecessary files
  • Optimize included resources

📄 License

This DMG creation process is part of BlockMaster and is licensed under the MIT License.


Made with ❤️ for macOS users who want professional app distribution