Posted on 06-06-2019 12:05 PM
I have an app installer that we would like to make available in self service. We'd like when the user clicks to install that it NOT install as root, but as the user that clicks it. Any way to make this work?
Posted on 06-06-2019 01:24 PM
Did you create the installer or is it an installer from a Developer?
What is it trying to do?
If you install the files to a temporary location you could run a post install script or something similar that get's the current user from the Jamf binary as it will be $3 or could do a check like this:
currentUser=$3
if [[ $3 == "" ]]; then
currentUser=stat -f%Su /dev/console
fi
so that way you have a full back option for discovering the username and then use dscl to find their home directory location:
currentUserHome=dscl /Search read /Users/$currentUser NFSHomeDirectory | cut -d' ' -f 2 | head -n 1
Like I said it all depends on the type of installer and what you're doing but maybe these will give you some ideas.
Rob
Posted on 06-06-2019 04:43 PM
Thanks r0blee, it is a pkg file from an outside developer. It installs an agent on the machine and it requires the user run it as themselves. I know I could do the tricks you mentioned, but is there really no easier/cleaner way?
Posted on 06-20-2019 01:38 PM
Probably not as that’s the thing when you use the original developers installer is you have no control over whatever script they are using in their pkg.
Rob