Use package name instead of full package name

Fixes #6078
Using the package name instead of the full package name allows
for proper comparison.

This fixes pkg.version and pkg.latest on Windows