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

时间:2011-01-08 18:13:57

标签: 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上发生的消息:

  

程序入口点wcsscpy_s   无法定位在动态中   链接库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

现在有效!

2 个答案:

答案 0 :(得分:3)

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

<?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>

答案 1 :(得分:2)

如果你的Vista系统上有32位python并使用py2exe来创建一个exe,它也应该在XP上运行。

你遇到任何问题吗?如果是的话,他们是什么?

相关问题