Re: Install folder in users Documents
Re: Install folder in users Documents
- Subject: Re: Install folder in users Documents
- From: Greg Neagle <email@hidden>
- Date: Wed, 8 Dec 2010 13:30:52 -0800
Re-think your installer and your application.
Which user's Documents folder should you install this folder into? The user currently running the installer? What if this user is one of several users on the machine? What if the installer is being run as part of an automated install process, and there is no logged in user?
Fine, you say. I'll just write a postflight script that iterates through /Users/* and adds it to all the /Users/*/Documents/ folders.
But then -- what about users that are created _after_ the software is installed? What about users that have FileVault-protected home directories? What about network or external users, whose home directories are not under /Users/?
During installation is the _wrong_ place and time for this task, as you are making assumptions which may not be true.
If this folder is truly needed, then it's best to have a copy of the default contents somewhere in the application's resources, and on first launch of the app for a given user, copy the folder into the right place.
If you are not the developer of the software or cannot change this aspect of it, then you should create a user-level LaunchAgent that does the copying for you, and install that in /Library/LaunchAgents. Upon login, the LaunchAgent runs and can see if the folder exists for the user, and if not, it can copy it into place.
-Greg
On Dec 8, 2010, at 12:08 PM, email@hidden wrote:
> How do I get a folder installed into the users documents folder?
>
> currently I have /Documents as the destination but this make a documents folder at the startup drive root.
>
> ?
> _______________________________________________
> 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
_______________________________________________
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