From: Chris Ridd on
On 2010-05-08 23:33:30 +0100, Tim Streater said:

> I'm having a problem with the post-install script I'm using with
> PackageMaker. I want it to write a file onto the user's desktop when the
> installer runs. Because in addition the script may modify the Apache
> config file, it needs admin authorisation, which means the script runs
> under user 'root'.
>
> I need to know the logged-in user so I can construct the right file path
> in order to write on the user's Desktop. At the moment I do a 'id -p'
> and parse the results, but just now I'm getting this output back from
> 'id -p':
>
> login _spotlight
> uid root
> groups wheel _developer _lpoperator _lpadmin admin localaccounts
> certusers staff everyone procmod procview operator tty sys kmem daemon
> com.apple.access_screensharing
>
> Normally it seems to say:
>
> login tim
>
> and I pick that up and all works. What is _spotlight doing there? And is
> there a more reliable way to pick up the short name of the logged in
> user running the installer?

Try (in a shell) "id -a tim" and "id -a _spotlight" and see if you can
see any overlap.

Can you pick up the user name earlier on in the installer and pass it
onto your post-install script via some kind of variable?

You might get a more helpful answer on installer-dev, which I think is
the name for Apple's installer developer list.

--
Chris

 | 
Pages: 1
Prev: MacBook Disk Problems
Next: News flash!