Skip to main content
Solved

Installer to put something on the current user's desktop

  • April 26, 2015
  • 4 replies
  • 49 views

Forum|alt.badge.img+17

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?

Best answer by mm2270

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.

4 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • Answer
  • April 27, 2015
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.


Forum|alt.badge.img+7
  • Contributor
  • April 27, 2015

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

Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • April 29, 2015

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


apizz
Forum|alt.badge.img+15
  • Honored Contributor
  • July 22, 2015

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.