Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have just reinstalled my Air with Lion. I didn't want to do a Time Machine restore, as I really didn't want any of the old apps, and I'd like to manually sort through my home folder and discard old crud.

After copying back my previous hard drive contents to ~/PREV, I noticed that Spotlight would suggest to launch apps that existed there, even though I hadn't "installed" them, like copied them to the /Applications folder or run their installers (for those that have them).

I quickly updated the Spotlight preferences to not index the ~/PREV folder (no need to, anyway, as it was only a temporary folder). That fixed that.

Now, I just discovered that Finder has context menu items stemming from BetterZip, which is now in my Downloads folder, having been copied over from my PREV folder. I did not install BetterZip.

What the ....? Somehow OS X is automagically installing .app files whereever it finds them? How on earth is this a good idea? What is OS X doing behind my back? And most importantly, how do I stop this crazy behavior?

Thanks :)

share|improve this question
    
You installed it by putting it on your harddrive. The adding of the context menu however suggests you ran it at least once. –  Gerry Dec 4 '12 at 5:35
    
@Gerry, well that's what I'm suggesting at. However, I have not run it. Which shows that something besides harmless indexing of *.app folders on the hard drive, regardless of location, is going on. And this is what I would like to turn off. –  DanielSmedegaardBuus Dec 4 '12 at 8:01
    
Seems I'm not the only one wondering: stackoverflow.com/questions/12708017/… –  DanielSmedegaardBuus Dec 4 '12 at 8:14
add comment

2 Answers

Okay, so so far I have no idea how to prevent .app bundles from being automatically "registered", but I now know how to repair the system.

It seems that it's lsregister which is responsible for scanning the system for .app bundles with launch services defined, and then automatically registering them in the launch services database. Seems insane, but apparently this is intended. Possibly to help with restoring from Time Machine backups.

AFAICT, no other configuration is being done, and no configuration files or other app-specific files are being copied from the bundles, so the damage is pretty mild and easily fixable. Also, it would appear that simply deleting the .app folders, zipping them up, or moving them way outside the reach of lsregister (like on a network drive or an external disk, perhaps, though I've read one guy complaining that even different partitions will be scanned) will eventually clear up those launch services. Though it should happen on logout/login, I wasn't able to get rid of them by doing this.

Zipping up my .app bundle and then issuing (in a terminal) —

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

— cleaned up my launch services database without having to log out and back in (which didn't work in the first place) or restarting (haven't tried it).

I've noticed that placing .app bundles in a hidden folder, i.e. one with a dot as the first character, e.g. ".my-downloads", will stop Spotlight from indexing them and presenting them as launchable apps. I'm wondering if the same applies to the lsregister scanning. If so, putting my downloads in ~/.downloads and then simply creating a symlink to this folder as "Downloads" should keep me safe. Gonna try that out.

share|improve this answer
add comment

The Apps that the Finder shows in the context menu "Open with..." are not determined by Spotlight. Independently of Spotlight the System scans for all .app files on your disk and builds a database of Apps and the file types they can open. As long as you have an App on your disk, the Finder will offer to open files with it.

AFAIK, you can only prevent this behavior by either moving your apps to another disk, deleting them entirely or (what I often do) zipping them.

(By the way, OS X is not installing the Apps. Usually an App is 'installed' when it just is on your disk. Installing like on Windows is hardly ever necessary for an App to run on OS X)

share|improve this answer
    
Thanks for the input, coding friend :) The link I've included in the comment to my OP links further to info on how Services are registered with .app bundles. It seems these services are automatically registered when the system scans the .app folders. I reviewed the uninstall directions for BetterZip which only mentioned deleting the preferences under ~/Library. Of course, as I never installed or ran it, I don't have these files. There aren't any in /Library. It seems the only litter are these Services. I'm working on how to get rid of them. This is horrible. I had stuff like CS in that folder. –  DanielSmedegaardBuus Dec 4 '12 at 12:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.