滚64位和32位版本的应用程序的成相同的二进制?应用程序、版本

2023-09-08 00:55:07 作者:爱人不过是碍人

我们有我们正在尝试部署两个64位和32位平台的应用程序。有没有办法把的code这两种编译版本相同的二进制代码,一拉苹果和NeXT公司的脂肪二进制文件?

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?

在理想情况下,我们可以运送一个exe的决定在执行版本的code要执行的。我们正在针对Windows XP及更高版本。

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

推荐答案

一种方法也许是提供一个引导应用程序,确定架构,并选择适当的可执行文件运行。所以基本上快捷方式或你有什么你的应用程序只需启动从而启动相应的应用程​​序的引导程序。这可能是一个小更靠谱,如果你的应用程序是一个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.