<p>I'm using the VS2008 installer (plus a custom Orca action) to create an installer for my .NET product.</p>

<p>I just recently found out that one of the third-party assemblies I was using is x86-specific (as it includes some native code); thus, x64 customers were getting crashes on startup with errors about the assembly not being appropriate for their platform.</p>

<p>I sent such a customer a copy of the x64 version of this third-party assembly, and told him to just copy it over the existing x86 one. It worked, sweet! So now I just need to make the installer do this for me.</p>

<p>This actually appears nontrivial :(. Ideally, I just want the installer (which would be x86, since that can run on both platforms) to include both the x86 and x64 versions of this third-party assembly, and install the appropriate one. In other words, I want a single installer that makes my users' lives easy.</p>

<p>I thought I had this worked out, using MSI conditional statements and all that. But apparently no... the VS2008 setup projects won't compile unless you specify "x86" or "x64." If you specify x86, it gives a compilation error saying it can't include the x64 assembly. If you specify x64, then the result cannot be executed on an x86 computer. Damn!</p>

<p>Someone must have had this problem before. Unfortunately Google is unhelpful, so I turn to StackOverflow!</p>

[{'answer_id': 61101, 'author': 'Curt Hagenlocher', 'author_id': 533, 'author_profile': 'https://Stackoverflow.com/users/533', 'pm_score': 3, 'selected': False, 'text': "<p>When I looked into this a year ago, I came to the conclusion that it was not possible.  It's worth noting that many Microsoft-supplied MSI files come in separate x86 and x64 flavors -- and presumably, they'd only deliver a single file if that were possible.</p>\n"}, {'answer_id': 263610, 'author': 'Rob Hunter', 'author_id': 1145, 'author_profile': 'https://Stackoverflow.com/users/1145', 'pm_score': 1, 'selected': False, 'text': "<p>I have had some success by using two features to selectively include the two sets of files (in separate components of course, with their individualized file identifiers!). </p>\n\n<p>The installation must be marked as x32 to install on both x32 and x64.  It will always install to the x32 directories and will largely be treated as a 32 bit application running under WOW.</p>\n\n<p>Using the VersionNT64 property you can determine if a Windows 64 installation is present, and conditionally install the files you need.</p>\n\n<p>I'm not sure how much of this functionality is available in VS2008 install projects - I am using some other commercial tools to set up the installer this way.  Of course you can use Orca to do it too, though it was non-trivial to get it to work with commercial tools and Orca is much harder.</p>\n"}, {'answer_id': 354156, 'author': 'Jeroen Landheer', 'author_id': 44056, 'author_profile': 'https://Stackoverflow.com/users/44056', 'pm_score': 3, 'selected': True, 'text': '<p>If I understand you correctly, you want to do a copy of one file if you\'re installing on x86 and different file (with the same name) if you\'re installing on a x64 platform. </p>\n\n<p>First of all, you cannot create one MSI for 2 different platforms, since a x64 MSI simply will not run on a x86 platform and a x86 MSI will be installed using WOW64 on a x64 platform. </p>\n\n<p>On the other hand, you CAN create one x86 MSI that contains 2 different versions of a file and selectively copy the appropiate file during installation. </p>\n\n<p>The easiest way is using WIX (V3) instead of the build-in VS2008 MSI generator. WIX  gives you far greater control over what gets installed on the customer\'s machine and where, the ability to generate different installers for different platforms and full MSBuild support as an added bonus. (see <a href="http://wix.sourceforge.net" rel="nofollow noreferrer">http://wix.sourceforge.net</a> for more info.) </p>\n\n<p>In case if you\'re wondering that WIX is still in Beta, the generated MSI files are perfectly OK and I never ran into a bug yet. (And I develop setup projects for a living.)</p>\n\n<p>Finally, you can check with the VersionNT64 property if an x86 installer is running on a x64 platform. If that property is present, you\'re running x64, otherwise you\'re running on a x86. </p>\n\n<p>Hope this helps. </p>\n'}]
['https://Stackoverflow.com/questions/61073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3191/']