Deploying Prey by Policy (Or otherwise)

whetzelj
New Contributor II

Hello all,

I'm looking to deploy Prey 1.7.3 to a test MacBook. An API key is needed at the time of install. How do I incorporate that key into an install workflow? Is there a script out there already that accomplishes this? I did a search and didn't come up with anything that worked. The Policy tries .pkg first, it fails, and then the command line API key afterwards.

Thanks.

1 ACCEPTED SOLUTION

sbrennan
New Contributor III

@whetzelj

Hey, I stumbled across Prey in another thread that had a script to install Prey and if I could remember who posted it I would give credit. However I have blinked since then. Here is the script that I saw attached to the forgotten post.

Just create a policy that runs this script and you are good to go.

#!/bin/sh
#download prey
curl -o /private/tmp/prey-mac-1.7.3-x64.pkg "https://downloads.preyproject.com/prey-client-releases/node-client/1.7.3/prey-mac-1.7.3-x64.pkg"

#Run Prey Installer
API_KEY=YOURKEY sudo -E installer -pkg /private/tmp/prey-mac-1.7.3-x64.pkg -target /

#Remove Temp File
rm /private/tmp/prey-mac-1.7.3-x64.pkg

exit 0

This worked flawlessly.

Shaun

View solution in original post

4 REPLIES 4

sbrennan
New Contributor III

@whetzelj

Hey, I stumbled across Prey in another thread that had a script to install Prey and if I could remember who posted it I would give credit. However I have blinked since then. Here is the script that I saw attached to the forgotten post.

Just create a policy that runs this script and you are good to go.

#!/bin/sh
#download prey
curl -o /private/tmp/prey-mac-1.7.3-x64.pkg "https://downloads.preyproject.com/prey-client-releases/node-client/1.7.3/prey-mac-1.7.3-x64.pkg"

#Run Prey Installer
API_KEY=YOURKEY sudo -E installer -pkg /private/tmp/prey-mac-1.7.3-x64.pkg -target /

#Remove Temp File
rm /private/tmp/prey-mac-1.7.3-x64.pkg

exit 0

This worked flawlessly.

Shaun

whetzelj
New Contributor II

Thanks a lot! Much appreciated.

vvanier
New Contributor II

How did you get the API_KEY from the Prey installation? Looks like a good way to send out the installer to a device you don't have your hands on.

stevewood
Honored Contributor II
Honored Contributor II

@vvanier It's on your account settings page on the Prey Project website:

Unattended Install for Computers