Extract plugin installation function.