add logic to install hosted and packaged apps (fixes #2)