• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable


  • Subject: Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 6 Jan 2011 10:50:50 -0800

On Thu, Jan 6, 2011 at 9:27 AM, eveningnick eveningnick
<email@hidden> wrote:
>> You can't do this. The Info.plist needs to refer to the main app's
>> binary. Instead, put your checks into the main app's startup code.
>> -[<NSApplicationDelegate> applicationDidFinishLaunching:] would be a
>> good place.
>>
>> This will require changes to the main app.
>
> What if i rename the Main Application's executable from
>   /Applications/MainApp.app/Contents/MacOS/MainApp
> to
>   /Applications/MainApp.app/Contents/MacOS/MainApp1
>
> and rename my pre-startup script to MainApp (and place it in
> /Applications/MainApp.app/Contents/MacOS/MainApp)?

No, because the bundle's binary will still be different from the main app.

> The problem may occur if this is LaunchServices who is responsible for
> delivering info (like main nib filename, or principal class name) from
> the plist to the application, but as far as i know this information is
> retrieved by the application itself, which means that if my script
> launches this renamed Main Application's binary
> (/Applications/MainApp.app/Contents/MacOS/MainApp1) the main
> application should act as usual - read its plist, etc.

No, NSBundle and/or dyld will probably throw a conniption.

Please don't abuse the system like this. If you really wanted, you
could make your "main" app a helper, but then you lose all sorts of
functionality like drag-to-dock-icon.

What's so hard about doing it the right way?

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Execute a pre-starting script first, when the App bundle is launched, then the main executable (From: eveningnick eveningnick <email@hidden>)
 >Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable (From: Kyle Sluder <email@hidden>)
 >Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable (From: eveningnick eveningnick <email@hidden>)

  • Prev by Date: Re: Event to trigger writeSelectionToPasteboard
  • Next by Date: Re: How to get "colored" font smoothing in a CALayer
  • Previous by thread: Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable
  • Next by thread: [UIWeVview] goBack:/goForward: (correction)
  • Index(es):
    • Date
    • Thread