[Pythonmac-SIG] OSAscript from python doesn't trigger privileges prompt

fsteele at mindspring.com fsteele at mindspring.com
Tue Jun 25 22:05:32 CEST 2013


I'm writing a Python application that looks for a pkg file in a particular location, downloads it, and installs it.

Using osascript -e and Python's subprocess.Popen(), I can embed:

do shell script "sudo /usr/sbin/installer -pkg /path/to/file/filename.pkg -target /" with administrator privileges

When run interactively, this works fine. When the script hits the above line, it prompts me to enter my admin privileges and successfully runs installer.

When triggered by a launchd agent (in /Library/LaunchAgents/), the script runs and does everything except successfully install the package.

Any ideas what I'm doing wrong?

Thanks!
 Frank


More information about the Pythonmac-SIG mailing list