Re: 10.4: Installing to desktop
Re: 10.4: Installing to desktop
- Subject: Re: 10.4: Installing to desktop
- From: Bill Coderre <email@hidden>
- Date: Thu, 25 Feb 2010 13:02:32 -0800
On Feb 25, 2010, at 10:42 AM, Colin Cornaby wrote:
> Is there a way via a preflight or something on 10.4 to get the target set to the current user's desktop for an installation? I have an installer where the client wants the user to be able to choose the path, but the path to default to the desktop.
No, there's no way to have the installer target directly to the currently running user's desktop. The installer's copying mechanism cannot "glob ~", and preflight and postflight cannot influence the copying mechanism.
I believe that preflight and postflight scripts can find the currently logged in user's home directory by "globbing ~" and the installer sets/maintains the environment variable $USER (which is user name, and you could theoretically call dscl to find out home directories).
So you might think, "Oh, I can install into a temporary location, then move stuff to the desktop later," but this does not handle the case where you want the user to be able to select a different custom location.
Also, installing to a temporary location can have security issues, and you might have to deal with permissions issues (if you install into a non-admin user's desktop, you'd best be sure that the owner/group/permissions are appropriate).
It also doesn't account for the fact that Mac OS X is a multi-user system, and in general, one user does not have access to another's desktop.
So what are you really trying to do? If you want to install an App, you should probably install it in /Applications. If you want to install a bunch of documents, is /Users/shared/ good enough? If not, maybe install there and make an alias to point to it?
(Although it's really a symlink, not an alias, one creates these via unix "ln -s") _______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden