Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable
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: eveningnick eveningnick <email@hidden>
- Date: Thu, 6 Jan 2011 19:27:10 +0200
> 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)?
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.
i know It looks like a dirty hack, but is it possible to do this way,
without modifying the main application (except simple renaming of its
binary)? What pitfalls could i run into, doing that?
_______________________________________________
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