Re: Installing from the Resources folder
Re: Installing from the Resources folder
- Subject: Re: Installing from the Resources folder
- From: Conor Schutzman <email@hidden>
- Date: Tue, 14 Jan 2014 17:37:58 -0800
You could use read the current locale from global prefs, and have the appropriate file copied through post install based on what it reads.
Something like (this is for demonstration, written on the fly here in email, has not been debugged):
CurrentLocale=$(defaults read -g AppleLocale)
if [[ “$CurrentLocale" = en_US ]]; then
cp ./en.lproj/en_eula.txt /Users/Shared/en_eula.txt
elif [[ “$CurrentLocale" = fr ]]; then
cp ./fr.lproj/fr_eula.txt /Users/Shared/fr_eula.txt
<insert each locale as an elif>
fi
Or…
PossibleLocales=( en fr de )
for EachLocale in “${PossibleLocales[@]}; do
CurrentLocale=$(defaults read -g AppleLocale)
if [[ “$CurrentLocale” = “$EachLocale” ]]; then
cp "./$EachLocale.lprog/eula.txt” “/Users/Shared/eula.txt”
fi
done
Just shooting from the hip…
On Jan 14, 2014, at 5:20 PM, Mitchell J Laurren-Ring <email@hidden> wrote:
> Sadly, I'm still using packagemaker on the command line. I could make a copy of the EULAs and make them part of the payload, but it doesn't solve the localization problem - i.e. I'd like to only install one EULA, not all of them.
>
>
> /Mick
>
> On Jan 14, 2014, at 5:05 PM, Conor Schutzman wrote:
>
>> What are you using for your development application?
>> I use Packages, and thus can easily point both the installer plugin and the payload to reference the same file.
>>
>>
>> On Jan 14, 2014, at 4:29 PM, Mitchell J Laurren-Ring <email@hidden> wrote:
>>
>>> Thanks for your reply, Bill.
>>>
>>> 1) I am using the plugin. I've asked management if it's sufficient. I want to know my options should they say "no". :)
>>>
>>> 2) Assuming that my payload does not include a standard app bundle (it does not), is it possible to install only the license agreement for the user's language as part of the payload?
>>>
>>>
>>> /Mick
>>>
>>>
>>> On Jan 14, 2014, at 3:43 PM, Bill Coderre wrote:
>>>
>>>> 1) If you are using the “License” installer plugin (and you should), there’s a button to save the license wherever the user wants. Isn’t that good enough?
>>>>
>>>> 2) Apple adds licenses/acknowledgements to the payload, usually as part of the application itself. This makes the package bigger, but it greatly simplifies coding.
>>>>
>>>> 3) Please bear in mind that this is not an endorsement, and is not guaranteed to work.
>>>>
>>>> You can find user language preferences here
>>>> https://developer.apple.com/library/mac/qa/qa1391/_index.html
>>>>
>>>> As said below, your current working directory in a post install script is the “Resources” folder in your package.
>>>>
>>>>
>>>>
>>>> On Jan 14, 2014, at 3:28 PM, Mitchell J Laurren-Ring <email@hidden> wrote:
>>>>> I should have mentioned my installer is localized with 8 languages. How do I get the EULA for the current language?
>>>>>
>>>>> /Mick
>>>>> On Jan 14, 2014, at 3:13 PM, Conor Schutzman wrote:
>>>>>
>>>>>> In post install, you should just be able to reference the file as ./filename (as your PWD for the post install script *should* be the same folder). You could then just use that as the source in a copy command.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Jan 14, 2014, at 2:58 PM, Mitchell J Laurren-Ring <email@hidden> wrote:
>>>>>>
>>>>>>> Is it possible to install a file from the installer package Resources folder? My overlords want to save the EULA so the user can look at it any time they like.
>>>>>>>
>>>>>>> Is there a way to do this from the postflight script? Environment variables?
>>>>>>>
>>>>>>> /Mick
>>>>>>> _______________________________________________
>>>>>>> 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
>>>>
>>>
>>
>
_______________________________________________
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