Get rid of copy and paste code in installer/ and unify them.

The powershell scripts had lots of duplication. Make the unified
code instead.
Original patch was provided by Craig Ringer.
Remove the code to register XADLL from pgenlist(a) and register the
dll on installation.