Fix package install detection when using a symlink.

Original author: ark