potionfactory / LetsMove

A sample that shows how to move a running Mac application to the /Applications directory
http://www.potionfactory.com/blog/2009/09/17/move-applications-folder
963 stars 137 forks source link

Only move to user Applications folder if already in use. #15

Closed pilotmoon closed 12 years ago

pilotmoon commented 12 years ago

With this change, PreferredInstallLocation() only returns ~/Applications over /Applications if it exists AND contains other apps already.

The extra check is to see if the user is actually using ~/Applications to store applications, and thus avoid surprising the user if they are not.

Rationale: I have used PFMoveApplication in a shipping app and several customers contacted me to ask why the app installed itself in their (empty) ~/Applications directory. It turned out they had this directory on disk but were not using it. (I don't know how it gets created. I guess some third party app or install script does it.)