TransWikia.com

Error: Unable to write inside TEMP environment variable path

Database Administrators Asked by crthompson on December 4, 2021

I am installing PostgreSQL 9.2.4-1-windows.exe on Windows 7 64 with Service Pack 1.

I get the following, rather famous it seems, error:

There has been an error.

Unable to write inside TEMP environment variable path.

This occurs immediately upon launching. I see the postgresql splash, then this error occurs.

Everything I have found on the interwebs so far, i have tried. It includes:

  1. Disabled all anti-virus software. I have also stopped everything in the startup.
  2. Checked file associations for .VBS scripts. Nothing irregular (Windows Script Host registered)
  3. Windows Script Host is Enabled.
  4. I’ve tried installing as Administrator and other users that have admin rights.
  5. I have created the key HKLMSOFTWAREPostgreSQLInstallations manually and give it full rights.
  6. I have given Everyone full access to C:Users[username]AppDataLocalTemp and c:temp

Basically everything in the top 10 google hits.

I am working with the 32 bit version, but the 64 bit version install fails with the same error. I’m able to install successfully on other machines with similar config.

What else can I try?

Install log file:

Log started 09/20/2013 at 11:55:16
Preferred installation mode : qt
Trying to init installer in mode qt
Mode qt successfully initialized
Executing C:UserschadAppDataLocalTemp/postgresql_installer_67b274715d/temp_check_comspec.bat
Script exit code: 0

Script output:
“test ok”

Script stderr:

Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Data Directory. Setting variable iDataDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Base Directory. Setting variable iBaseDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Service ID. Setting variable iServiceName to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Service Account. Setting variable iServiceAccount to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Super User. Setting variable iSuperuser to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Version. Setting variable brandingVer to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 Shortcuts. Setting variable iShortcut to empty value
Could not find registry key HKEY_LOCAL_MACHINESOFTWAREPostgreSQLInstallationspostgresql-9.2 DisableStackBuilder. Setting variable iDisableStackBuilder to empty value
[11:55:21] Existing base directory:
[11:55:21] Existing data directory:
[11:55:21] Using branding: PostgreSQL 9.2 (x86)
[11:55:21] Using Super User: postgres and Service Account: NT AUTHORITYNetworkService
[11:55:21] Using Service Name: postgresql-9.2
Executing cscript //NoLogo “C:UserschadAppDataLocalTemppostgresql_installer_67b274715dprerun_checks.vbs”
Script exit code: 1

Script output:
Input Error: There is no script engine for file extension “.vbs”.

Script stderr:
Program ended with an error exit code

Error running cscript //NoLogo “C:UserschadAppDataLocalTemppostgresql_installer_67b274715dprerun_checks.vbs” : Program ended with an error exit code

3 Answers

Solve by the following steps

  1. Check that the problem is related to Windows Script Host

  2. From cmd run wscript.exe

  3. If you get an error Windows Script Host is not enabled and you can solved it by running from cmd

Fix for Current User

REG DELETE "HKCUSOFTWAREMicrosoftWindows Script HostSettings" /v Enabled /f

Fix for Local Machine

REG DELETE "HKLMSOFTWAREMicrosoftWindows Script HostSettings" /v Enabled /f

Now you can install psql

Answered by Azeez Bello on December 4, 2021

Go to:

Regedit =>
  HKEY_CURRENT_USER =>
    Software =>
      Microsoft =>
       Windows Script Host =>
         Settings =>
          Enabled 
  1. Double Click in Enabled.
  2. Change Value Data from 0 to 1
  3. Click Ok

enter image description here

Answered by hailush on December 4, 2021

I was having this issue on Windows 7 64-bit and the following solution is what worked for me (via http://igordcard.blogspot.com/2012/03/unable-to-write-inside-temp-environment.html):

Why
To understand why this error was happening, I went to my TEMP folder and read the log from the PostgreSQL installer: C:UsersmyuserAppDataLocalTempbitrock_installer.log

Which mentioned an interesting detail:
Input Error: There is no script engine for file extension ".vbs".

So, I picked up another file from the TEMP folder, the actual script used by the installer:
C:UsersmyuserAppDataLocalTempprerun_checks.vbs

And tried to run it through the console using cscript:
Input Error: There is no script engine for file extension ".vbs".

I researched a bit more and discovered that the type of file associated with the vbs extension had been changed. In my case, by Notepad++. After I installed Notepad++, I associated some file extensions with it (including vbs), thus causing problems when detecting the type of the script (which shouldn't happen).

Solution
Run regedit, navigate to HKEY_CLASSES_ROOT.vbs and change the (Default) key back to the string VBSFile. In my case it had been previously altered to Notepad++_file.

Answered by bspkrs on December 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP