Reduce redundant code in installer script.

Not a huge problem or anything, but it's better than having two separate functions which do the same thing.
Merge pull request #63 from russelg/patch-1

Reduce redundant code in installer script.