Smart Software allows you to deploy .dmg disk images silently to your managed devices through Addigy policies. Because a .dmg must be mounted by macOS before its contents can be accessed, deploying it requires a script that mounts the image, installs the software, and then unmounts it. This guide walks you through building that installation script and creating the Smart Software item.
Recommendation: If your .dmg contains a .pkg file, extract the .pkg and upload it directly instead — it's simpler and doesn't require a custom script. See How To: Create Smart Software Items (.pkg files) for those steps. Only follow this guide if installation must happen from within the mounted .dmg volume (e.g., the .dmg contains a .app file).
How to Create a Smart Software Item
- Navigate to Catalog > Software > Smart Software and click New.
- Enter a name and version number for your item. Note that the name cannot be changed after creation.
- Under Installation Files, click Select File(s) and upload your
.dmgfile. - In the Installation Command field, paste the following script and update the four variables to match your software:
#!/bin/bash
# Set the paths and variables
dmg_file="/Library/Addigy/ansible/packages/Firefox (1.0)/Firefox.dmg"
app_name="Firefox.app"
volume_path="/Volumes/Firefox"
destination="/Applications"
# Removes trailing slashes if present
app_name="${app_name%/}"
volume_path="${volume_path%/}"
destination="${destination%/}"
# Mount the DMG and copy the application
hdiutil attach -nobrowse "$dmg_file"
cp -R "$volume_path/$app_name" "$destination"
# Detach the DMG
hdiutil detach "$volume_path"Update the following four variables before saving:
-
dmg_file— the full path to your uploaded .dmg file. You can find this path in the Download folder line at the bottom of the Installation section in your Smart Software item. It follows the format/Library/Addigy/ansible/packages/ItemName (Version)/filename.dmg. -
app_name— the name of the .app (or .pkg) file inside the mounted volume, including the extension (e.g.,Firefox.app). -
volume_path— the path where the .dmg mounts on the device (e.g.,/Volumes/Firefox). This is always the portion of the path before the .app or .pkg name. -
destination— the directory where the app should be installed. For most apps, this is/Applications.
- Click Save in the bottom right.
Optional: Add a Condition for Install
A condition script tells Addigy whether to run the installation on a given device — for example, skipping installation if the app is already present in /Applications/. Adding a condition is recommended for any item you plan to deploy at scale.
To learn how to configure conditions, see Overview: Conditions for Install (Condition Scripts).
Frequently Asked Questions
How do I find the volume path and app name from inside a .dmg?
Double-click the .dmg to mount it on your Mac. When the volume opens in Finder, you'll see the files inside — typically a .app or .pkg file. To get the exact path, open Terminal and drag the file from the mounted volume into the Terminal window. The full path will be printed (e.g., /Volumes/Firefox/Firefox.app). The portion before the filename is your volume_path, and the filename itself is your app_name.
How do I know which volume path to use in the detach command?
The hdiutil detach command at the end of the script must reference the mounted volume path — not the file path inside it. Using the Firefox example, the volume is /Volumes/Firefox, so the detach command is hdiutil detach "/Volumes/Firefox". This is always the volume_path variable you set at the top of the script.
Next Steps
Once your Smart Software item is saved, you can deploy it in the following ways:
- Deploy via Policy — add the item to a Parent or Child policy to deploy it automatically to all devices in that policy. See Adding Items to a Policy for details.
- Deploy via Self Service — make the item available for end users to install on demand from the Self Service app. See Adding or Removing Software in the Self Service Catalog.
- Deploy to an Individual Device — use GoLive to deploy the item to a single device on demand. See Deploying Software to Individual Devices in GoLive for details.