将应用程序的 64 位和 32 位版本滚动到同一个二进制文件中?

发布于 2024-07-18 09:13:05 字数 257 浏览 3 评论 0原文

我们有一个应用程序尝试在 64 位和 32 位平台上部署。 有没有办法将代码的两个编译版本放在同一个二进制文件中,就像 Apple 和 NeXT 的 fat 二进制文件< /a>?

理想情况下,我们可以发布一个 .exe,该 .exe 在执行时决定执行哪个版本的代码。 我们的目标是 Windows XP 及更高版本。

We have an application we're trying to deploy on both 64 bit and 32 bit platforms. Is there a way to put both compiled versions of the code in the same binary, a la Apple and NeXT's fat binaries?

Ideally we could ship one .exe that decides upon execution which version of the code to execute. We're targeting Windows XP and later.

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

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

发布评论

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

评论(3

温柔一刀 2024-07-25 09:13:05

Process Explorer(以前是 sysinternals,现在归 Microsoft 所有)可以执行此操作。 它是一个 32 位应用程序,可检测 64 位环境、写出另一个二进制文件并在退出时将其删除。 http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Process Explorer (was sysinternals, now owned by Microsoft) does this. It is a 32-bit application that detects a 64-bit environment, writes out another binary and deletes it on exit. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

篱下浅笙歌 2024-07-25 09:13:05

一种方法可能是提供一个引导应用程序来确定体系结构并选择要运行的适当的可执行文件。 因此,基本上,应用程序的快捷方式或其他内容只需启动引导程序,然后引导程序启动相应的应用程序。 如果您的应用程序是 Windows 服务,这可能会有点棘手。

One approach is perhaps to supply a bootstrapping application that determines the architecture and chooses the appropriate executable to run. So basically the shortcut or what have you to your application simply starts the bootstrapper which in turn starts the appropriate application. This can be a little more tricky if your application is a Windows service.

故人如初 2024-07-25 09:13:05

最简单的方法是由安装程序来处理这个问题 - 每个二进制文件都有两个版本,并根据目标计算机上的系统位数复制必要的版本。

The simplest approach would be to handle this by the installer - it would have two versions of each binary and copy necessary versions depending on which system bit-ness is at the target machine.

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