Fixes 40dda738 which inadvertently installed to a file as the directory didn't exist. Also blocked up the postInstall script for readability.