How to configure Software Management policies to run interactively on Mac OS X 10.7 (Lion)


Article ID: 180842


Updated On:


Software Management Solution




With the release of Lion (Mac OS X 10.7), Apple has locked down the functionality of the 'open' command, causing interactive software delivery to fail. The following command line is an example of how to install Mac software an interactive manner using a .pkg file (not directory): 

active_user=$(stat /dev/console | awk '{print $5}'); if [ -n "$active_user" ] && [ "$active_user" != "root" ]; then su - "$active_user" -c "open -a Finder \"${AEX_PKG_DIR.EN_US}\"/mymac.pkg"; fi

This causes the software policy to run as the current logged-in user. Therefore, the associated task or policy should be configured, in the advanced/run settings, to run when a user is logged on. This command line opens Finder, which then opens the package.  This method is used since opening the package directly did not prompt for authentication during the interactive GUI installation while the above method does prompt for authentication.

This command line can be used in a Software package definition, as shown below: