C# – Single MSI to install correct 32 or 64 bit c# application

32bit-64bitcwindowswindows-installer

I have a C# application which is built for both x86 (32 bit) and x64 (64 bit) platforms. My build system currently outputs two MSI installers, one for each platform. In case it makes a difference, my C# application includes a windows taskbar toolbar which means that the installed DLL must be loaded by the explorer.exe process.

Is it possible to produce a single MSI installer which will install the correct version of my application depending on whether the current OS is a 64 bit OS?

This has currently been achieved by using http://dotnetinstaller.codeplex.com/ to produce an EXE which performs the architecture check and then launches the correct MSI. However, I would prefer a purely MSI based approach.

Best Answer

No, this is not possible. See Heath Stewart's Different Packages are Required for Different Processor Architectures post. The only way to handle this with MSI is with a bootstrap along the lines of what you describe. If you just needed to put a file or key or two in a 64-bit location, it's possible (but not recommended) to do that in a custom action, but changing the target installation location and using built-in MSI file support won't work.