I'm working on a solution consisting of multiple projects (including some external 3rd party libraries). The solution has a setup project
, that installs (non-custom) prerequisites, which by default comes with x86
and x64
versions (together in 1 prerequisite). Projects within the solution have target platform set to x86
(in project properties, not on configuration selector) due to BadImageFormatException
, from unknown source.
My problem is that when I use the installer on a 64bit machine, the 64bit version of prerequisite is installed, which leads to errors saying I should use correct (which is x86) version of prerequisite.
I was wondering if I can force a particular version of prerequisite using a setup project.
EDIT/UPDATE: Since my question seems to generate a lot of confusion, I've decided to post 2 screenshots, that will hopefully explain more.
This includes both packages and I don't know of a way to to separate them. As for the error, it is a generic error for software version mismatch (something in lines of "Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. "). Unfortunately, I cannot screenshot the error, as I won't have access to the "clean" PC for a while. I get it if I use 64 bit redistributable pack (because project that uses it is 32bit), I don't get it If I use 32 bit redistributable pack, so effectively, If I can force installer to select the 32bit package, my problem is solved.
This question remains unanswered, in essence.
I solved my problem by locating the 1 library that was build for 32bit platform (for no particular reason, as it turns out) and getting it rebuilt in with target platform set to "Any CPU" (same as the rest of the project), which in turn allowed me to use the 64bit redistributable package that is chosen automatically (instead of forcing a 32bit one, as I initially intended).
An answer to this question features a PowerShell command which checks assembly info (and target CPU architecture), which is what I used to check each of eternal libraries in my project and locate the one that's build as x86.