ProcessInformationCopyDictionary
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 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ProcessInformationCopyDictionary
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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ProcessInformationCopyDictionary
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. This works great for future versions, but not existing ones. I'll look at the AE vers. Thanks, Trygve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ProcessInformationCopyDictionary
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. Hmmm... It seems keyAEVersion ('vers') only gets the version info for the Apple Event Manager, not the target process. Trygve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ProcessInformationCopyDictionary
Le 11 févr. 09 à 12:54, Trygve Inda a écrit : 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. Hmmm... It seems keyAEVersion ('vers') only gets the version info for the Apple Event Manager, not the target process. Trygve Using AppleScript, you can test what it returns. tell app your application to get version AFAK, it just sends a get vers event. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: ProcessInformationCopyDictionary
Le 11 févr. 09 à 12:46, Trygve Inda a écrit : 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. This works great for future versions, but not existing ones. I'll look at the AE vers. If the helper app does not respond to your get version request, so you can assume it is an older version than the one installed. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com