In 5.1, the metabase stores the website parameters. So you ran the setup you made, and the setup did not complete all the parameters, leaving you with a broken website. So go back to the website installer you made and fix the code. And test it running in debug, or at least look at 5.1 IIS management, to see what your missing. Write down what your missing on a piece of paper, and make the adjustments to your installation program. Use the process of elimination, until you narrow it down, and it works.