fix ugly code in function getInstallPath()