Sorted out the automatic package detection and installation.