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.)
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.)