python - 是否可以在 Vista 上构建 exe 并使用 py2exe 在 XP 上部署

标签 python windows-vista exe py2exe

我在 Windows Vista 上使用 python 创建了一些程序。但是我想在 Windows XP 上部署它。是否有必要在 windows XP 上重新构建?或者有可能构建适用于这两个系统的构建?

编辑(编辑 2 - 非常简单的程序也不起作用): 我的设置:

from distutils.core import setup
import py2exe

setup(console=['orderer.py'])

使用依赖项浏览器我检查了依赖项是:

msvcr90.dll
kernel32.dll
  +ntdll.dll

几乎解决了:

我发现安装:http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en做事。但是我之前尝试过手动提供msvrc90.dll,但是没有用,有什么办法可以自动重新分发吗?或者我必须向他提供此安装文件。

最后也是主要问题

现在我遇到了 msvcrt.dll 的问题。在 windows xp 上出现的消息:

The procedure entry point wcsscpy_s could not be located in the dynamic link library msvcrt.dll

我在 vista 上的版本是 7.0.6001.18000

但是在 XP 7.0.2600.5512 上

有办法解决这个问题吗?

似乎我没有排除一些 dll 的...愚蠢的错误:

$ grep -lir msvcrt.dll .
./buildout
./buildtest.py
./dist/ACTIVEDS.dll
./dist/adsldpc.dll
./dist/ATL.DLL
./dist/credui.dll
./dist/DSOUND.dll
./dist/MAPI32.dll
./dist/PROPSYS.dll
./dist/WLDAP32.dll

现在可以了!

最佳答案

在 py2exe 和 msvcr90.dll、msvcp90.dll 和 msvcm90.dll 文件创建的可执行文件旁边创建一个名为“Microsoft.VC90.CRT.manifest”的文件,其中包含以下内容:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInheritable/>
    <assemblyIdentity
        type="win32"
        name="Microsoft.VC90.CRT"
        version="9.0.21022.8"
        processorArchitecture="x86"
        publicKeyToken="1fc8b3b9a1e18e3b"
    />
    <file name="msvcr90.dll" />
    <file name="msvcp90.dll" />
    <file name="msvcm90.dll" />
</assembly>

关于python - 是否可以在 Vista 上构建 exe 并使用 py2exe 在 XP 上部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4635356/

相关文章:

python - 如何使用 selenium python webdriver 计算来自 Web 应用程序的表中的行数

vb6 - 如何将 VB6 应用程序从 XP 更新到 Vista?

c# - 我怎样才能制作一个可以在没有其他安装的Windows上运行的exe

c# - 在 Windows Vista 上使用 C# .Net 获取我连接的无线网络的 SSID

c++ - 如何构建程序,以便在 EXE ( CodeBlocks ) 位置不需要 DLL

.net - 附加到 .NET 程序集的 Windows EXE 应用程序 list 是否应具有正确的应用程序名称和版本集?

python - 在 Mac 上安装适用于 IntelliJ IDEA/PyCharm 的 Python 3.5

python - python min 函数是如何工作的

c++ - 为什么 python 的 dict 实现为哈希表,而 std::map 是基于树的?

java - 可执行 Jars 运行非常缓慢