This guide explains how to create a professional .dmg installer for BlockMaster.
To create the .dmg installer, simply run:
./create_dmg.shThis will create BlockMaster-2.0.0.dmg in the current directory.
The create_dmg.sh script:
-
Creates App Bundle Structure
BlockMaster.app/Contents/MacOS/- Contains the executableBlockMaster.app/Contents/Resources/- Contains all source filesBlockMaster.app/Contents/Info.plist- App metadata
-
Includes All Files
- Complete source code (
src/directory) - Documentation (
docs/,README.md,INSTALL.md) - Scripts (
scripts/directory) - Dependencies (
requirements.txt) - License and other files
- Complete source code (
-
Creates Professional DMG
- Proper volume name and formatting
- Applications folder shortcut
- User-friendly README
- Compressed format for smaller file size
If you need to customize the DMG creation process:
mkdir -p BlockMaster.app/Contents/{MacOS,Resources}<?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>#!/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.pycp -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/hdiutil create -srcfolder BlockMaster.app -volname "BlockMaster" -fs HFS+ -format UDZO BlockMaster-2.0.0.dmgTo add a custom app icon:
- Create a
.icnsfile (512x512 PNG converted to .icns) - Place it in
BlockMaster.app/Contents/Resources/ - Add to Info.plist:
<key>CFBundleIconFile</key>
<string>AppIcon</string>Update version numbers in:
create_dmg.shscriptInfo.plistfile- DMG filename
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
- Upload the .dmg file to GitHub Releases
- Update download links in documentation
- Tag the release with version number
Users can download directly:
curl -O https://github.com/bythebug/Block-Master-System-Level-Website-Blocker/releases/latest/download/BlockMaster-2.0.0.dmg- Ensure you're running on macOS
- Check available disk space
- Verify all source files exist
- Check Python 3 installation
- Verify tkinter availability
- Check file permissions
- Use
hdiutilwith compression options - Remove unnecessary files
- Optimize included resources
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