• 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: ProcessInformationCopyDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ProcessInformationCopyDictionary


  • Subject: Re: ProcessInformationCopyDictionary
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 11 Feb 2009 12:07:46 +0100


Le 11 févr. 09 à 11:43, Trygve Inda a écrit :

I call

ProcessInformationCopyDictionary
(&psn, kProcessDictionaryIncludeAllInformationMask);

but if the application has moved since it was launched, the result of this
call in the CFBundleExecutable and BundlePath keys is wrong. The values
contain the original location of the application.


So...
NSString *bundlePath = [dict objectForKey:@"BundlePath"];
if (bundlePath)
{
  bundle = [NSBundle bundleWithPath:bundlePath];
}

Does not work.

How can I get the real current location of a file from the Process Serial
Number?


I need to do this because my app is a system pref pane and when one installs
a pref pane over the top of an existing one, the existing one is
automatically moved to a tmp location by System Preferences. I need to
determine if the running helper app is a different version form the one
being installed... And need to get at the help app's bundle.


I suppose I could assume that if I can't obtain a real location for the
running helper app, that it has been moved and I should send a quit
AppleEvent to it, but this doesn't seem like the best way.


Any ideas?

Thanks,

Trygve



I think it exists a standard Apple Event to retrieve a process version. (get «vers»)

But you can also add a custom "get version" Apple Event handler to your helper and use it to retrieve the version from your pref pane.





_______________________________________________

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


  • Follow-Ups:
    • Re: ProcessInformationCopyDictionary
      • From: Trygve Inda <email@hidden>
    • Re: ProcessInformationCopyDictionary
      • From: Trygve Inda <email@hidden>
References: 
 >ProcessInformationCopyDictionary (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: A Mac App & helper NSStatusItem - how to share preferences
  • Next by Date: Re: ProcessInformationCopyDictionary
  • Previous by thread: ProcessInformationCopyDictionary
  • Next by thread: Re: ProcessInformationCopyDictionary
  • Index(es):
    • Date
    • Thread