I use the below code for programmatically installing the Sitecore package during my automated Sitecore environment creation – CLICK HERE