How to pack two msi files and run a condition between them?

I need to pack two msi files into one setup.exe file (via the bootloader) and run only one of them depending on the condition (x64 or x86 machine).
Is there any way to do this?

+4
source share
2 answers

You can pack two msi files using iexpress.exe (the standard Window tool), and add a custom batch file that you set as the command to launch your iexpress package. The script package will determine the architecture and run the corresponding msi file:

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

Put this code in a batch file named installmsi.bat. Then, in the IExpress wizard, enter the following installation command:

 cmd.exe /C installmsi.bat 

Here you need to explicitly call cmd.exe , because otherwise IExpress will use the old command.com .

You probably also want to hide the package window, which you can do by setting the appropriate option in the IExpress wizard.

+3
source

You can write a program and insert both installers, and then check whether the 64-bit system or not. I wrote a blog post about writing my own application that does this at http://blog.foldertrack.com/?p=45

0
source

All Articles