Re: postinstall scripts not executing
Re: postinstall scripts not executing
- Subject: Re: postinstall scripts not executing
- From: Luke Bellandi <email@hidden>
- Date: Thu, 14 Aug 2008 11:00:30 -0700
- Thread-topic: postinstall scripts not executing
On 8/14/08 10:51 AM, "Gignac, Jason (HAS-SAT)" <email@hidden>
wrote:
> Is there any particular documentation on the why-and-wherefores of the
> discouragement against pref-writing?
Good question -- I can't recall exactly, though searching the archives would
likely yield some more information and/or maybe the installer team can
comment.
>
> On 8/14/08 Thursday, August 14, 2008 -12:47 PM, "Luke Bellandi"
> <email@hidden> wrote:
>
>> My position is that it's generally discouraged to write preference files
>> during the installation process. However that's avoided is up to the
>> developer.
>>
>> It may not be avoidable in all cases, but I'd encourage dev's to be creative
>> in ways to accomplish this. For example, you do not necessarily need control
>> over the source code to perform registration -- an Internet based solution
>> is a possibility.
>>
>> Also, to be clear, I'm referring strictly to proper preference files --
>> those in <<some-domain>>/Library/Preferences/. Writing files in other
>> locations in the system (as appropriate) is not cautioned against.
>>
>>
>> On 8/14/08 10:39 AM, "Gignac, Jason (HAS-SAT)" <email@hidden>
>> wrote:
>>
>>> But, then, he'd have to have control over the source code of the app for
>>> that to work. Not too bad if it's an internal app, but obviously impractical
>>> for, for instance, registering Fetch after install, or something.
>>>
>>>
>>> On 8/14/08 Thursday, August 14, 2008 -12:32 PM, "Luke Bellandi"
>>> <email@hidden> wrote:
>>>
>>>> Right -- so I'd assume that you'd install as root, then a user would launch
>>>> the app. Launched by the user, the app would write out preferences in the
>>>> user pref directory. Isn't that what you're trying to do here?
>>>>
>>>>
>>>> On 8/14/08 10:28 AM, "Jeremy Matthews" <email@hidden> wrote:
>>>>
>>>>> The issue would be that the installer runs as root, and not the user
>>>>> install it.
>>>>> We have user-based preference files...
>>>>>
>>>>> Thanks,
>>>>> j
>>>>>
>>>>> On Aug 14, 2008, at 1:22 PM, Luke Bellandi wrote:
>>>>>
>>>>>> I'd suggest having the application write out all preferences. It's
>>>>>> generally
>>>>>> much better practice to have the application manage all preferences as
>>>>>> opposed to having the Installer push defaults into place during
>>>>>> installation.
>>>>>>
>>>>>> Apps can check for non-existent prefs on first launch and write them
>>>>>> out
>>>>>> then as necessary.
>>>>>>
>>>>>>
>>>>>> On 8/14/08 9:56 AM, "Jeremy Matthews" <email@hidden> wrote:
>>>>>>
>>>>>>> Question - can we get packagemaker to respect the tilde-based path in
>>>>>>> component installation paths?
>>>>>>> Every time we tried it kicked it back...but this would be really nice
>>>>>>> for depositing user-specific files during an install.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> jeremy
>>>>>>>
>>>>>>> On Aug 14, 2008, at 12:25 PM, Gignac, Jason (HAS-SAT) wrote:
>>>>>>>
>>>>>>>> My pleasure.
>>>>>>>>
>>>>>>>>
>>>>>>>> On 8/14/08 Thursday, August 14, 2008 -11:24 AM, "Jeremy Matthews"
>>>>>>>> <email@hidden> wrote:
>>>>>>>>
>>>>>>>>> hmmm...interesting.
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> -j
>>>>>>>>>
>>>>>>>>> On Aug 14, 2008, at 12:23 PM, Gignac, Jason (HAS-SAT) wrote:
>>>>>>>>>
>>>>>>>>>> You might try just putting a default pref file in the package,
>>>>>>>>>> then
>>>>>>>>>> writing,
>>>>>>>>>> see if ti works. I've had mixed results with writing to
>>>>>>>>>> nonexistent
>>>>>>>>>> prefs
>>>>>>>>>> files.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 8/14/08 Thursday, August 14, 2008 -11:20 AM, "Jeremy Matthews"
>>>>>>>>>> <email@hidden> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hmmm - some do and some don't.
>>>>>>>>>>> Normally, when you perform that kind of action, it will create
>>>>>>>>>>> the
>>>>>>>>>>> plist if not already there....unless you know something I have
>>>>>>>>>>> forgotten...
>>>>>>>>>>>
>>>>>>>>>>> Ideas?
>>>>>>>>>>>
>>>>>>>>>>> thanks,
>>>>>>>>>>> jeremy
>>>>>>>>>>>
>>>>>>>>>>> On Aug 14, 2008, at 12:18 PM, Gignac, Jason (HAS-SAT) wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Does the pref file you are writing to already exist or not?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 8/14/08 Thursday, August 14, 2008 -11:17 AM, "Jeremy
>>>>>>>>>>>> Matthews"
>>>>>>>>>>>> <email@hidden> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hmmmm...even if we were writing to defaults to:
>>>>>>>>>>>>
>>>>>>>>>>>> /Library/Preferences/com.apple.xxx simplestring abc123
>>>>>>>>>>>>
>>>>>>>>>>>> I get the user defaults thing - we can work around that.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> jeremy
>>>>>>>>>>>>
>>>>>>>>>>>> On Aug 14, 2008, at 12:12 PM, Luke Bellandi wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Jeremy,
>>>>>>>>>>>>
>>>>>>>>>>>> IIRC, if when installing a package with Admin/Root privileges,
>>>>>>>>>>>> these
>>>>>>>>>>>> scripts
>>>>>>>>>>>> are run as root user. In that case, any mucking with user-
>>>>>>>>>>>> preferences will
>>>>>>>>>>>> change the root user's preferences -- not the prefs of the
>>>>>>>>>>>> user
>>>>>>>>>>>> that
>>>>>>>>>>>> launched the package. I'd check that out.
>>>>>>>>>>>>
>>>>>>>>>>>> Best,
>>>>>>>>>>>> Luke
>>>>>>>>>>>>
>>>>>>>>>>>> On 8/14/08 5:40 AM, "Jeremy Matthews" <email@hidden>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> After doing some maintenance on my computer I noticed that
>>>>>>>>>>>> simple
>>>>>>>>>>>> shell scripts are now working (echo commands, etc) in
>>>>>>>>>>>> packages -
>>>>>>>>>>>> maybe
>>>>>>>>>>>> those 3 developer packages needed some housekeeping...
>>>>>>>>>>>>
>>>>>>>>>>>> However, some of my other postinstall scripts don't execute
>>>>>>>>>>>> (which I
>>>>>>>>>>>> never tried before anyways); most of these write to user
>>>>>>>>>>>> defaults,
>>>>>>>>>>>> for
>>>>>>>>>>>> example, registering Transmit:
>>>>>>>>>>>>
>>>>>>>>>>>> -----
>>>>>>>>>>>> ## Licensing Transmit
>>>>>>>>>>>> defaults write com.panic.Transmit3 SerialNumber XXXX-XXXX-
>>>>>>>>>>>> XXXX-
>>>>>>>>>>>> XXXX
>>>>>>>>>>>> -----
>>>>>>>>>>>>
>>>>>>>>>>>> What are the known limits to postinstall scripts?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> jeremy
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Aug 13, 2008, at 5:39 PM, Gignac, Jason (HAS-SAT) wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> That's correct, 'ccording to Apple, you just have the one
>>>>>>>>>>>> pre
>>>>>>>>>>>> and
>>>>>>>>>>>> the one
>>>>>>>>>>>> post script in a flat package.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 8/13/08 Wednesday, August 13, 2008 -4:38 PM, "Stéphane
>>>>>>>>>>>> Sudre"
>>>>>>>>>>>> <email@hidden> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Aug 13, 2008, at 12:22 AM, Jeremy Matthews wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Since I got asked (more than once) about using
>>>>>>>>>>>> postUPPGRADE
>>>>>>>>>>>> scripts
>>>>>>>>>>>> (not just postinstall), I assumed there was some bug in
>>>>>>>>>>>> packagemaker that mean it was supporting those as a
>>>>>>>>>>>> workaround
>>>>>>>>>>>> for
>>>>>>>>>>>> not supporting postINSTALL scripts.
>>>>>>>>>>>>
>>>>>>>>>>>> So, I had specified a postinstall script (per 10.5 -
>>>>>>>>>>>> normal)
>>>>>>>>>>>> as
>>>>>>>>>>>> well as a directory containing a scripts "postupgrade". Of
>>>>>>>>>>>> course,
>>>>>>>>>>>> I tried builgind and installing packages with and without
>>>>>>>>>>>> that
>>>>>>>>>>>> option - nothing seemed to work.
>>>>>>>>>>>>
>>>>>>>>>>>> If you can provide a sample package illustrating the issue,
>>>>>>>>>>>> this
>>>>>>>>>>>> can
>>>>>>>>>>>> help.
>>>>>>>>>>>>
>>>>>>>>>>>> As far as I can tell (from the documentation), postupgrade
>>>>>>>>>>>> script
>>>>>>>>>>>> are
>>>>>>>>>>>> not supported by the FLAT package format. Adding one to the
>>>>>>>>>>>> resources
>>>>>>>>>>>> would not help.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> Do not post admin requests to the list. They will be
>>>>>>>>>>>> ignored.
>>>>>>>>>>>> Installer-dev mailing list (email@hidden
>>>>>>>>>>>> )
>>>>>>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>>>>>>
>>>>>>>>>>>> 0p
>>>>>>>>>>>> ea
>>>>>>>>>>>> rs
>>>>>>>>>>>> on
>>>>>>>>>>>> .c
>>>>>>>>>>>> o
>>>>>>>>>>>>
>>>>>>>>>>>> m
>>>>>>>>>>>>
>>>>>>>>>>>> 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:
>>>>>>>>>>>>
>>>>
>>>
>>
>
>
>>
>>>
>>>>
>>>> m
>>>>>>>>>>>>
>>>>>>>>>>>> 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
>>>>
>>>
>>
>
_______________________________________________
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