Solved missing variable definition and permission problems in installation script