launching correct installer for 32 and 64-bit apps

2019-04-12 00:37发布

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?

2条回答
一纸荒年 Trace。
2楼-- · 2019-04-12 01:17

There does not appear to be any 32/64bit detection support inherent in autorun.inf files.

The convention that most applications which supply a 32 and 64 bit MSI follow is similar to the second option you mention.

  1. 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).
  2. Detect if you are running on 64bit or not (see sample code for Windows API IsWow64Process function
  3. Execute the appropriate MSI
查看更多
Summer. ? 凉城
3楼-- · 2019-04-12 01:19

You can use a custom action to detect the OS, then call the right installer.

I've given an example here: Single MSI to install correct 32 or 64 bit c# application

查看更多
登录 后发表回答