• 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: launching 2 same applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launching 2 same applications


  • Subject: Re: launching 2 same applications
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Tue, 7 Oct 2003 20:38:06 +0200

At 17:56 Uhr +0000 07.10.2003, Sean Liong wrote:
The main problem is that how can I launch the application only after determine that it is reside in the path I want.
For example if the application was on a CD, the user can launch the application which is on the CD, but actually the application on the CD will check it own path, the path was not the desired path so the application quit itself and run the application from the desired path. Can this be achieved without any other app involved? There shall only be one application.

To get your app's own path, you can use NSBundle methods to get at the path of the mainBundle.

To find another application, check out the LaunchServices APIs or NSWorkspace or NSFileManager. One of these should contain a method to look up an application using its bundle identifier. Though I'm not sure whether that wouldn't get the current application as well...

But why do you have something like a *desired* path at all? Why is it so bad that the user could launch your application from the CD? If they want to put your application in ~/Applications or in ~/Work Related/Sean's App/ why don't you let them? What deeper reason do you have? What are you trying to achieve?

-> If this is some sort of copy protection, just let it go. Annoying your legitimate users with arbitrary restrictions just to catch the small percentage that cheats doesn't pay off, it only causes damage by scaring away legitimate users.

-> If you're trying to find another item that is close to your app, try simply embedding it in your application's bundle instead.

-> If you're working with another piece of software (e.g. a command-line tool to which you don't have the source code that expects files in certain places), then add code to your application that checks for the existence of these files and the tool at launch time and installs them from canned copies in your bundle.

It sounds a lot like you're trying to solve a problem the wrong way. What exactly is your actual (higher-level) problem? If you tell us, we could maybe point you at much better solutions if you let us.

My apologies in advance if you should have a legitimate reason for this. In that case, maybe I'm saving a beginner from making the mistake I think is being made here.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: launching 2 same applications (From: "Sean Liong" <email@hidden>)

  • Prev by Date: Multiple Threaded Windows
  • Next by Date: open remote file with local application?
  • Previous by thread: Re: launching 2 same applications
  • Next by thread: Re: launching 2 same applications
  • Index(es):
    • Date
    • Thread