Reduce code duplication in the Install visitor
Fix permissions and line endings