0

I have a requirement to build a custom installer for a windows service application in such a way that the single installer should have the option (radiobutton) to select 32 bit or 64 bit version and the same selected version should be installed in the client machine.

Windows service is build in old version of VC++ and recently upgraded using VS2010.

Looking for suggestions how it can be achieve. I have already tried with Setup and deployment project and Wix.

Regards, Harish

Harish Bhatt
  • 584
  • 6
  • 15
  • possible duplicate of [One MSI for 32-bit and 64-bit](http://stackoverflow.com/questions/12244648/one-msi-for-32-bit-and-64-bit) – Adrian McCarthy Feb 18 '15 at 19:09

2 Answers2

2

You can't do that because the MSI itself is marked with its architecture so you need two separate MSI files.

http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx

where "different packages" means two separate MSI files. This isn't a "what tool can do this" question because it's the way MSI files work. On a 64-bit system you install the MSI containing both 32-bit and 64-bit components, and on x86 the MSI must contain only 32-bit components:

https://msdn.microsoft.com/en-us/library/aa367451(v=vs.85).aspx

so you only need to install one MSI on a 64-bit system.

In WiX you can build them from a common source:

http://blogs.msdn.com/b/astebner/archive/2007/08/09/4317654.aspx One MSI for 32-bit and 64-bit http://alekdavis.blogspot.com/2011/05/build-32-and-64-bit-installers-using.html

I think WiX has a bootstrapper that will choose the right MSI for the architecture of the system.

Community
  • 1
  • 1
PhilDW
  • 20,260
  • 1
  • 18
  • 28
0

I didn't find any proper way to do this but by the help of different forums and after some brain storming I was able to build the single installer which can help in creating both 32 bit or 64 bit installers.

First I created 32 bit and 64 bit MSI installers separately.
Then i created a windows form application which ask to select the the version (32bit or 64bit) and based on the selection it executes 32bit or 64bit MSI.
And at the end I created a simple installer for windows form application.

So finally I got one single installer which can be used to install both 32 bit or 64 bit version of application.

This is what was happening on executing the final installer -
1. Final installer installs the win form application in C:\temp\ directory and executes the win form application.
2. Win form app asks to select the required version (32bit or 64bit).
3. Based on selection win form application launches 32 bit or 64 bit MSI and terminates.
4. MSI gets launched and performs its operation and at the end it uninstalls the Win form application from system.

You will have to test it several times and handle some additions scenarios based on your requirement. Hope this will helpful for others.

NOTE: The reason I had to use this approach and not the Wix bootstrapper is because there were two requirements -
1. Client wanted to get option to choose which version (32bit/64bit) to install irrespective of their system architecture. It means they wanted option to use 32bit application in 64bit machine if they want.
2. They were also looking for only one single installer, means one single installer should work in both 32bit and 64bit machine which was not possible using Wix bootstrapper.

Harish Bhatt
  • 584
  • 6
  • 15