为32和64位应用程序启动正确的安装程序 [英] launching correct installer for 32 and 64-bit apps
问题描述
我们有一个应用程序,由于各种原因,该应用程序需要同时编译为32位和64位应用程序。问题是,我们要将两个安装文件(msi)都分发到一张CD中。是否存在启动条件或autorun.inf条目,我们可以用来了解要启动哪个setup.exe?还是我们需要编写一个单独的小exe文件,该文件会被autorun调用,并确定操作系统并调用相应的setup.exe?
We have an application which, for various reasons, needs to be compiled as both a 32-bit and 64-bit app. The thing is, we want to distribute both setup files (msi) on a single CD. Is there a launch condition or autorun.inf entry that we can use to know which setup.exe to launch? Or do we need to write a separate little exe that gets called by autorun, and which determines the OS, and calls the appropriate setup.exe?
推荐答案
大多数提供32位和64位MSI的应用程序都遵循的约定类似于您提到的第二个选项。
The convention that most applications which supply a 32 and 64 bit MSI follow is similar to the second option you mention.
- 创建一个32位setup.exe应用程序(以便它可以在任一平台上运行)。理想情况下,这将使用C / C ++编写,以使其尽可能小巧,快速,并且不依赖于其他库/框架(例如静态链接)。
- 检测是否在64位上运行(请参阅Windows API示例代码 IsWow64Process 函数
- 执行适当的MSI
- Create a single 32bit setup.exe application (so that it will run on either platform). Ideally this will be written in C/C++ so that it is as small and quick as possible, and has no dependencies on other libraries/frameworks (eg. static linked).
- Detect if you are running on 64bit or not (see sample code for Windows API IsWow64Process function
- Execute the appropriate MSI
这篇关于为32和64位应用程序启动正确的安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!