Installer which chooses the MSI based on the CPU architecture (x86 32-bit, x64 64-bit, etc)
I have an installer (Visual Studio setup project) whic开发者_如何学JAVAh uses DIFxApp and an Orca transform to install drivers. The problem is that there are two DIFxApp merge modules - one for x86 and one for x64. If I reference both of them, the installation only works on 64-bit machines, whereas referencing only the x86 version allows me to install on 32-bit machines.
It seems as though the only solution is to create two MSIs (one for x86 and one for x64), each referencing the correct merge module. My question is how should I create an installer that chooses which MSI to install based off of the target machine's processor?
I've worked with NSIS a little bit, so it might be easiest to go that route. Other possibilities are Inno-Setup and dotNetInstaller.
Similar questions (but with inadequate answers):
- launching correct installer for 32 and 64-bit apps
If you decide to go with NSIS:
!include "x64.nsh"
${If} ${RunningX64}
MessageBox MB_OK "running on x64"
${Else}
MessageBox MB_OK "running on x86"
${EndIf}
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
How about making a small program (launcher) that detect the os type (64 0r 32 bit, should be easy). The little program then launch the correct installer depending on detection result. The program shouldn't has any window and has the same icon as the installer. Just give the customer all three files, installer.exe (the program), inst32.msi and inst64.msi. If that's too much for your customer then just compress them to a self extracting zip that launch the installer.exe automatically.
精彩评论