Installer to put something on the current user's desktop

cwaldrip
Valued Contributor

Okay, I just know I'm missing something simple. How do I get something just on the current user's desktop?

I can put it on all user's Desktop, and in the User Template folder. But I need to put a file just on the current user's desktop. :-

I guess I could put it in /tmp and use a post-install script to move it to the current user's desktop. Is that the best option?

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor II
I guess I could put it in /tmp and use a post-install script to move it to the current user's desktop. Is that the best option?

Yep, that's your best option. The built in option (FEU) will hit all existing home directories, not just the current user, as you've already surmised.

View solution in original post

4 REPLIES 4

mm2270
Legendary Contributor II
I guess I could put it in /tmp and use a post-install script to move it to the current user's desktop. Is that the best option?

Yep, that's your best option. The built in option (FEU) will hit all existing home directories, not just the current user, as you've already surmised.

jjones
Contributor II

Here is a script that you could use, you could make this run every time a user logs in to ensure that they have it on their desktop

#!/bin/sh

loggedInUser=""
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`

cp /tmp/filename /Users/$loggedInUser/Desktop/filename
chown $loggedInUser /Users/$loggedInUser/Desktop/filename

exit

cwaldrip
Valued Contributor

Thanks for the script @jjones . I was just starting to write my own clunky version. :D

apizz
Valued Contributor

Thanks for this, guys. Several of our faculty members manage classrooms in our labs and I was trying to figure out a way they could install Apple Remote Desktop themselves through Self Service, while not giving other users that may use the lab admin station access to the application.