I'm still confused. [Confused] [Confused]
That is exactly what you are doing. Firstly, you check wheter that key exists. Secondly, if the key is found, then you execute the package installation.
So, what is the problem with it? Is it not running? Do you get any error messages when you run that script?
_________________________
There are two types of vessels, submarines and targets.