是否可以在Vista上构建exe并使用py2exe在XP上进行部署 [英] Is it possible to build exe on Vista and deploy on XP using py2exe

查看:87
本文介绍了是否可以在Vista上构建exe并使用py2exe在XP上进行部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows Vista上使用python创建了一些程序.但我想将其部署在Windows XP上.是否有必要在Windows XP上进行新的构建?还是有可能使构建在这两个系统上都可以使用?

I have created some program using python on Windows Vista. But I want to deploy it on Windows XP. Is it necessary to make new build on windows XP? Or there is possibility to make build that will work on both of these systems?

编辑(编辑2-非常简单的程序也无法使用): 我的设置:

from distutils.core import setup
import py2exe

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

我使用依赖性资源管理器检查了依赖性:

Using dependency explorer i checked that dependencies are:

msvcr90.dll
kernel32.dll
  +ntdll.dll

几乎已解决:

我发现要安装:

I figured out that installing: http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en does the thing. But i tried to provide msvrc90.dll manually before and it did not work, is there any way to redistribute it automatically? Or I must provide this install file to him.

最后和主要问题

现在我对msvcrt.dll有问题.在Windows XP上出现的消息:

Now i have problem with msvcrt.dll. Message that occured on windows xp:

过程入口点wcsscpy_s 不能位于动态 链接库msvcrt.dll

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

在Vista上,我的版本是7.0.6001.18000

On vista i have version 7.0.6001.18000

但在XP 7.0.2600.5512上

But on XP 7.0.2600.5512

有没有办法解决这个问题?

Is there a way to fix this?

似乎我没有排除几个dll的...愚蠢的错误:

Seems that i did not exclude few dll's... silly mistake:

$ 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创建的可执行文件旁边,创建一个名为"Microsoft.VC90.CRT.manifest"的文件,其中包含以下内容和msvcm90.dll文件:

Create a file named "Microsoft.VC90.CRT.manifest" with the following content next to the executable created by py2exe and the msvcr90.dll, msvcp90.dll, and msvcm90.dll files:

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

这篇关于是否可以在Vista上构建exe并使用py2exe在XP上进行部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆