将应用程序的 64 位和 32 位版本滚动到同一个二进制文件中?
我们有一个应用程序尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
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
一种方法可能是提供一个引导应用程序来确定体系结构并选择要运行的适当的可执行文件。 因此,基本上,应用程序的快捷方式或其他内容只需启动引导程序,然后引导程序启动相应的应用程序。 如果您的应用程序是 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.
最简单的方法是由安装程序来处理这个问题 - 每个二进制文件都有两个版本,并根据目标计算机上的系统位数复制必要的版本。
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.