Is it possible to build exe on Vista and deploy on XP using py2exe

一曲冷凌霜 提交于 2019-12-09 16:39:24

问题


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?

EDIT (EDIT 2 - very simple program does not work also): My setup:

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

Almost solved:

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.

Last and the main problem

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

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

On vista i have version 7.0.6001.18000

But on XP 7.0.2600.5512

Is there a way to fix this?

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

now it works!


回答1:


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>



回答2:


if you have 32-bit python on your vista system and use py2exe to create an exe, it should run on XP also.

have you run into any problems? if so, what are they?



来源:https://stackoverflow.com/questions/4635356/is-it-possible-to-build-exe-on-vista-and-deploy-on-xp-using-py2exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!