Re: User Defaults (settings) during install question
Re: User Defaults (settings) during install question
- Subject: Re: User Defaults (settings) during install question
- From: Steve Stockman <email@hidden>
- Date: Wed, 31 Jan 2007 09:24:07 -0600
- Thread-topic: User Defaults (settings) during install question
Second what John Daniel said, that it would be better to change your app so
that it can start up without the plist.
As your app works now, your installer must assume that everyone that will
use the app will have their home directory available to the installer at
well-known paths. Depending on the environment, this may be a bad
assumption, because some home directories may exist on network servers, some
users may be added later either locally or on the network, and some home
directories may even be encrypted disk images (FileVault). Such assumption
is probably okay for an app strictly intended for internal use, but you
wouldn't want it leaving your organization that way. Not even as freeware.
If it is absolutely essential that your app works the way it currently does
(or changing it would be way too painful), I would suggest the following:
1. Create a tool that, given a path to a home directory, will initialize a
plist file in that homedir's Library/Preferences folder. Your tool could
just be a script that invokes the OS X "defaults" tool one or more times
(unless your plist includes encrypted data or structures too complex for
defaults). If you're more ambitious, you can bundle it as an application
that can also be invoked from the command line.
2. Include that initialization tool in the installer, dropping it into
/usr/local/bin, /usr/share/bin, or some similar place if it is command-line
only, or into /Applications if it is launchable.
3. In a postinstall script, invoke the tool on the installing user's home
directory, or perhaps on every directory within /Users that already has a
Library subdirectory (eliminates Shared as well as locked FileVaults).
After install, if more users need access to the app, they can run the tool
to initialize their preferences.
--
Steve Stockman
> From: Matt R <email@hidden>
> Date: Tue, 30 Jan 2007 22:23:06 -0600
> To: <email@hidden>
> Subject: User Defaults (settings) during install question
>
> How can I create a .plist file in the ~/Library/Preferences folder
> with the default User Defaults (settings) during the installation of a
> program? Without the .plist file in the ~/Library/Preferences folder
> the app will not start up.
>
> ~Matt
_______________________________________________
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