{"id":23620,"library":"dmgbuild","title":"dmgbuild","description":"dmgbuild is a macOS command line utility and Python library for creating disk images (.dmg files). It provides a programmatic way to build DMGs with custom backgrounds, icons, and layout. The current version is 1.6.7, with a stable maintenance release cadence. Only works on macOS.","status":"active","version":"1.6.7","language":"python","source_language":"en","source_url":"https://github.com/dmgbuild/dmgbuild","tags":["dmg","macos","disk-image","build-tool"],"install":[{"cmd":"pip install dmgbuild","lang":"bash","label":"pip install"}],"dependencies":[],"imports":[{"note":"DMGObject is the main class for building DMGs programmatically.","symbol":"DMGObject","correct":"from dmgbuild import DMGObject"},{"note":"build_dmg is a top-level function, but using the module as a command line tool is more common. The function is available in the package.","wrong":"dmgbuild.build_dmg","symbol":"build_dmg","correct":"from dmgbuild import build_dmg"},{"note":"settings is a dict of default settings, but accessing via the module name works too (just longer).","wrong":"import dmgbuild; dmgbuild.settings","symbol":"settings","correct":"from dmgbuild import settings"}],"quickstart":{"code":"from dmgbuild import DMGObject\n\n# Create a DMG with a volume name and files\ndmg = DMGObject('MyVolume', '/tmp/myapp.app')\ndmg.build('/tmp/myapp.dmg')\nprint('DMG created at /tmp/myapp.dmg')","lang":"python","description":"Creates a simple disk image containing a single app."},"warnings":[{"fix":"Use only on macOS; for CI, use macOS runners.","message":"dmgbuild only works on macOS. Importing or running on Linux/Windows will raise an OSError about missing Apple APIs.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python >= 3.10 or pin dmgbuild to <1.6.0.","message":"Version 1.6.0 dropped support for Python < 3.10. Users on Python 3.7-3.9 must stay on older versions (e.g., 1.5.2).","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Always pass a list (even for one file): DMGObject('Volume', ['/path/to/app'])","message":"The DMGObject constructor has changed signature between versions. In newer versions, the second argument is a list of paths; in older versions it was a single path or different parameters.","severity":"gotcha","affected_versions":">=1.6.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run the script with appropriate entitlements or grant full disk access to Terminal.","cause":"macOS sandboxing or missing permissions to create disk images.","error":"OSError: [Errno 1] Operation not permitted"},{"fix":"Upgrade to version 1.6.0+: pip install --upgrade dmgbuild","cause":"Old version of dmgbuild (< 1.6.0) where DMGObject was not exposed at the top level.","error":"ImportError: cannot import name 'DMGObject' from 'dmgbuild'"},{"fix":"Use DMGObject('Name', ['/path/to/item']) instead of DMGObject('Name', '/path/to/item')","cause":"Passing arguments incorrectly; the constructor expects (volume_name, paths) where paths is a list.","error":"TypeError: DMGObject.__init__() takes 2 positional arguments but 3 were given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}