Kaseya Community

Mac OS X install script question

This question is answered

I am trying to create my first script to install a pre-defined package (always in the same location on every machine).

When I run the command via Terminal, it does prompt for the root/admin password, which I type in and the installation works perfectly.  When I send the command via Kaseya, it states that the script was successful, but I do not see the application installed (I've check after a reboot as well).

So, my question boils down to: how do I send across a typed root/admin password?

Here is the script that I current have.

executeShellCommand("cd /Users/servicemax/Downloads/", "Execute as System", "Max OS X", "Halt on Fail")
executeShellCommand("sudo installer -pkg 'Sophos Anti-Virus Home Edition.pkg' -target /", "Execute as System", "Max OS X", "Halt on Fail")

I would greatly appreciate feedback! :)

Verified Answer
  • Just to confirm, you used the "installPKG()" command right?

    You need to basically have 4 specific commands for the agent procedure when installing packages.  For the first command, you need to specify where the source file is stored on the server.  Here they are:

    1) writeFile ("nameofpackage", "/full/path/on/destination.pkg", "Mac OS X", "Halt on Fail")

    2) installPKG("/full/path/on/destination.pkg", "Mac OS X", "Halt on Fail")

    3) deleteFile("/full/path/on/destination.pkg", "Mac OS X", "Halt on Fail")

    4) sendEmail ("youremail@yourdomain.com", "Software Deployed - XXX.pkg", "Sophos installed", "All Operating Systems", "Halt on Fail")

    Hope this helps and if this fails, then there may be something wrong with the package.  Are you using the package from the installation media or did you make your own?

All Replies
  • It would be best to open another post so that one can be answered instead of posting additional questions on an already answered post.