views:

299

answers:

2

Hi,
I need to pack two msi files in one setup.exe file (via bootstrapper) and run only one of them depending on condition (machine is x64 or x86).
Is there a way to do that?

+1  A: 

You could pack the two msi files using iexpress.exe (a standard Window's tool) and also add a custom batch file which you set as the start command of your iexpress package. The batch script would determine the architecture and start the corresponding msi file:

if %PROCESSOR_ARCHITECTURE% EQU x86 (
  echo "x86"
  call setup-x86.msi
) ELSE (
   echo "x64"
   call setup-x64.msi
)

Place that code in a batch file named installmsi.bat. Then later in the IExpress wizard enter the following installation command:

cmd.exe /C installmsi.bat

It is necessary to call cmd.exe explicitly here because otherwise IExpress will use the old command.com.

You probably also want to hide the batch window which can be done by setting the appropriate option in the IExpress wizard.

0xA3
A: 

You could write a program and embed both installers then have it check if the system is 64 bit or not. I wrote a blog post on writing a native app that does this at http://blog.foldertrack.com/?p=45

Nick