How does Panther knows where applications are?

Discussion in 'Mac OS X 10.3 (Panther) Discussion' started by Ulex, Jul 19, 2004.

  1. Ulex macrumors newbie

    Joined:
    Jul 16, 2004
    #1
    Well, just curious… Windows has the registry… But OS X doesn’t seem to have one. So how OS X knows where the Applications are? Does it do a system scan when logging in? Does it create a register when I execute an application?

    Suppose I insert a CD with an application inside. Does OS X automatically know that that application is there even without executing it?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    This all works through LaunchServices which is very clever. Instead of having a registry that corrupts and gets bloated you have a combination of things. When the file system first opens a directory or volume it scans that for various things including apps. If any are found launch services queries their Info.plist files to see what file types they support. This is stored in a lookup in RAM (and possibly cached to disk). Other things like window position preferences and the like than many Windows apps store in the registry are stored in xml files in ~/Library/Preferences.

    You can read all about it here.
     
  3. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #3
    So if LaunchServices goes down, things like the open command in the Terminal will not work? Presumably the Finder handles some of these duties - what happens when it dies?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    LaunchServices are a low level system thing. I don't think that they can die easily. If they totally bug out I imagine one of two things happens:

    1) You computer cannot open files and applications properly!
    2) Something (possibly the Finder) notices and restarts them/
     
  5. Ulex thread starter macrumors newbie

    Joined:
    Jul 16, 2004
    #5
    Thanks, that’s a very explicit explanation. Just one academic situation: suppose I have Office X v. 1.5 installed on my OS X disk. Then I insert a CD with Office X v. 1.1 and I browse the CD with Finder. Then:

    1st question: If I try to open a .doc file, which Office X will OS X use?
    2nd question: Just by browsing the Office X 1.1 directory on the CD, will this change ANY setting or configuration of Office X 1.5 installed on my OS X disk?
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    As the app version number is stored in the Info.plist file I imagine that it would continue to use the correct version (as it has the highest version number). LaunchServices also has some sort of system where it ignores apps once it's seen them. As the bundle identifier for say Word is probably the same over versions it will ignore the second version it seems anyway.
     

Share This Page