title: Postgresql failed to install correcty
body: <p>I have been trying to install PostgreSQL 9.2 for the last couple of days. I guess I tried everything that I could find online but the service still will not start. I am currently running Windows 7 SP1. I used to have PostgreSQL 8.3 installed and working fine but a couple of weeks ago I decided to uninstall it. I thoroughly uninstalled it (delete the postgres user and the data file) and now every time I try to install any version I get this non-fatal error at the end of the setup when the loading of the database modules takes place. 
  I managed to see that the postgresql service does not start or as windows puts it starts then stops.
  This is the relevant part of the log file of the installation:</p>
  
  <p>Successfully processed 771 files; Failed processing 0 files</p>
  
  <p>initcluster.vbs ran to completion</p>
  
  <p>Script stderr:</p>
  
  <pre>
  Configuring database server startup...
  Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\startupcfg.vbs" 9.2 "NT AUTHORITY\NetworkService" "****" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" "postgresql-9.2"
  Script exit code: 0
  
  Script output:
   startupcfg.vbs ran to completion
  
  Script stderr:
  
  Creating menu shortcuts...
  Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\createshortcuts.vbs" 9.2 "postgres" 5432 "PostgreSQL 9.2 (x86)" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" "postgresql-9.2"
  Script exit code: 0
  
  Script output:
   Start FixupFile(C:\Program Files (x86)\PostgreSQL\9.2\scripts\serverctl.vbs)...
     Opening file for reading...
     Closing file (reading)...
     Replacing placeholders...
     Opening file for writing...
     Closing file...
    End FixupFile()...
  Start FixupFile(C:\Program Files (x86)\PostgreSQL\9.2\scripts\runpsql.bat)...
     Opening file for reading...
     Closing file (reading)...
     Replacing placeholders...
     Opening file for writing...
     Closing file...
    End FixupFile()...
  createshortcuts.vbs ran to completion
  
  Script stderr:
  
  
  Starting the database server...
  Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\startserver.vbs" postgresql-9.2
  Script exit code: 0
  
  Script output:
   Starting postgresql-9.2
  Service postgresql-9.2 started successfully
  startserver.vbs ran to completion
  
  Script stderr:
  
  
  Loading additional SQL modules...
  Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" 5432
  Script exit code: 2
  
  Script output:
   Installing the adminpack module in the postgres database...
      Executing 'C:\Users\George\AppData\Local\Temp\radA5996.bat'...
  psql: server closed the connection unexpectedly
      This probably means the server terminated abnormally
      before or while processing the request.
  
  Failed to install the 'adminpack' module in the 'postgres' database
  loadmodules.vbs ran to completion
  
  Script stderr:
   Program ended with an error exit code
  
  Error running cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.2\installer\server\loadmodules.vbs" "postgres" "****" "C:\Program Files (x86)\PostgreSQL\9.2" "C:\Program Files (x86)\PostgreSQL\9.2\data" 5432 : Program ended with an error exit code
  
  [10:34:28] Write the data directory to the ini file...
  [10:34:28] Write the port number, service ID, locale and superuser to the ini file...
  [10:34:28] Write ServiceID(postgresql-9.2) to registry/ini...
  [10:34:28] Write Superuser to ini file and windows registry...
  [10:34:28] Write Service Account to ini file and windows registry...
  [10:34:28] Write the server description to the ini file...
  [10:34:28] Write the server branding to the ini file...
  [10:34:28] Write the 'whether stack-builder is disabled or not' to the ini file...
  [10:34:29] Finished running post-installation/upgrade tasks.
  
  Creating Uninstaller
  Creating uninstaller 25%
  Creating uninstaller 50%
  Creating uninstaller 75%
  Creating uninstaller 100%
  Installation completed
  </pre>