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

发布于 2024-10-10 16:47:19 字数 1259 浏览 1 评论 0原文

我在 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

在 vi​​sta 上我有版本 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

现在它可以工作了!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

二货你真萌 2024-10-17 16:47:19

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

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>
堇年纸鸢 2024-10-17 16:47:19

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

你遇到什么问题了吗?如果有,它们是什么?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文