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.