0

This question has asked before here but the question has never answered. How do I suppress the warning/error in my MS installer deployment project?

Thanks

Community
  • 1
  • 1
  • Be more specific in what you are trying to achieve, your setup etc. Have you tried the answer from the other question? Just because it was not accepted as the right answer does not mean it is not correct or will not work for you – Deepend May 07 '14 at 19:00
  • "I have created an installer for my project and I included a special .dll file that needs to be copied on the target machine. The compiler displays the following warning: File '[filename]' targeting 'Unknown' is not compatible with the project's target platform 'x86' I don't care about the target platform of that dll because I need the file for other purposes. Also, I need to leave this file "untouched" so I cannot change its target platform. So I need a way to ignore this warning." – Zhi Chen May 07 '14 at 19:07

2 Answers2

0

It's there to remind you you're doing the wrong thing because 32-bit MSIs can't contain 64-bit components:

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

and different architectures require different setups:

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

Therefore if the target machine is x64 (why else do you need a 64-bit Dll?), then you can get rid of the warning by building it as an x64 MSI file because a 64-bit MSI can contain both 32-bit and 64-bit files. I just tried this and it does get rid of the warning. I know of no other way to suppress that warning.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • I know my program is for x86, it's really nice if we don't have to create two separate msi files for x86 and x64 OS. I came across these msdn articles you mentioned, I believe there must be a way to to instruct the installer to disable checking for target platform on those files (with ext of exe and dll). Can Microsoft guys provide a workarond here? or they don't even check on this site? – Zhi Chen May 07 '14 at 22:00
  • The blog link I provided was a MS guy saying you need separate MSIs for separate architectures, and the current VS setup projects are gone after VS 2010 to be replaced with something different in VS 2013. – PhilDW May 07 '14 at 23:02
  • You could build a single EXE bootstrapper that contains two MSIs and launches them based on the platform architecture. Advanced Installer has a predefined support for this in its mixed packages (http://www.advancedinstaller.com/user-guide/mixed-32-64-wizard.html). – Bogdan Mitrache May 08 '14 at 06:25
0

Dear stackoverflow friends, If you follow the suggestions given in msdn or its blogs or other installer vendors, they will drive you in circles.

If you read my original question it is really straightforward - whether it is a common practice is a separate question. But I and others do need a solution for this deployment scenario.

So I have found the easiest workaround the installer limitation (disallowing x64 assembly in x86 target platform) is compress to the file(s) and include it into the project, the installer cannot detect it is for x64. The next step is to create a custom action to decompress in AfterInstall event and delete the decompress files(s) in the AfterUninstall event. Custom action dlls are really easy to create!!

I hope this helps others who is trying to accomplish similar deployment scenarios.