无法安装 PostgreSQL:在 Windows XP 上执行 Microsoft VC++ 运行时安装程序时发生错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4288303/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 22:44:20  来源:igfitidea点击:

Can't install PostgreSQL: An error occurred executing the Microsoft VC++ runtime installer on Windows XP

postgresqlwindows-xp

提问by vmg

I downloaded installer postgresql-9.0.1-1-windows.exe from the official site, ran it, and then got an error:

我从官方网站下载了安装程序 postgresql-9.0.1-1-windows.exe ,运行它,然后出现错误:

An error occurred executing the Microsoft VC++ runtime installer

执行 Microsoft VC++ 运行时安装程序时发生错误

What is the reason for this error message?

此错误消息的原因是什么?

Platform: Windows XP SP3, Dell Inspiron 1501. Processor: AMD Sempron 3500+

平台:Windows XP SP3、Dell Inspiron 1501。处理器:AMD Sempron 3500+

回答by Milen A. Radev

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.

发生这种情况的原因之一是安装程序尝试安装比您当前使用的版本旧的 VC++ 运行时版本。

See this installation log, found in your user's temporary directory (e.g. dd_vcredist_amd64_20190214193107.log):

请参阅此安装日志,该日志位于您用户的临时目录(例如dd_vcredist_amd64_20190214193107.log)中:

[20C0:20E4][2019-02-14T19:31:07]e000: Error 0x80070666: Cannot install a product when a newer version is installed.

[20C0:20E4][2019-02-14T19:31:07]e000:错误 0x80070666:安装较新版本时无法安装产品。

A workaroundis to prevent the runtimes from installing with the --install_runtimesoption:

一种解决方法是阻止运行时使用以下--install_runtimes选项进行安装:

postgresql-9.6.12-1-windows-x64.exe --install_runtimes 0

回答by atik sarker

  1. Create a shortcut of the downloaded file:

    Enter image description here

  2. Right click of the shortcut → PropertiesShortcut. Add --install_runtimes 0to the end of the file path:

    Enter image description here

  1. 创建下载文件的快捷方式:

    在此处输入图片说明

  2. 右键单击快捷方式 →属性快捷方式。将--install_runtimes 0添加到文件路径的末尾:

    在此处输入图片说明

回答by user2889858

  • Create a shortcut of your EXE file;
  • right click on the shortcut → add --install_runtimes 0at the end of the target path, e.g.:

    postgresql-9.3.1-1-windows-x64.exe --install_runtimes 0
    
  • save and run it :)

  • 创建 EXE 文件的快捷方式;
  • 右键单击快捷方式→--install_runtimes 0在目标路径的末尾添加,例如:

    postgresql-9.3.1-1-windows-x64.exe --install_runtimes 0
    
  • 保存并运行它:)

回答by Bryan Downing

I was having a similar issue and found a fix that worked for me from Garrett_H in this forum post:

我遇到了类似的问题,并在此论坛帖子中从 Garrett_H 找到了对我有用的修复程序:

http://forums.enterprisedb.com/posts/list/1747.page#6180

http://forums.enterprisedb.com/posts/list/1747.page#6180

Go to file %windir%\inf\wsh.inf, right click and select 'Install'

re-run postgresql installer

转到文件 %windir%\inf\wsh.inf,右键单击并选择“安装”

重新运行 postgresql 安装程序

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 XP Pro,并且我正在尝试安装postgresql-8.3.17-1-windows.exe. 我最初收到以下错误:

An error occurred executing the Microsoft C++ runtime installer.

执行 Microsoft C++ 运行时安装程序时发生错误。

回答by aust_anik

In my case, when I was installing postgresql-11.0-1-windows-x64.exeon Windows 10, I had faced the same problem.

就我而言,当我postgresql-11.0-1-windows-x64.exe在 Windows 10 上安装时,我遇到了同样的问题。

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.exeagain, and it worked for me.

我刚刚卸载了 Microsoft Visual C++ Redistributable(适用于 32 位和 64 位的最新版本),然后postgresql-11.0-1-windows-x64.exe再次尝试安装,它对我有用。

回答by Mohan Tenneti

I too faced the same issue. I fixed it in the following way:

我也面临同样的问题。我通过以下方式修复它:

  1. I visited the below site: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
  2. Choose the Download button under PostgreSQL Version 11.1 for Windows x86-64.
  1. 我访问了以下网站:https: //www.enterprisedb.com/downloads/postgres-postgresql-downloads
  2. 选择适用于 Windows x86-64 的 PostgreSQL 版本 11.1 下的下载按钮。

In one word, just try to install the latest version.

一句话,只要尝试安装最新版本。

回答by Jaime de los Hoyos M.

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:

请特别注意 Windows 用户的文件夹名称不包含空格。PostgreSQL(从 9.2.2.1 版本开始)处理的很差。如果我在 Windows XP 上使用此帐户,安装将失败并显示“执行 Microsoft C++ 运行时安装程序时发生错误”消息:

"C:\Documents and settings\Jimmy (admin)"

But it runs just fine with this:

但它运行得很好:

"C:\Documents and settings\Jimmy-admin"

The spaces in "Documents and settings" don't seem to bother the installer. Go figure.

“文档和设置”中的空格似乎不会打扰安装程序。去搞清楚。

回答by Michal MANYAK Oravec

Go to file %windir%\inf\wsh.inf, right click, and select 'Install'.

转到文件%windir%\inf\wsh.inf,右键单击,然后选择“安装”。

Then re-run the PostgreSQL installer.

然后重新运行 PostgreSQL 安装程序。

This works on Windows XP with PostgreSQL 8.4.17-1.

这适用于带有 PostgreSQL 8.4.17-1 的 Windows XP。

回答by Thakhani Tharage

First download and install Microsoft Visual C++ from the Microsoft website. Then run the installation from command with --install_runtimes 0.

首先从 Microsoft 网站下载并安装 Microsoft Visual C++。然后从命令运行安装--install_runtimes 0

回答by basarat

Try installing as administrator (using Run as administrator).

尝试以管理员身份安装(使用以管理员身份运行)。

In version 9.0. PostgreSQL can be installed as a Windows administrator :)

在 9.0 版中。PostgreSQL 可以作为 Windows 管理员安装 :)