I'm using the open command to automate (via bash) opening a dmg which has a EULA attached to it. When I run open my_app_distribution.dmg I get a screen that looks like this: example .dmg license agreement screen

The open commands uses another app/core service to handle the actual mounting, but it nor the open command has any output (or exit code afaik) by default nor do they seem to have a way to change that default behavior.

How can I report back to my bash script which button was clicked so I can determine the next course of action my script will take?

  • Welcome to Ask Different. How are you crafting your DMG? Do you have any familiarity with the best practices and reasons why getting licensing from the DMG is discouraged - afp548.com/2010/06/03/the-commandments-of-packaging-in-os-x
    – bmike
    Commented Jul 8, 2019 at 18:32
  • Thanks for that article. I anticipate on moving to installing via PKG files instead of DMG soon which should alleviate some of the issues that article mentions (or at least provide more flexibility and automation during the install) as well fix the current I'm having. Not knowing exactly how long I'm going to stay with DMGs, I'm interested in finding a solution to this issues. Commented Jul 8, 2019 at 21:10
  • I'm creating the DMG (of an electron app) using electron-builder. Commented Jul 8, 2019 at 21:20
  • Oh - you're going to have a ton of fun with that packaging choice. github.com/electron-userland/electron-builder/issues/3931 notarization, code signing, etc... Start opening issues with that team as you find errors would be my advice - especially if no one here has a quick fix.
    – bmike
    Commented Jul 8, 2019 at 21:26


You must log in to answer this question.

Browse other questions tagged .