在 Windows 上安装 PostgreSQL 9:“无法在 TEMP 环境路径内写入。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5224042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PostgreSQL 9 install on Windows: "Unable to write inside TEMP environment path."
提问by Charles Roper
I am attempting to install PostgreSQL 9 (postgresql-9.0.3-1-windows.exe) on my WinXP machine and get the following error at the start:
我试图在我的 WinXP 机器上安装 PostgreSQL 9 (postgresql-9.0.3-1-windows.exe) 并在开始时收到以下错误:
Some googling around yielded some advice that suggested Windows Scripting Host might be disabled. I've checked and WSH is definitely enabled, so it must be something else. Question is, what?
一些谷歌搜索产生了一些建议,建议Windows Scripting Host 可能被禁用。我已经检查过并且肯定启用了 WSH,所以它一定是别的东西。问题是,什么?
I can see a file called prerun_checks.vbsis created in %TEMP% and when I try to run this manually, I get the following:
我可以看到在 %TEMP% 中创建了一个名为prerun_checks.vbs的文件,当我尝试手动运行它时,我得到以下信息:
Which looks like a permissions error. However, I am an Admin, and I've given myself full control of the temp folder and it's still not working.
看起来像是权限错误。但是,我是管理员,我已经完全控制了临时文件夹,但它仍然无法正常工作。
Any help appreciated.
任何帮助表示赞赏。
采纳答案by Charles Roper
As I was finishing off my question above, our IT chap turned up and knew what the problem was immediately: it's McAfee. It prevents anythingfrom running in a TEMP folder, including Windows Scripting Host scripts. Disabling McAfee for the duration of the installation fixed the problem for me.
当我完成上述问题时,我们的 IT 人员出现了,并立即知道问题出在哪里:是 McAfee。它可以防止在 TEMP 文件夹中运行任何内容,包括 Windows Scripting Host 脚本。在安装期间禁用 McAfee 为我解决了这个问题。
So if you see this problem, try disabling your anti-virus.
因此,如果您看到此问题,请尝试禁用防病毒软件。
回答by Zach-M
In my case the solution was related to NotePad++
being the default application for opening .vbs
files. If you have the same situation, here's an elaborate solution:
在我的情况下,解决方案与NotePad++
作为打开.vbs
文件的默认应用程序有关。如果你有同样的情况,这里有一个精心设计的解决方案:
http://igordcard.blogspot.co.il/2012/03/unable-to-write-inside-temp-environment.html
http://igordcard.blogspot.co.il/2012/03/unable-to-write-inside-temp-environment.html
In a nutshell, in the registry, you need to go to HKEY_CLASSES_ROOT\.vbs
, and set the (Default)
entry back to the string VBSFile
.
简而言之,在注册表中,您需要转到HKEY_CLASSES_ROOT\.vbs
,并将(Default)
条目设置回字符串VBSFile
。
回答by steven.yang
The answer in the following page helpped me. http://forums.enterprisedb.com/posts/list/3040.page
以下页面中的答案帮助了我。 http://forums.enterprisedb.com/posts/list/3040.page
- run-> regedit and take backup of registry using export
- HKEY_LOCAL_MACHINE->SOFTWARE->Classes->CLSID->B54F3741-5B07-11cf-A4B0-00AA004A55E8} -> InprocServer32
- Modify registry entry with new value as C:\Windows\System32\vbscript.dll
- 运行-> regedit 并使用导出备份注册表
- HKEY_LOCAL_MACHINE->SOFTWARE->Classes->CLSID->B54F3741-5B07-11cf-A4B0-00AA004A55E8} -> InprocServer32
- 使用新值修改注册表项为 C:\Windows\System32\vbscript.dll
In fact, I found there are 3 entries of HKEY_LOCAL_MACHINE->SOFTWARE->Classes->CLSID->B54F3741-5B07-11cf-A4B0-00AA004A55E8}, and set the first one as above, it works.
事实上,我发现HKEY_LOCAL_MACHINE->SOFTWARE->Classes->CLSID->B54F3741-5B07-11cf-A4B0-00AA004A55E8}有3个条目,并将第一个设置为如上,它可以工作。
回答by Craig Ringer
If anyone else is searching for information on this and doesn't have any luck here, you might want to look at:
如果其他人正在搜索这方面的信息并且在这里没有任何运气,您可能需要查看:
http://wiki.postgresql.org/wiki/Troubleshooting_Installation
http://wiki.postgresql.org/wiki/Troubleshooting_Installation
For follow-ups to the mailing list please read:
如需跟进邮件列表,请阅读:
回答by Philip
This is a an old thread, but I just had the same problem on windows 10:
这是一个旧线程,但我在 Windows 10 上遇到了同样的问题:
Unable to write inside TEMP environment path
无法在 TEMP 环境路径中写入
Solve by the following steps
按以下步骤解决
- Check that the problem is related to Windows Script Host.
- From cmdrun
wscript.exe
- If you get an error Windows Script Host is not enabled and you can solved it by running from cmd
- 检查问题是否与 Windows 脚本宿主有关。
- 从cmd运行
wscript.exe
- 如果您收到错误 Windows Script Host is not enabled,您可以通过从cmd运行来解决它
Fix for Current User
修复当前用户
REG DELETE "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled /f
Fix for Local Machine
修复本地机器
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled /f
No you can install psql
不,你可以安装 psql
回答by adinutzyc21
Well, in my case nothing worked, and disabling McAffee needed a special ticket with my company's security team to actually do... so I installed using the binaries, by following this guide Helpful Guide.
好吧,就我而言,没有任何效果,并且禁用 McAffee 需要我公司的安全团队提供一张特殊的票才能实际执行...所以我按照本指南Helpful Guide使用二进制文件进行安装。
In summary, download the binary from here, unzip it, go inside the pgsql
folder, create log
and data
directories in there, and then open a command prompt, navigate to where the pgsql\bin
folder is, and run initdb -U postgres -A password -E utf8 -W -D POSTGRESQL_ROOT\data
总之,从这里下载二进制文件,解压缩,进入pgsql
文件夹,在那里创建log
和data
目录,然后打开命令提示符,导航到pgsql\bin
文件夹所在的位置,然后运行initdb -U postgres -A password -E utf8 -W -D POSTGRESQL_ROOT\data
You can start and stop the server by running
您可以通过运行来启动和停止服务器
"POSTGRESQL_ROOT/bin/pg_ctl" -D "POSTGRESQL_ROOT/data" -l "POSTGRESQL_ROOT/log/pgsql.log" start
and
和
"POSTGRESQL_ROOT/bin/pg_ctl" -D "POSTGRESQL_ROOT/data" -l "POSTGRESQL_ROOT/log/pgsql.log" stop
where POSTGRESQL_ROOT is the full path to the pgsql
folder.
其中 POSTGRESQL_ROOT 是pgsql
文件夹的完整路径。
回答by adongo
All the above did not work for me. I was getting an error like:
以上所有对我都不起作用。我收到如下错误:
Script output: CScript Error: Windows Script Host access is disabled on this machine. Contact your administrator for details.
脚本输出:CScript 错误:Windows Script Host 访问在这台机器上被禁用。有关详细信息,请联系您的管理员。
so after a couple of googling i found the solution: Navigate to the following key:
所以经过几次谷歌搜索后,我找到了解决方案:导航到以下键:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings
In the right panel, you will see Enabled. If you see the entry 0, it means that the Windows Script Host access is disabled on your Windows machine.
在右侧面板中,您将看到已启用。如果您看到条目 0,则表示在您的 Windows 计算机上禁用了 Windows 脚本主机访问。
Double Click on it and give it Value Data 1 to enable it.
双击它并给它值数据 1 以启用它。
A value of 1 will enable Windows Script Host A value of 0 will disable Windows Script Host.
值为 1 将启用 Windows 脚本宿主。值为 0 将禁用 Windows 脚本宿主。
for windows 10 navigate to
对于 Windows 10 导航到
HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
回答by YOGESH C UGALE
In my case Changing the (Default) key in the HKEY_CLASSES_ROOT, .vbs section of the registry to VBSFile solved it. BlueFish is grab .vbs file association.
在我的情况下,将注册表的 HKEY_CLASSES_ROOT, .vbs 部分中的(默认)键更改为 VBSFile 解决了它。BlueFish 是抓取 .vbs 文件关联。
回答by Saidoune
I had the same problem with installing PostgreSQL (Unable to write in TEMP environment variable path), the problem was in Windows Script Host which was disabled (check the log file to see if this is your problem). enable it with register editor (run-->regedit) at this location Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
by setting its value at 1
我在安装 PostgreSQL 时遇到了同样的问题(无法在 TEMP 环境变量路径中写入),问题出在禁用的 Windows 脚本主机中(检查日志文件以查看这是否是您的问题)。Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
通过将其值设置为 1,在此位置使用寄存器编辑器 (run-->regedit) 启用它
For more details check this web link: http://1stopit.blogspot.com/2011/01/postgresql-83-and-84-fails-to-install.html
有关更多详细信息,请查看此 Web 链接:http: //1stopit.blogspot.com/2011/01/postgresql-83-and-84-fails-to-install.html
回答by Nav
In my case it was another application that caused the problem. Not Notepad++. To others who encounter this problem, you can diagnose it by first deleting all files in C:\Documents and Settings\UserName\Local Settings\Temp
so that you'll be able to find the bitrock_installer.log
easily when you try installing postgresql again and view the instructions in it. Changing the (Default) key in the HKEY_CLASSES_ROOT
, .vbs
section of the registry to VBSFile solved it.
就我而言,是另一个导致问题的应用程序。不是记事本++。对于遇到此问题的其他人,您可以通过首先删除其中的所有文件来诊断它,C:\Documents and Settings\UserName\Local Settings\Temp
以便您bitrock_installer.log
在尝试再次安装postgresql并查看其中的说明时能够轻松找到它。将注册表的HKEY_CLASSES_ROOT
,.vbs
部分中的(默认)键更改为 VBSFile 解决了它。