PostgreSQL Installation Problem on Windows without WSH


PostgreSQL 8.3 and 8.4 may fail to install on Windows with the following error message: “An error occurred executing the Microsoft VC++ runtime installer”. PostgreSQL 9.x may fail with a different message: “Unable to write inside TEMP environment variable path”, but the actual reason appears to be the same.

It turns out that the installer requires Windows Script Host to be enabled (there might be other reasons, but this is the problem I have stumbled upon).

Before you start messing with the registry, check if WSH is actually disabled or not. To do that run wscript.exe in the DOS box.

  • If you see a dialog box called “Windows Script Host Settings”, WSH is enabled, and your problem with PostgreSQL installation must be related to something else.
  • If you get an error box that says “Windows Script Host access is disabled on this machine. Contact your administrator for details”, WSH is disabled, and your problem with PostgreSQL installation may be related to it (or may be not).
Here is how to enable Windows Script Host for the current user (assuming he/she has administrator rights, of course):
  1. Start Registry Editor (Start => Run… => regedit).
  2. In the Registry Editor open HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
  3. Make sure you actually are “inside” the Settings “folder”.
  4. Right-click anywhere in the right pane of the Registry Editor and select New => DWORD Value and call it “Enabled”. Then, double-click it and set the “Value data” field to “1”.
  5. Check if WSH is now enabled by running wscript.exe in the DOS box (see above).
  6. In the Registry Editor open HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
  7. If WSH is enabled, try installing PostgreSQL. If not, see below how to enable WSH system-wide.
  8. Once the installation is complete, you can disable WSH by setting the “Enabled” value to “0”.
The above may not work if Windows Script Host has been disabled system-wide. Here is how to enable it:
  1. Start Registry Editor (Start => Run… => regedit).
  2. In the Registry Editor open HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings. Note that it is HKEY_LOCAL_MACHINE this time.
  3. Make sure you actually are “inside” the Settings “folder”.
  4. Right-click anywhere in the right pane of the Registry Editor and select New => DWORD Value and call it “Enabled”. Then, double-click it and set the “Value data” field to “1”.
  5. Check if WSH is now enabled by running wscript.exe in the DOS box (see above).
  6. In the Registry Editor open HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
  7. If WSH is enabled, try installing PostgreSQL. If not, see below how to enable WSH system-wide.
  8. Once the installation is complete, you can disable WSH by setting the “Enabled” value to “0”.

http://www.xsatriya.com/2016/postgresql-installation-problem-on-windows-without-wsh/
http://1stopit.blogspot.co.id/2011/01/postgresql-83-and-84-fails-to-install.html