Re: Find path of an application
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:x-rim-org-msg-ref-id :return-receipt-to:disposition-notification-to:message-id :content-transfer-encoding:reply-to:x-priority:references :in-reply-to:sensitivity:importance:to:cc:subject:from:date :content-type:mime-version; bh=VROzYrJXAULtoNv21WKppPPKzWGUTjsmiDHc8HuBLTo=; b=WFUidQWGsm/20gL7jSQMXObNqenRhbIDJUsDOcm/DeeXJEuS879wbGqeNvzyyf1pLL rt4WUb5z9jfnGmgZNxaPJVaRHzoE/v1F1Eeabaf/1wUQuTMK+hSq3ATaEdHYniLHYaXT zNmVq7A3LwLvuN5H/yyJv9CVEbHvdrGTwY3vc= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-rim-org-msg-ref-id:return-receipt-to:disposition-notification-to :message-id:content-transfer-encoding:reply-to:x-priority:references :in-reply-to:sensitivity:importance:to:cc:subject:from:date :content-type:mime-version; b=pQX95yHw3LAcAE567bH7561E2+pnYsCGvzm+nu3Wu7E4rqCKd/2VYS3MqqbBgRiUFP USlxWuGBHVFm9BQ0RkaOATQ2Ncgyo2WQyM139vdLNzySqJj7iJ3U+dqoo3NuuZG/pikl I9nFr6Tx8yG1b6/sswQD8J+WNO8t/Yt9nXW9k= Importance: Normal Sensitivity: Normal Hi Rakesh, The CoreServices framework is daemon safe and includes the LaunchServices. You don't need to link to the whole of Carbon for that call, just to CoreServices. Make sure that you remove all references to Carbon. Jason Sent via BlackBerry from T-Mobile -----Original Message----- From: Rakesh Singhal <rakesh.singhal@gmail.com> Date: Thu, 5 Feb 2009 22:05:07 To: Jean-Daniel Dupas<devlists@shadowlab.org> Cc: Darwin Dev<darwin-dev@lists.apple.com> Subject: Re: Find path of an application These APIs are proper but if I can not use the carbon framework(not daemon safe) in that case, I can not use these APIs. Then which APIs to use instead of LSFindApplicationForInfo()? Need to support 10.4 and 10.5 both. Regards On Tue, Dec 16, 2008 at 2:53 PM, Jean-Daniel Dupas <devlists@shadowlab.org> wrote:
1. Use Process Manager and search for bundle id or creator. 2. Use LaunchServices API (see LSFindApplicationForInfo() ). 3. Use Launch Services again. (see LSOpenApplication() ).
Le 16 déc. 08 à 10:00, Rakesh Singhal a écrit :
I am done with finding the process is running or not. Thanks a lot. Still I am stuck with second issue to find the path to my application in my system. Actually there are 3 steps:
1. To know that application is running or not? Now it is done. 2. If not then get the path of application where it was installed (user can change the path during installation). 3. Launch the application.
My code is standard C++ tool so I want to use only C and C++ APIs. Please suggest me.
Regards rksinghal
On Mon, Dec 15, 2008 at 6:58 PM, Jean-Daniel Dupas <devlists@shadowlab.org> wrote:
The name of an application is not reliable. You should never have to use it to identify an application. Use the Application Bundle identifier, or the application creator instead.
Le 15 déc. 08 à 14:12, Rakesh Singhal a écrit :
I think I need to use GetNextProcess and but I am not clear to use it to know about that my application is running or not. I know only about the name of my application and I have to iterate over GetNextProcess and use sysctl API. But i do not know how to know taht it is my application or not :-( how to relate name of application nad process serial number?
Regards
On Mon, Dec 15, 2008 at 4:30 PM, Jean-Daniel Dupas <devlists@shadowlab.org> wrote:
Le 15 déc. 08 à 11:45, Rakesh Singhal a écrit :
Hi all,
I think these are general queries still I am not aware of answer of following queries:
1. I create a package for MyApp application and option is given to user to change the path to install the MyApp application. Now in my code, I want to find out the path of MyApp application so that I can access it. So how to get the path of application?
Are you taking about Cocoa App, Carbon App, BSD tool ? For Cocoa App, use NSBundle API For Carbon App use CFBundle API (works with Cocoa too) For BSD tool, I think_NSGetExecutablePath() will do the trick (<mach-o/dyld.h>)
2. MyApp is running on my system and I need to find out that is it running or not then how to find out?
What do you mean by "find out" ? The simple answer is have a look at activity monitor but you may want to determine it programatically.
Same as above. Which kind of App ?
Cocoa: Iterate over -[NSWorkspace launchedApplications] Carbon: Use Process Manager API. BSD: use sysctl.
http://developer.apple.com/qa/qa2001/qa1123.html
Thanks in advance.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/jason.coco%40gmail.com This email sent to jason.coco@gmail.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jason Coco