Set everything in install inside a function

This is to prevent problems in case the connection gets dropped when
getting it, as per the command in the README