为 32 位和 64 位应用程序启动正确的安装程序 [英] launching correct installer for 32 and 64-bit apps

查看:23
本文介绍了为 32 位和 64 位应用程序启动正确的安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,出于各种原因,需要将其编译为 32 位和 64 位应用程序.问题是,我们想在一张 CD 上分发两个安装文件 (msi).是否有启动条件或 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?

推荐答案

autorun.inf 文件.

大多数提供 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.

  1. 创建一个 32 位 setup.exe 应用程序(以便它可以在任一平台上运行).理想情况下,这将使用 C/C++ 编写,以便尽可能小和快速,并且不依赖于其他库/框架(例如静态链接).
  2. 检测您是否在 64 位上运行(请参阅 Windows API 的示例代码 IsWow64Process 函数
  3. 执行适当的 MSI

这篇关于为 32 位和 64 位应用程序启动正确的安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆