无法安装 PostgreSQL:执行 Microsoft VC 时出错; Windows XP 上的运行时安装程序
我从官方网站下载了安装程序 postgresql-9.0.1-1-windows.exe,运行它,然后出现错误:
执行 Microsoft VC++ 运行时安装程序时发生错误
此错误消息的原因是什么?
平台:Windows XP SP3、Dell Inspiron 1501。处理器:AMD Sempron 3500+
I downloaded installer postgresql-9.0.1-1-windows.exe from the official site, ran it, and then got an error:
An error occurred executing the Microsoft VC++ runtime installer
What is the reason for this error message?
Platform: Windows XP SP3, Dell Inspiron 1501. Processor: AMD Sempron 3500+
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(14)
发生这种情况的原因之一是安装程序尝试安装比您当前使用的版本更旧的 VC++ 运行时版本。
查看此安装日志,可在用户的临时目录中找到(例如
dd_vcredist_amd64_20190214193107.log
):解决方法是防止运行时与
--install_runtimes
选项:One of the reasons this can happen is because the installer attempts to install an older version of the VC++ runtime than what you are currently using.
See this installation log, found in your user's temporary directory (e.g.
dd_vcredist_amd64_20190214193107.log
):A workaround is to prevent the runtimes from installing with the
--install_runtimes
option:创建下载文件的快捷方式:
右键单击快捷方式 → 属性 → 快捷方式。将 --install_runtimes 0 添加到文件路径末尾:
Create a shortcut of the downloaded file:
Right click of the shortcut → Properties → Shortcut. Add --install_runtimes 0 to the end of the file path:
右键单击快捷方式→在目标路径末尾添加
--install_runtimes 0
,例如:保存并运行:)
right click on the shortcut → add
--install_runtimes 0
at the end of the target path, e.g.:save and run it :)
首先从 Microsoft 网站下载并安装 Microsoft Visual C++。然后使用
--install_runtimes 0
从命令运行安装。First download and install Microsoft Visual C++ from the Microsoft website. Then run the installation from command with
--install_runtimes 0
.我遇到了类似的问题,并在 Garrett_H 的论坛帖子中找到了对我有用的修复:
http://forums.enterprisedb.com/posts/list/1747.page#6180
我正在运行 Windows XP Pro,并且我正在尝试安装 postgresql-8.3.17-1- windows.exe。我最初收到以下错误:
I was having a similar issue and found a fix that worked for me from Garrett_H in this forum post:
http://forums.enterprisedb.com/posts/list/1747.page#6180
I'm running Windows XP Pro, and I was trying to install
postgresql-8.3.17-1-windows.exe
. I originally received the following error:就我而言,当我在 Windows 10 上安装 postgresql-11.0-1-windows-x64.exe 时,我遇到了同样的问题。
我刚刚卸载了 Microsoft Visual C++ Redistributable(32 位和 64 位的最新版本),然后尝试再次安装
postgresql-11.0-1-windows-x64.exe
,它对我有用。In my case, when I was installing
postgresql-11.0-1-windows-x64.exe
on Windows 10, I had faced the same problem.I just uninstalled the Microsoft Visual C++ Redistributable (the latest one for both 32 and 64 bit) and then tried to install
postgresql-11.0-1-windows-x64.exe
again, and it worked for me.我也面临同样的问题。我通过以下方式修复了它:
https://www.enterpriseb.com/downloads/postgres-postgresql-downloads
一句话,尽量安装最新版本。
I too faced the same issue. I fixed it in the following way:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
In one word, just try to install the latest version.
尝试以管理员身份安装(使用以管理员身份运行)。
在9.0版本中。 PostgreSQL 可以作为 Windows 管理员安装:)
Try installing as administrator (using Run as administrator).
In version 9.0. PostgreSQL can be installed as a Windows administrator :)
检查是否启用了 Windows 脚本宿主 (WSH)。如果未启用,详细信息如下:没有 WSH 的 Windows 上的 PostgreSQL 安装问题
Check if Windows Script Host (WSH) is enabled. If not enabled, details are here: PostgreSQL Installation Problem on Windows without WSH
请特别注意 Windows 用户的文件夹名称不包含空格。 PostgreSQL(从版本 9.2.2.1 开始)对此的处理很差。如果我在 Windows XP 上使用此帐户,安装会失败,并显示“执行 Microsoft C++ 运行时安装程序时发生错误”消息:
但它运行得很好:
“文档和设置”中的空格似乎不会打扰安装程序。去算算吧。
Take special care that your Windows user's folder name does not contain spaces. PostgreSQL (as of version 9.2.2.1) handles that poorly. If I use this account on Windows XP, installation fails with the "An error occurred executing the Microsoft C++ runtime installer" message:
But it runs just fine with this:
The spaces in "Documents and settings" don't seem to bother the installer. Go figure.
转到文件
%windir%\inf\wsh.inf
,右键单击,然后选择“安装”。然后重新运行 PostgreSQL 安装程序。
这适用于带有 PostgreSQL 8.4.17-1 的 Windows XP。
Go to file
%windir%\inf\wsh.inf
, right click, and select 'Install'.Then re-run the PostgreSQL installer.
This works on Windows XP with PostgreSQL 8.4.17-1.
Windows 脚本宿主 (WSH) 无法执行 VBScript 脚本。如果脚本主机被禁用(这是不寻常的),或者安装被破坏,则可能会发生这种情况。此问题的迹象是类似的消息
通常可以通过重新注册 VBScript 解释器来解决,单击开始 * → * 运行 并输入遵循以下内容并单击确定:
Windows Script Host (WSH) is unable to execute VBScript scripts. This can occur if the scripting host is disabled (which is unusual), or if the installation is broken. A sign of this problem is a message like
It can often be resolved by re-registering the VBScript interpreter, click Start * → * Run and enter the following and click OK:
我在尝试安装 PostgreSQL 11.1 版时遇到了同样的问题。我必须卸载 Microsoft VC++ 并再次运行安装程序。它下载了所需的VC++并且安装成功。
I had the same problem while trying to install PostgreSQL version 11.1. I had to uninstall the Microsoft VC++ and run the installer again. It downloaded the required VC++ and the installation went successful.
我遇到了这些相同的问题,并尝试
仍然不成功
然后我通过手动安装 postgres 解决了这些问题:
pg_ctl register -DD:\pgdata -N postgresql -U postgres -P
I had these same problems and tried
Still unsuccessful
Then I solved these problem by installing postgres manually:
pg_ctl register -D D:\pgdata -N postgresql -U postgres -P <your postgres password>