Auto-Install Software

I didn't have any luck with your script, but ran with the idea and came up with a (mostly) working script with a few functional changes, which, for my cases (running a script via an MDM with secure token access as root) i'm comfortable with.

However, doing some digging it seems like you are assuming the user (you) will be modifying the sudoers file to enable passwordless sudo with the install command. Once you do that, this script should work, but I don't personally feel comfortable enabling that for a command as potentially destructive as 'installer'.

Another method could be saving each of these scripts as a script file, running it via terminal and getting the password for sudo via standard input, but

  1. I'm not sure how to then access KM Variables
  2. You'd be entering the password for every installer, defeating the purpose of this whole thing.

On second thought... probably the way around this is hard coding your desired plug-in formats in a script file, and executing the script with multiple parameters, being your selected .pkg files. So you could run the script file from KM, only get prompted once for your password via terminal and go from there.

But, here's the macro/script, which works, assuming you've allowed passwordless sudo of 'installer', but otherwise is not functional, as sudo won't take the password as standard input when run from KM as far as i can tell.

Plugin Installer Script copy.kmmacros (10.1 KB)

1 Like