tags:

views:

260

answers:

3

I work on an WIX based installer.

The installer builds to 32 and 64 platforms separately. The installers versions are very similar in both platforms but few conditional steps like avoid registering x64 native dlls in the 32 bit installer.

Is there a way to unite both of the installers to one?

+1  A: 

I don't know enough about WiX to say for certain, but anecdotal evidence suggests this is not recommended. I'm reminded of all the downloads I see (MSDN and many others) where you must select between the 32-bit and 64-bit installer. Actually now that I think of it I've never seen nor heard of a "universal installer".

Dave Swersky
Thanks for the answer. I agree with that most installers have separated versions, do you know why? It is beneficial for users to have less worries. I am still curios to know if it's possible.
Elisha
I think the most likely reason is that few if any files are shared between 32-bit and 64-bit versions, so a combined installer would be at least twice as large. So- it's possible, but it would be inconvenient to have to download the 32-bit files if you want 64-bit and vice versa.
Dave Swersky
+4  A: 

It can't be done. It's a limitation of Windows Installer, if you want to do this without making it twice as large, then you'll need two MSI's with external CAB files and a bootstrapper to execute the correct installation.

If you don't need an MSI, try NSIS. You can do conditional installation based on OS architecture pretty easily.

Anyway, this has been also asked on the WiX-users list a number of times in recent weeks, the best response I can find is this one from Blair:

An MSI marked as 64-bit simply will not install on a 32-bit system. Nothing you can do.

An MSI marked as 32-bit simply cannot place files into a "64-bit directory" (they will be redirected to 32-bit "equivalent" folders). Nothing you can do.

An MSI cannot be marked as both 32- and 64-bit. Also nothing you can do.

The "correct" method is to generate two MSIs, one for 32-bit platforms and another for 64-bit platforms. They can share the same external cab files if you need to ship them together to save space. If you do that, you can use a bootstrapper to extract the appropriate one with your CAB(s) and install it.

sascha
Thanks sascha, this is very helpful! The NSIS seems cool too, I wish I knew if before, it could have gotten us much simpler installer :)
Elisha
+1  A: 

It is possible, to an extent. You can't do it with an MSI alone, though. An example of this is Microsoft's .NET installer packages; the "full install" package has x86 bit, x64 bit, and ia64 support. However, this installer uses a bootstrapping process to do it; it has a separate program that determines exactly what to install, and then installs it. Underneath, you still need the 32 bit MSI and the 64 bit MSI packages.

Be warned though; the architecture of your installer's bootstrapper will then determine what it can be installed on. If it's an x86 based bootstrapper, then it will only work on 32 bit windows and 64 bit windows that have WOW64 installed (a removable option with Win2k8 R2) and may not work at all on ia64 platforms!

It's really just so much simpler to provide separate installers that it's really just not worth it to bundle them. You'll be doubling or tripling the installer size, which may just turn off some customers. If it's an internal tool, then there's really no downside - having the raw msi available allows so many more (remote) installing options.

So in short: yes, you can, but not with an MSI.

Robert P