Windows下安装PostgreSQL 9.0.4:unable to write inside temp environment variable path

来源:互联网 发布:java中内存泄露的例子 编辑:程序博客网 时间:2024/04/29 01:27

Windows下安装最新版PostgreSQL ,启动安装程序的时候报错:

unable to write inside temp environment variable path


字面上的大概意思就是:无法写入temp文件夹。 可能有几个原因:

1.当前temp目录所在硬盘空间不足.(可以在环境变量内,查看当前Temp目录)

2.没有权限对temp目录操作

排除以上2个原因后,如果还是报错。那么可能是你的Windows Script Host 出错了,从而.vbs后缀的脚本文件无法正常运行


PostgreSQL安装的过程如下,首先是解压一个 prerun_checks.vbs 的文件到temp文件目录下,然后运行。

从文件名的命名上可以看出,它是执行安装之前,检查当前系统配置,和权限的一个脚本,其中的部分内容如下

' VBscript test script - check that the scripting host appears functional' Dave Page, EnterpriseDBSet WshShell = WScript.CreateObject("WScript.Shell")Set WshSysEnv = WshShell.Environment("PROCESS")strSystemRoot = WshSysEnv("TEMP")If strSystemRoot = "" Then   WScript.Echo "Unable to read the value of the TEMP environment variable."   WScript.Quit 1End If' Check if temp path is writableisWritable = IsPathWriteable(strSystemRoot)If isWritable = False Then   WScript.Echo "Unable to write inside TEMP environment variable path."   WScript.Quit 1End If

从这里可以看到是

isWritable = IsPathWriteable(strSystemRoot)If isWritable = False Then   WScript.Echo "Unable to write inside TEMP environment variable path."   WScript.Quit 1End If

执行出错了. 但是按照我们之前说的,我们既有权限,又有空余磁盘空间,为什么不能写呢?


还有一种原因,就是脚本运行不正常导致返回出错,可以从你的temp目录下将这个 prerun_checks.vbs拷贝出来,

右键选择打开方式(microsoft) Windows Based Script Host,看能否正常运行该脚本.如果输出是一个普通的提示

:The Scripting Host apears to be functional

说明你的脚本运行环境没问题,否则需要重新安装Windows Script Host 


重新安装Windows Script Host:

搜索关键字:Microsoft Windows Script,下载最新版安装之,重启…… 问题应该就能解决了


如果安装PostgreSQL期间出现其他错误,可以试试,取消当前安装,重新安装一下。


报错:

> Problem running post-install step. Installation may not complete correctly 
> Error reading file data/postgresql.conf


解决方法: 在安装,选择语言地区时,不要选择default-lcoal, 随便选择一个Chinese-Hong kong 之类的就可以了