I have two versions of program built in VS2010 (.net): for x86 and x64 Windows.
Then I try to put both variants in one installer so that it determines (using VersionNT64 condition or user dialog) what system it is ran on and depending on that it should install appropriate files. Installer is set to target x86 platform, so it could be run on x86 system.
The problem is that VS gives an error when I try to put x64 file in x86 installer: "ERROR: Module 'Microsoft_VC100_CRT_x64.msm' targeting 'x64' cannot be added to a package targeting 'x86'" (Though x86 file in x64 installer is fine)
Is there a way to walk around this error? Is it possible to put x64 file in x86 installer? Or the only way is two installers for each system bitness?
Short Answer: If you don't need to target REAL x86 machines (as in real 32-bit hardware as opposed to newer 64-bit machines with x86 subsystems), then you can just set your package 64-bit and include x86 components. I think that should work.
Technical Limitation: A 64-bit
package can not install on a real x86
machine, hence a package marked as x86
can not contain 64-bit
components (or it could not install on its target platform). A x64
MSI can install both x86
components (32-bit) and x64
components (64-bit) - they should target different installation paths. Here are some details: Different Packages are Required for Different Processor Architectures (Heath Stewart of Microsoft).
Setup.exe Launcher: I suppose you could deliver a single setup.exe
containing two different MSI files: one for x86
and one for x64
and install the required one depending on target system? The setup.exe
would have to be x86
to be able to launch on x86
machines. I don't do much of this at this point, most machines are 64-bit, so I use either x86 (installs on any machine) or x64 (installs on any 64-bit machine).