• 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: Replacing Info.plist programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing Info.plist programmatically


  • Subject: Re: Replacing Info.plist programmatically
  • From: Claudio Procida <email@hidden>
  • Date: Thu, 23 Nov 2006 01:28:55 +0100

That isn't your only concern. If the user isn't running as an admin, it is likely that they won't be able to modify the app bundle's contents at all :|
Also, in a multi-user environment, you may have two different users and each one could have a different preference about whether it should show in the dock or not.

definitely right.

Right. That will do it.
I learn that TransformProcessType will work only if the app is LSBackgroundOnly (while I need LSUIElement, as I'd like to always show the window).

Second, where do I have to put the call to TransformProcessType? In applicationDidFinishLaunching: seems to be too late, as the Dock icon won't show. I've put it into the app's delegate +initialize: method and still I have these glitches

- the Dock Icon won't bounce, it just appears from nowhere already still.
- the menubar won't show!

the code I'm using now is the following:

if (![[defaults valueForKey:MBLHideDockIconKey] boolValue])
{
ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType <http://cocoadev.com/index.pl?TransformProcessType>(&psn,
kProcessTransformToForegroundApplication);
if (returnCode != 0)
{
NSLog <http://cocoadev.com/index.pl?NSLog>(@"Could not transform to a foreground app. Error %d", returnCode);
}
OSErr errCode = SetFrontProcess(&psn);
if (errCode != 0)
{
NSLog <http://cocoadev.com/index.pl?NSLog>(@"Could not bring the app to front. Error %d", errCode);
}
}


I guess I'm going slightly Off Topic here since this is Carbon stuff :/

--
Claudio Procida
Emeraldion Lodge
http://www.emeraldion.it

_______________________________________________

Cocoa-dev mailing list      (email@hidden)

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


  • Follow-Ups:
    • Re: Replacing Info.plist programmatically
      • From: John Stiles <email@hidden>
  • Prev by Date: Caching variables in ManagedObjects
  • Next by Date: Re: Replacing Info.plist programmatically
  • Previous by thread: Re: Replacing Info.plist programmatically
  • Next by thread: Re: Replacing Info.plist programmatically
  • Index(es):
    • Date
    • Thread