PackageInstaller: use dirname() instead of .. and substr