¿Es posible compilar exe en Vista e implementarlo en XP usando py2exe?

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): Mi configuración:

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

¿Hay alguna manera de arreglar esto?

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!

preguntado el 08 de enero de 11 a las 18:01

2 Respuestas

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>

Respondido el 13 de enero de 11 a las 01:01

After creating this file and adding these dll's I still get "The procedure entry point wcsscpy_s could not be located in the dynamic link library msvcrt.dll" - dfens

Your program should not depend on two C runtime libraries. Try to find where the dependency of msvcrt.dll comes from, e.g. using DependencyWalker (dependencywalker.com) on your *.pyd and *.dll files. - cgohlke

and winsta.dll but i dont provide any of them... still searching - dfens

Where does that file come from? Ctypes.pyd is usually shipped with Python and does only depend on msvcr90 (Python >=2.6) or msvcr71 (Python 2.5). - cgohlke

I think i solved it by removing all dll's using msvcrt.dll! thank you sir, I'll leave this subject for one day more and if everything will be ok I'm providing you a bounty. - dfens

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?

Respondido el 08 de enero de 11 a las 23:01

There is just message: The system cannot execute specified program. - dfens

can you update your question with more info? like the disutils script you are using to compile the exe. Most likely, you are missing some dll's on the target XP system that you should be including as well. - Corey Goldberg

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.