RE: Strange behaviour with defaults read in install script
RE: Strange behaviour with defaults read in install script
- Subject: RE: Strange behaviour with defaults read in install script
- From: "Glover,David" <email@hidden>
- Date: Mon, 9 Mar 2009 17:09:44 -0000
- Thread-topic: Strange behaviour with defaults read in install script
Hi Karl, thanks for your response.
I'm trying out a few different things to retrieve the default language
the machine is running in.
What is really strange is that this works ok in a script...
defaults read -g AppleLocale
But that's not perfect as it's the language I'm trying to retrieve
rather than the locale. By getting AppleLanguages, I can get the first
language in the list.
-----Original Message-----
From: Karl Kuehn [mailto:email@hidden]
Sent: 09 March 2009 17:00
To: Glover,David
Cc: Installer-Dev mailing-list
Subject: Re: Strange behaviour with defaults read in install script
On Mar 9, 2009, at 9:45 AM, Glover,David wrote:
> I'm using a preinstall script to read the available languages on the
> machine as follows;
>
> defaults read -g AppleLanguages
>
> This is fine via a Terminal command, or when running the script by
> Terminal, but when the script is run by Installer, the following is
> outputted;
>
> "The domain/default pair of (kCFPreferencesAnyApplication,
> AppleLanguages) does not exist"
>
> Has anybody come across this unusual behaviour before? Why has
> Installer decided to start lying to me?
Installer isn't lying to you, it is telling you that for the
user
that you are running at at that point the list of default languages is
not. This is true for any non-GUI user (try running this with sudo for
instance). This command is essentially calling:
defaults read .GlobalPreferences AppleLanguages
And many users do not have a file at
~username/.GlobalPreferences.plist
What are you really trying to accomplish here? And are you sure
that
the installer is the appropriate place for this?
--
Karl Kuehn
email@hidden
Promethean Limited is a company registered in England and Wales with company number 1308938 and VAT number GB 572 2599 18
______________________________________________
Promethean Ltd and or associated and or subsidiary companies :
The views expressed in this communication may not necessarily be
the views held by Promethean Ltd and or associated and or subsidiary companies.
This e-mail is for the exclusive use of the addressee(s). Unauthorised
disclosure, copying or distribution is prohibited.
This e-mail message has been swept for the presence of computer viruses.
Promethean Ltd and or associated and or subsidiary companies accepts no liability for any loss resulting from this email transmission.
Promethean, Promethean House, Lower Philips Road, Blackburn, Lancashire, BB1 5TH, UK. Please update your records accordingly. Thank you!
*****************************************************************
This email has been checked by the e-Sweeper Service
*****************************************************************
_______________________________________________
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